diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log.meta new file mode 100644 index 00000000..b51e74a5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19fb05683c89f9d438ce6cb7e65de2ec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log/EmuLogger.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log/EmuLogger.cs new file mode 100644 index 00000000..4d8b2b44 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log/EmuLogger.cs @@ -0,0 +1,33 @@ +using MAME.Core; +using System; + +namespace MAME.Core +{ + public static class EmuLogger + { + + #region 抽象出去 + static Action Act_Log; + + public static void BindFunc(ILog ilog) + { + Act_Log -= Act_Log; + + Act_Log += ilog.Log; + } + + public static void Log(string msg) + { + Act_Log?.Invoke(msg); + } + + + public static void Assert(bool conditional, string msg) + { + if (conditional) + return; + Act_Log?.Invoke(msg); + } + #endregion + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log/EmuLogger.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log/EmuLogger.cs.meta new file mode 100644 index 00000000..c1aab71c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Log/EmuLogger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 152466b6f17e41244be3f9dd18aee4e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAME.Core.dll b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAME.Core.dll deleted file mode 100644 index 41378a26..00000000 Binary files a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAME.Core.dll and /dev/null differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAME.Core.dll.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAME.Core.dll.meta deleted file mode 100644 index e9ce1de3..00000000 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAME.Core.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 271a8a6401146c04ab5fb754032a2dd5 \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEDBHelper.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEDBHelper.cs new file mode 100644 index 00000000..270e2fbd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEDBHelper.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; + + +namespace MAME.Core +{ + public class MAMEDBHelper + { + public static void LoadROMXML(string xmbString) + { + XElement xe = XElement.Parse(xmbString); + IEnumerable elements = from ele in xe.Elements("game") select ele; + showInfoByElements(elements); + } + + static void showInfoByElements(IEnumerable elements) + { + RomInfo.romList = new List(); + RomInfo.dictName2Rom = new Dictionary(); + foreach (var ele in elements) + { + RomInfo rom = new RomInfo(); + rom.Name = ele.Attribute("name").Value; + rom.Board = ele.Attribute("board").Value; + rom.Parent = ele.Element("parent").Value; + rom.Direction = ele.Element("direction").Value; + rom.Description = ele.Element("description").Value; + rom.Year = ele.Element("year").Value; + rom.Manufacturer = ele.Element("manufacturer").Value; + RomInfo.romList.Add(rom); + RomInfo.dictName2Rom[rom.Name] = rom; + //loadform.listView1.Items.Add(new ListViewItem(new string[] { rom.Description, rom.Year, rom.Name, rom.Parent, rom.Direction, rom.Manufacturer, rom.Board })); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEDBHelper.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEDBHelper.cs.meta new file mode 100644 index 00000000..0f85cb38 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEDBHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 22cdf3c2148e1a24ca9353926f553d77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs new file mode 100644 index 00000000..29dc7b90 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +namespace MAME.Core +{ + public class MAMEEmu : IDisposable + { + public MameMainMotion mameMainMotion { get; private set; } + //byte[] mGameTileData; + //byte[] mtileListData; + public MAMEEmu() + { + mameMainMotion = new MameMainMotion(); + } + + public bool bRom => mameMainMotion.bRom; + + public void Init( + string RomDir, + ILog ilog, + IResources iRes, + IVideoPlayer ivp, + ISoundPlayer isp, + IKeyboard ikb, + IMouse imou, + ITimeSpan itime + ) => mameMainMotion.Init(RomDir, ilog, iRes, ivp, isp, ikb, imou, itime); + + public void ResetRomRoot(string RomDir) => mameMainMotion.ResetRomRoot(RomDir); + + public Dictionary GetGameList() => mameMainMotion.GetGameList(); + public void LoadRom(string Name) => mameMainMotion.LoadRom(Name); + public void GetGameScreenSize(out int _width, out int _height, out IntPtr _framePtr) => mameMainMotion.GetGameScreenSize(out _width, out _height, out _framePtr); + public void StartGame() => mameMainMotion.StartGame(); + public void StartGame_WithNewThread() => mameMainMotion.StartGame_WithNewThread(); + public void UpdateFrame() => Mame.mame_execute_UpdateMode_NextFrame(); + public void UnlockNextFreme(int moreTick = 1) => mameMainMotion.UnlockNextFreme(moreTick); + public void StopGame() => mameMainMotion.StopGame(); + public long currEmuFrame => Video.screenstate.frame_number; + public bool IsPaused => Mame.paused; + public void LoadState(BinaryReader sr) + { + Mame.paused = true; + Thread.Sleep(20); + State.loadstate_callback.Invoke(sr); + Mame.postload(); + Thread.Sleep(20); + Mame.paused = false; + } + + public void SaveState(BinaryWriter sw) + { + Mame.paused = true; + Thread.Sleep(20); + State.savestate_callback.Invoke(sw); + Thread.Sleep(20); + Mame.paused = false; + } + + public void Dispose() + { + mameMainMotion.StopGame(); + mameMainMotion = null; + GC.Collect(); + AxiMemoryEx.FreeAllGCHandle(); + } + + public void SetPaused(bool ispaused) + { + Mame.paused = ispaused; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs.meta new file mode 100644 index 00000000..33a8bfb2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 35d7d011a9c354848a421281c06f5f8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Mame.Core.asmdef b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Mame.Core.asmdef new file mode 100644 index 00000000..40ff6b81 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Mame.Core.asmdef @@ -0,0 +1,14 @@ +{ + "name": "Mame.Core", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Mame.Core.asmdef.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Mame.Core.asmdef.meta new file mode 100644 index 00000000..c1be1c63 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Mame.Core.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9cfb12a06e639a448b797cd60959004e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion.meta new file mode 100644 index 00000000..d309994b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ebd8f2e90f8767b498f2431f7394ede9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs new file mode 100644 index 00000000..a2988171 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs @@ -0,0 +1,613 @@ +using System; +using System.Collections.Generic; +using System.Threading; + +namespace MAME.Core +{ + public class MameMainMotion + { + public string tsslStatus; + //public CheatMotion cheatmotion; + public M68000Motion m68000motion; + public Z80Motion z80motion; + public M6809Motion m6809motion; + public CpsMotion cpsmotion; + public NeogeoMotion neogeomotion; + public Konami68000Motion konami68000motion; + public string sSelect; + public static Thread mainThread; + + //初始化停帧信号量 + public AutoResetEvent emuAutoLoopEvent; + + public static IResources resource; + public bool bRom => Machine.bRom; + + public MameMainMotion() + { + neogeomotion = new NeogeoMotion(); + //cheatmotion = new CheatMotion(); + m68000motion = new M68000Motion(); + m6809motion = new M6809Motion(); + z80motion = new Z80Motion(); + cpsmotion = new CpsMotion(); + konami68000motion = new Konami68000Motion(); + } + + public void Init( + string RomDir, + ILog ilog, + IResources iRes, + IVideoPlayer ivp, + ISoundPlayer isp, + IKeyboard ikb, + IMouse imou, + ITimeSpan itime + ) + { + AxiMemoryEx.Init(); + + AxiTimeSpan.Init(itime); + + Mame.RomRoot = RomDir; + EmuLogger.BindFunc(ilog); + Video.BindFunc(ivp); + Sound.BindFunc(isp); + resource = iRes; + + sSelect = string.Empty; + + RomInfo.Rom = new RomInfo(); + MAMEDBHelper.LoadROMXML(resource.mame); + Keyboard.InitializeInput(ikb); + Mouse.InitialMouse(imou); + } + + public void ResetRomRoot(string RomDir) + { + Mame.RomRoot = RomDir; + } + + + public Dictionary GetGameList() + { + return RomInfo.dictName2Rom; + } + + public void GetGameScreenSize(out int _width, out int _height, out IntPtr _framePtr) + { + //_width = Video.fullwidth; + //_height = Video.fullheight; + //_framePtr = Video.bitmapcolor_Ptr; + _width = Video.width; + _height = Video.height; + _framePtr = Video.bitmapcolorRect_Ptr; + } + + + public void LoadRom(string Name) + { + RomInfo.Rom = RomInfo.GetRomByName(Name); + if (RomInfo.Rom == null) + { + EmuLogger.Log("Not Found"); + return; + } + + EmuTimer.lt = new List(); + sSelect = RomInfo.Rom.Name; + Machine.mainMotion = this; + Machine.rom = RomInfo.Rom; + Machine.sName = Machine.rom.Name; + Machine.sParent = Machine.rom.Parent; + Machine.sBoard = Machine.rom.Board; + Machine.sDirection = Machine.rom.Direction; + Machine.sDescription = Machine.rom.Description; + Machine.sManufacturer = Machine.rom.Manufacturer; + Machine.lsParents = RomInfo.GetParents(Machine.sName); + int i; + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + + Video.nMode = 1; + Video.iMode = 2; + //Video.nMode = 3; + itemSelect(); + CPS.CPSInit(); + break; + case "Data East": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Dataeast.DataeastInit(); + break; + case "Tehkan": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Tehkan.PbactionInit(); + break; + case "Neo Geo": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Neogeo.NeogeoInit(); + break; + case "SunA8": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + SunA8.SunA8Init(); + break; + case "Namco System 1": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Namcos1.Namcos1Init(); + break; + case "IGS011": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + IGS011.IGS011Init(); + break; + case "PGM": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + PGM.PGMInit(); + break; + case "M72": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + M72.M72Init(); + break; + case "M92": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + M92.M92Init(); + break; + case "Taito": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Taito.TaitoInit(); + break; + case "Taito B": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Taitob.TaitobInit(); + break; + case "Konami 68000": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Konami68000.Konami68000Init(); + break; + case "Capcom": + Video.nMode = 1; + Video.iMode = 0; + itemSelect(); + Capcom.CapcomInit(); + break; + } + if (Machine.bRom) + { + EmuLogger.Log("MAME.NET: " + Machine.sDescription + " [" + Machine.sName + "]"); + Mame.init_machine(); + Generic.nvram_load(); + } + else + { + EmuLogger.Log("error rom"); + } + } + + public void StartGame() + { + bIsNewThreadMode = false; + Mame.exit_pending = false; + + Mame.mame_execute_UpdateMode_Start(); + } + + public void StartGame_WithNewThread() + { + bIsNewThreadMode = true; + Mame.exit_pending = false; + + //初始化停帧信号量 + emuAutoLoopEvent = new AutoResetEvent(false); + + mainThread = new Thread(Mame.mame_execute); + mainThread.Start(); + } + + + public static object unlockMoreFrameObj = new object(); + public static int unlockMoreFrame; + /// + /// 放开帧 + /// + /// + public void UnlockNextFreme(int moreTick = 1) + { + if (!bIsNewThreadMode) + return; + + emuAutoLoopEvent.Set(); + + //TODO 等待跳帧时测试 + if (moreTick > 1) + { + lock (unlockMoreFrameObj) + { + unlockMoreFrame += moreTick; + } + } + } + + /// + /// 等待放行帧 + /// + public void WaitNextFrame() + { + //TODO 等待跳帧时测试 + lock (unlockMoreFrameObj) + { + if (unlockMoreFrame > 0) + { + unlockMoreFrame--; + //还有记数,则直接放行 + return; + } + } + + //等待停帧数 + Machine.mainMotion.WaitAutoEvent(); + } + + private void WaitAutoEvent() + { + if (!bIsNewThreadMode) + return; + emuAutoLoopEvent.WaitOne(); + } + + public void StopGame() + { + if (Machine.bRom) + { + Mame.exit_pending = true; + Thread.Sleep(50); + } + } + + private void itemSelect() + { + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + if (Video.iMode == 0) + { + Video.offsetx = 0; + Video.offsety = 0; + Video.width = 512; + Video.height = 512; + } + else if (Video.iMode == 1) + { + Video.offsetx = 0; + Video.offsety = 256; + Video.width = 512; + Video.height = 256; + } + else if (Video.iMode == 2) + { + Video.offsetx = 64; + Video.offsety = 272; + Video.width = 384; + Video.height = 224; + } + break; + case "Data East": + if (Video.iMode == 0) + { + Video.offsetx = 0; + Video.offsety = 16; + Video.width = 256; + Video.height = 224; + } + break; + case "Tehkan": + if (Video.iMode == 0) + { + Video.offsetx = 0; + Video.offsety = 16; + Video.width = 256; + Video.height = 224; + } + break; + case "Neo Geo": + if (Video.iMode == 0) + { + Video.offsetx = 30; + Video.offsety = 16; + Video.width = 320; + Video.height = 224; + } + break; + case "SunA8": + if (Video.iMode == 0) + { + Video.offsetx = 0; + Video.offsety = 16; + Video.width = 256; + Video.height = 224; + } + break; + case "Namco System 1": + if (Video.iMode == 0) + { + Video.offsetx = 73; + Video.offsety = 16; + Video.width = 288; + Video.height = 224; + } + break; + case "IGS011": + if (Video.iMode == 0) + { + Video.offsetx = 0; + Video.offsety = 0; + Video.width = 512; + Video.height = 240; + } + break; + case "PGM": + if (Video.iMode == 0) + { + Video.offsetx = 0; + Video.offsety = 0; + Video.width = 448; + Video.height = 224; + } + break; + case "M72": + if (Video.iMode == 0) + { + Video.offsetx = 64; + Video.offsety = 0; + Video.width = 384; + Video.height = 256; + } + break; + case "M92": + if (Video.iMode == 0) + { + Video.offsetx = 80; + Video.offsety = 8; + Video.width = 320; + Video.height = 240; + } + break; + case "Taito": + if (Video.iMode == 0) + { + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + Video.offsetx = 0; + Video.offsety = 16; + Video.width = 256; + Video.height = 224; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + Video.offsetx = 0; + Video.offsety = 8; + Video.width = 320; + Video.height = 240; + break; + } + } + break; + case "Taito B": + if (Video.iMode == 0) + { + Video.offsetx = 0; + Video.offsety = 16; + Video.width = 320; + Video.height = 224; + } + break; + case "Konami 68000": + if (Video.iMode == 0) + { + switch (Machine.sName) + { + case "cuebrick": + case "mia": + case "mia2": + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + Video.offsetx = 104; + Video.offsety = 16; + Video.width = 304; + Video.height = 224; + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + case "blswhstl": + case "blswhstla": + case "detatwin": + Video.offsetx = 96; + Video.offsety = 16; + Video.width = 320; + Video.height = 224; + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + case "glfgreat": + case "glfgreatj": + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + case "prmrsocr": + case "prmrsocrj": + Video.offsetx = 112; + Video.offsety = 16; + Video.width = 288; + Video.height = 224; + break; + } + } + break; + case "Capcom": + if (Video.iMode == 0) + { + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Video.offsetx = 0; + Video.offsety = 16; + Video.width = 256; + Video.height = 224; + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + Video.offsetx = 64; + Video.offsety = 16; + Video.width = 384; + Video.height = 224; + break; + } + } + break; + } + switch (Machine.sDirection) + { + case "": + case "180": + TempWidth = Video.width + 38; + TempHeight = Video.height + 108; + break; + case "90": + case "270": + TempWidth = Video.height + 38; + TempHeight = Video.width + 108; + break; + } + ResizeMain(); + } + + int TempWidth = 0; + int TempHeight = 0; + private bool bIsNewThreadMode; + + private void ResizeMain() + { + int deltaX, deltaY; + //switch (Machine.sDirection) + //{ + // case "": + // case "180": + // deltaX = TempWidth - (Video.width + 38); + // deltaY = TempHeight - (Video.height + 108); + // pictureBox1.Width = Video.width + deltaX; + // pictureBox1.Height = Video.height + deltaY; + // break; + // case "90": + // case "270": + // deltaX = TempWidth - (Video.height + 38); + // deltaY = TempHeight - (Video.width + 108); + // pictureBox1.Width = Video.height + deltaX; + // pictureBox1.Height = Video.width + deltaY; + // break; + //} + + //TODO reset 宽高 + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs.meta new file mode 100644 index 00000000..1f417358 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eacdf053bdef1934d8cdec1c463f8847 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/cpsMotion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/cpsMotion.cs new file mode 100644 index 00000000..cf184a55 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/cpsMotion.cs @@ -0,0 +1,9 @@ +namespace MAME.Core +{ + public partial class CpsMotion + { + public CpsMotion() + { + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/cpsMotion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/cpsMotion.cs.meta new file mode 100644 index 00000000..c7195996 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/cpsMotion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 08bc0c1fe9979244e872263dfe2c09b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/konami68000Motion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/konami68000Motion.cs new file mode 100644 index 00000000..b95d1e7a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/konami68000Motion.cs @@ -0,0 +1,9 @@ +namespace MAME.Core +{ + public class Konami68000Motion + { + public Konami68000Motion() + { + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/konami68000Motion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/konami68000Motion.cs.meta new file mode 100644 index 00000000..c966b774 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/konami68000Motion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 85d3575e43093a54f82622b4c53c1a40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m68000Motion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m68000Motion.cs new file mode 100644 index 00000000..dc5a81c4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m68000Motion.cs @@ -0,0 +1,13 @@ +using cpu.m68000; +using System; +using System.Collections.Generic; + +namespace MAME.Core +{ + public class M68000Motion + { + public M68000Motion() + { + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m68000Motion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m68000Motion.cs.meta new file mode 100644 index 00000000..751789aa --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m68000Motion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43abb82203533b94fa07632370f6ca15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m6809Motion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m6809Motion.cs new file mode 100644 index 00000000..8479d4cd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m6809Motion.cs @@ -0,0 +1,13 @@ +using cpu.m6809; +using System.Collections.Generic; + +namespace MAME.Core +{ + + public partial class M6809Motion + { + public M6809Motion() + { + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m6809Motion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m6809Motion.cs.meta new file mode 100644 index 00000000..c1758f56 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/m6809Motion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c291a8abf15d254596af257bb937441 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/neogeoMotion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/neogeoMotion.cs new file mode 100644 index 00000000..9fb76754 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/neogeoMotion.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace MAME.Core +{ + public partial class NeogeoMotion + { + public NeogeoMotion() + { + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/neogeoMotion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/neogeoMotion.cs.meta new file mode 100644 index 00000000..b207677f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/neogeoMotion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1dce3116faca2f43a19f5e965e245e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/z80Motion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/z80Motion.cs new file mode 100644 index 00000000..1fd56fa5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/z80Motion.cs @@ -0,0 +1,14 @@ +using cpu.z80; +using System.Collections.Generic; + +namespace MAME.Core +{ + public partial class Z80Motion + { + + public Z80Motion() + { + } + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/z80Motion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/z80Motion.cs.meta new file mode 100644 index 00000000..d1fee5ad --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/z80Motion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cb936512a0186e449fa3a9053127b42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/ObjectPoolAuto.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/ObjectPoolAuto.cs new file mode 100644 index 00000000..56dd3a31 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/ObjectPoolAuto.cs @@ -0,0 +1,438 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +namespace MAME.Core +{ + internal static class ObjectPoolAuto + { + /************************************************************************************************************************/ + + /// + /// 获取或者创建一个新的 + /// + /// Remember to 需要回收参见这个 + public static T Acquire() + where T : class, new() + => ObjectPool.Acquire(); + + /// + /// 获取或者创建一个新的 + /// + /// Remember to 需要回收参见这个 + public static void Acquire(out T item) + where T : class, new() + => item = ObjectPool.Acquire(); + /************************************************************************************************************************/ + + /// + /// 回收对象 + /// + public static void Release(T item) + where T : class, new() + => ObjectPool.Release(item); + + /// + /// 回收对象 + /// + public static void Release(ref T item) where T : class, new() + { + if (item != null) + { + ObjectPool.Release(item); + item = null; + } + } + + /************************************************************************************************************************/ + public const string + NotClearError = " They must be cleared before being released to the pool and not modified after that."; + + /************************************************************************************************************************/ + + /// + /// 获取或创建List + /// + /// Remember to 回收参见此方法 + public static List AcquireList() + { + var list = ObjectPool>.Acquire(); + EmuLogger.Assert(list.Count == 0, "A pooled list is not empty." + NotClearError); + return list; + } + + /// + /// 回收List + /// + public static void Release(List list) + { + list.Clear(); + ObjectPool>.Release(list); + } + /// + /// 回收List内容 + /// + /// + /// + public static void ReleaseListContent(List list) where T : class, new() + { + foreach (var item in list) + { + ObjectPool.Release(item); + } + list.Clear(); + } + + /************************************************************************************************************************/ + + /// + /// 获取或创建HashSet + /// + public static HashSet AcquireSet() + { + var set = ObjectPool>.Acquire(); + EmuLogger.Assert(set.Count == 0, "A pooled set is not empty." + NotClearError); + return set; + } + + /// + /// 释放HashSet + /// + public static void Release(HashSet set) + { + set.Clear(); + ObjectPool>.Release(set); + } + + /************************************************************************************************************************/ + + /// + /// 获取一个字符串StringBuilder + /// + /// Remember to 回收参见这个 + public static StringBuilder AcquireStringBuilder() + { + var builder = ObjectPool.Acquire(); + EmuLogger.Assert(builder.Length == 0, $"A pooled {nameof(StringBuilder)} is not empty." + NotClearError); + return builder; + } + + /// + /// 回收 StringBuilder + /// + public static void Release(StringBuilder builder) + { + builder.Length = 0; + ObjectPool.Release(builder); + } + + /// + /// 回收 StringBuilder + /// + public static string ReleaseToString(this StringBuilder builder) + { + var result = builder.ToString(); + Release(builder); + return result; + } + + /************************************************************************************************************************/ + + private static class Cache + { + public static readonly Dictionary, T>> + Results = new Dictionary, T>>(); + } + + /// + /// 此方法主要用于频繁绘制缓存,比如说GUI绘制 + /// + public static T GetCachedResult(Func function) + { + var method = function.Method; + if (!Cache.Results.TryGetValue(method, out var result)) + { + + result = new KeyValuePair, T>(function, function()); + Cache.Results.Add(method, result); + } + else if (result.Key != function) + { + EmuLogger.Log( + $"{nameof(GetCachedResult)}<{typeof(T).Name}>" + + $" was previously called on {method.Name} with a different target." + + " This likely means that a new delegate is being passed into every call" + + " so it can't actually return the same cached object."); + } + + return result.Value; + } + + /************************************************************************************************************************/ + + public static class Disposable + { + /************************************************************************************************************************/ + + /// + /// Calls to get a spare if + /// + public static IDisposable Acquire(out T item) + where T : class, new() + => ObjectPool.Disposable.Acquire(out item); + + /************************************************************************************************************************/ + + /// + /// Calls to get a spare if + /// + public static IDisposable AcquireList(out List list) + { + var disposable = ObjectPool>.Disposable.Acquire(out list, onRelease: (l) => l.Clear()); + EmuLogger.Assert(list.Count == 0, "A pooled list is not empty." + NotClearError); + return disposable; + } + + /************************************************************************************************************************/ + + /// + /// Calls to get a spare if + /// + public static IDisposable AcquireSet(out HashSet set) + { + var disposable = ObjectPool>.Disposable.Acquire(out set, onRelease: (s) => s.Clear()); + EmuLogger.Assert(set.Count == 0, "A pooled set is not empty." + NotClearError); + return disposable; + } + + /************************************************************************************************************************/ + } + /************************************************************************************************************************/ + public static class ObjectPool where T : class, new() + { + /************************************************************************************************************************/ + + private static readonly List + Items = new List(); + + /************************************************************************************************************************/ + + /// The number of spare items currently in the pool. + public static int Count + { + get => Items.Count; + set + { + var count = Items.Count; + if (count < value) + { + if (Items.Capacity < value) + Items.Capacity = NextPowerOfTwo(value); + + do + { + Items.Add(new T()); + count++; + } + while (count < value); + + } + else if (count > value) + { + Items.RemoveRange(value, count - value); + } + } + } + + + // 计算大于或等于给定数的最小的2的幂 + public static int NextPowerOfTwo(int value) + { + // 处理value为0的特殊情况 + if (value == 0) + return 1; + + // value已经是2的幂的情况 + if ((value & (value - 1)) == 0) + return value; + + // 不断左移直到找到一个大于或等于value的2的幂 + int powerOfTwo = 1; + while (powerOfTwo < value) + { + powerOfTwo <<= 1; // 左移一位,相当于乘以2 + } + + return powerOfTwo; + } + + /************************************************************************************************************************/ + + /// + /// If the is less than the specified value, this method increases it to that value by + /// creating new objects. + /// + public static void SetMinCount(int count) + { + if (Count < count) + Count = count; + } + + /************************************************************************************************************************/ + + /// The of the internal list of spare items. + public static int Capacity + { + get => Items.Capacity; + set + { + if (Items.Count > value) + Items.RemoveRange(value, Items.Count - value); + Items.Capacity = value; + } + } + + /************************************************************************************************************************/ + + /// Returns a spare item if there are any, or creates a new one. + /// Remember to it when you are done. + public static T Acquire() + { + var count = Items.Count; + if (count == 0) + { + return new T(); + } + else + { + count--; + var item = Items[count]; + Items.RemoveAt(count); + + return item; + } + } + + /************************************************************************************************************************/ + + /// Adds the `item` to the list of spares so it can be reused. + public static void Release(T item) + { + Items.Add(item); + + } + + /************************************************************************************************************************/ + + /// Returns a description of the state of this pool. + public static string GetDetails() + { + return + $"{typeof(T).Name}" + + $" ({nameof(Count)} = {Items.Count}" + + $", {nameof(Capacity)} = {Items.Capacity}" + + ")"; + } + + /************************************************************************************************************************/ + + /// + /// An system to allow pooled objects to be acquired and released within using + /// statements instead of needing to manually release everything. + /// + public sealed class Disposable : IDisposable + { + /************************************************************************************************************************/ + + private static readonly List LazyStack = new List(); + + private static int _ActiveDisposables; + + private T _Item; + private Action _OnRelease; + + /************************************************************************************************************************/ + + private Disposable() { } + + /// + /// Calls to set the `item` and returns an + /// that will call on the `item` when disposed. + /// + public static IDisposable Acquire(out T item, Action onRelease = null) + { + Disposable disposable; + + if (LazyStack.Count <= _ActiveDisposables) + { + LazyStack.Add(disposable = new Disposable()); + } + else + { + disposable = LazyStack[_ActiveDisposables]; + } + + _ActiveDisposables++; + + disposable._Item = item = ObjectPool.Acquire(); + disposable._OnRelease = onRelease; + return disposable; + } + + /************************************************************************************************************************/ + + void IDisposable.Dispose() + { + _OnRelease?.Invoke(_Item); + Release(_Item); + _ActiveDisposables--; + } + /************************************************************************************************************************/ + } + } + + #region ExtFunctions + public struct PoolHandle : IDisposable + where T : class, new() + { + public T Ins; + internal static PoolHandle Create(T poolIns) + { + return new PoolHandle { Ins = poolIns }; + } + + public void Dispose() + { + ObjectPoolAuto.Release(Ins); + } + } + public struct PoolListHandle : IDisposable + { + public List Ins; + internal static PoolListHandle Create(List poolIns) + { + return new PoolListHandle { Ins = poolIns }; + } + + public void Dispose() + { + ObjectPoolAuto.Release(Ins); + } + } + + public static PoolHandle PoolScope() + where T : class, new() + { + return PoolHandle.Create(ObjectPoolAuto.Acquire()); + } + public static PoolListHandle PoolListScope() + { + return PoolListHandle.Create(ObjectPoolAuto.AcquireList()); + } + #endregion + + } +} + + diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/ObjectPoolAuto.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/ObjectPoolAuto.cs.meta new file mode 100644 index 00000000..7dc7aae1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/ObjectPoolAuto.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f22c2fa157c9e6045ad5307124c8a365 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties.meta new file mode 100644 index 00000000..eb20f490 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0f2056e5d40c9e4b87a70bb42c0665d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles.meta new file mode 100644 index 00000000..e4dc445f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 87f805602538c22479c796f78f64b052 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 00000000..659e1eea --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,13 @@ + + + + + Release + Any CPU + bin\Release\netstandard2.0\publish\ + FileSystem + <_TargetId>Folder + + \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.meta new file mode 100644 index 00000000..8f817e82 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6e66dd647cf36e64eba535a9422b5dfd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.user b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.user new file mode 100644 index 00000000..c473ac94 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -0,0 +1,10 @@ + + + + + True|2024-08-30T07:41:53.2597006Z||;True|2024-08-29T17:00:35.4694695+08:00||;True|2024-08-29T16:40:23.7314446+08:00||;True|2024-08-29T16:17:16.6219882+08:00||;False|2024-08-29T15:55:34.5778980+08:00||;True|2024-08-29T15:34:15.1410739+08:00||;False|2024-08-29T15:31:15.0815441+08:00||;False|2024-08-29T15:29:46.6749330+08:00||;False|2024-08-29T15:27:48.9116490+08:00||;False|2024-08-29T15:27:23.2208875+08:00||;True|2024-08-28T16:12:23.3416224+08:00||;True|2024-08-28T13:18:21.7983285+08:00||;True|2024-08-28T12:54:14.9742502+08:00||;True|2024-08-28T12:09:37.5280942+08:00||;True|2024-08-28T12:07:03.6717540+08:00||;True|2024-08-07T18:02:59.4096796+08:00||;False|2024-08-07T18:02:44.0239078+08:00||;True|2024-07-31T17:00:23.0585720+08:00||;True|2024-07-31T17:00:19.8123170+08:00||;True|2024-07-30T20:51:40.9773933+08:00||;True|2024-07-30T17:04:12.3440051+08:00||;True|2024-07-30T17:01:28.0849009+08:00||;True|2024-07-30T10:36:57.5301145+08:00||; + + + \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.user.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.user.meta new file mode 100644 index 00000000..8e7b2929 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Properties/PublishProfiles/FolderProfile.pubxml.user.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a5cd247a5a04ff44bbdce6ed08ab6ccb +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan.meta new file mode 100644 index 00000000..d570588b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69d9e952f0a1b3349b7127b9f01238f3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan/AxiTimeSpan.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan/AxiTimeSpan.cs new file mode 100644 index 00000000..bc4c3e1a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan/AxiTimeSpan.cs @@ -0,0 +1,13 @@ +using MAME.Core; + +namespace MAME.Core +{ + public static class AxiTimeSpan + { + public static ITimeSpan itime { get; private set; } + public static void Init(ITimeSpan itimespan) + { + itime = itimespan; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan/AxiTimeSpan.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan/AxiTimeSpan.cs.meta new file mode 100644 index 00000000..5d0909a3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/TimeSpan/AxiTimeSpan.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13fc2a860c40ef54b917a94ebf44f187 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu.meta new file mode 100644 index 00000000..88cb4e05 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5256a2747754bc84095436214447d27b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502.meta new file mode 100644 index 00000000..32453a20 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: efa49c62f62f6f048a465cb5e940eeae +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ill02.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ill02.cs new file mode 100644 index 00000000..5065c35a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ill02.cs @@ -0,0 +1,187 @@ +namespace cpu.m6502 +{ + public partial class M6502 + { + private void ANC(int tmp) + { + p &= (byte)~F_C; + a = (byte)(a & tmp); + if ((a & 0x80) != 0) + { + p |= F_C; + } + SET_NZ(a); + } + private void ASR(ref int tmp) + { + tmp &= a; + LSR(ref tmp); + } + private void AST(int tmp) + { + sp.LowByte &= (byte)tmp; + a = x = sp.LowByte; + SET_NZ(a); + } + private void ARR(ref int tmp) + { + if ((p & F_D) != 0) + { + int lo, hi, t; + tmp &= a; + t = tmp; + hi = tmp & 0xf0; + lo = tmp & 0x0f; + if ((p & F_C) != 0) + { + tmp = (tmp >> 1) | 0x80; + p |= F_N; + } + else + { + tmp >>= 1; + p &= (byte)~F_N; + } + if (tmp != 0) + { + p &= (byte)~F_Z; + } + else + { + p |= F_Z; + } + if (((t ^ tmp) & 0x40) != 0) + { + p |= F_V; + } + else + { + p &= (byte)~F_V; + } + if (lo + (lo & 0x01) > 0x05) + { + tmp = (tmp & 0xf0) | ((tmp + 6) & 0xf); + } + if (hi + (hi & 0x10) > 0x50) + { + p |= F_C; + tmp = (tmp + 0x60) & 0xff; + } + else + { + p &= (byte)~F_C; + } + } + else + { + tmp &= a; + ROR(ref tmp); + p &= (byte)~(F_V | F_C); + if ((tmp & 0x40) != 0) + { + p |= F_C; + } + if ((tmp & 0x60) == 0x20 || (tmp & 0x60) == 0x40) + { + p |= F_V; + } + } + } + private void ASX(int tmp) + { + p &= (byte)~F_C; + x &= a; + if (x >= tmp) + { + p |= F_C; + } + x = (byte)(x - tmp); + SET_NZ(x); + } + private void AXA(int tmp) + { + a = (byte)((a | 0xee) & x & tmp); + SET_NZ(a); + } + private void DCP(ref int tmp) + { + tmp = (byte)(tmp - 1); + p &= (byte)~F_C; + if (a >= tmp) + { + p |= F_C; + } + SET_NZ((byte)(a - tmp)); + } + private void ISB(ref int tmp) + { + tmp = (byte)(tmp + 1); + SBC(tmp); + } + private void LAX(int tmp) + { + a = x = (byte)tmp; + SET_NZ(a); + } + private void OAL(int tmp) + { + a = x = (byte)((a | 0xee) & tmp); + SET_NZ(a); + } + private void RLA(ref int tmp) + { + tmp = (tmp << 1) | (p & F_C); + p = (byte)((p & ~F_C) | ((tmp >> 8) & F_C)); + tmp = (byte)tmp; + a &= (byte)tmp; + SET_NZ(a); + } + private void RRA(ref int tmp) + { + tmp |= (p & F_C) << 8; + p = (byte)((p & ~F_C) | (tmp & F_C)); + tmp = (byte)(tmp >> 1); + ADC(tmp); + } + private void SAX(ref int tmp) + { + tmp = a & x; + } + private void SLO(ref int tmp) + { + p = (byte)((p & ~F_C) | ((tmp >> 7) & F_C)); + tmp = (byte)(tmp << 1); + a |= (byte)tmp; + SET_NZ(a); + } + private void SRE(ref int tmp) + { + p = (byte)((p & ~F_C) | (tmp & F_C)); + tmp = (byte)tmp >> 1; + a ^= (byte)tmp; + SET_NZ(a); + } + private void SAH(ref int tmp) + { + tmp = a & x & (ea.HighByte + 1); + } + private void SSH(ref int tmp) + { + sp.LowByte = (byte)(a & x); + tmp = sp.LowByte & (ea.HighByte + 1); + } + private void SXH(ref int tmp) + { + tmp = x & (ea.HighByte + 1); + } + private void SYH(ref int tmp) + { + tmp = y & (ea.HighByte + 1); + } + private void KIL() + { + pc.LowWord--; + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ill02.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ill02.cs.meta new file mode 100644 index 00000000..3780bff3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ill02.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f888c964f0338f48a49e0eaedeb54ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502.cs new file mode 100644 index 00000000..450878cd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502.cs @@ -0,0 +1,272 @@ +using MAME.Core; +using System; +using System.IO; +//using System.IO; + +namespace cpu.m6502 +{ + public partial class M6502 : cpuexec_data + { + public static M6502[] mm1; + public Action[] insn, insn6502; + public byte subtype; + public Register ppc, pc, sp, zp, ea; + public byte p, a, x, y, pending_irq, after_cli, nmi_state, irq_state, so_state; + public delegate int irq_delegate(int i); + public irq_delegate irq_callback; + public delegate byte read8handler(ushort offset); + public delegate void write8handler(ushort offset, byte value); + public read8handler rdmem_id; + public write8handler wrmem_id; + private ushort M6502_NMI_VEC = 0xfffa, M6502_RST_VEC = 0xfffc, M6502_IRQ_VEC = 0xfffe; + private int M6502_SET_OVERFLOW = 1; + private int m6502_IntOccured; + protected ulong totalExecutedCycles; + protected int pendingCycles; + public override ulong TotalExecutedCycles + { + get + { + return totalExecutedCycles; + } + set + { + totalExecutedCycles = value; + } + } + public override int PendingCycles + { + get + { + return pendingCycles; + } + set + { + pendingCycles = value; + } + } + public Func ReadOp, ReadOpArg; + public Func ReadMemory; + public Action WriteMemory; + public byte default_rdmem_id(ushort offset) + { + return ReadMemory(offset); + } + private void default_wdmem_id(ushort offset, byte data) + { + WriteMemory(offset, data); + } + public M6502() + { + insn6502 = new Action[]{ + m6502_00,m6502_01,m6502_02,m6502_03,m6502_04,m6502_05,m6502_06,m6502_07, + m6502_08,m6502_09,m6502_0a,m6502_0b,m6502_0c,m6502_0d,m6502_0e,m6502_0f, + m6502_10,m6502_11,m6502_12,m6502_13,m6502_14,m6502_15,m6502_16,m6502_17, + m6502_18,m6502_19,m6502_1a,m6502_1b,m6502_1c,m6502_1d,m6502_1e,m6502_1f, + m6502_20,m6502_21,m6502_22,m6502_23,m6502_24,m6502_25,m6502_26,m6502_27, + m6502_28,m6502_29,m6502_2a,m6502_2b,m6502_2c,m6502_2d,m6502_2e,m6502_2f, + m6502_30,m6502_31,m6502_32,m6502_33,m6502_34,m6502_35,m6502_36,m6502_37, + m6502_38,m6502_39,m6502_3a,m6502_3b,m6502_3c,m6502_3d,m6502_3e,m6502_3f, + m6502_40,m6502_41,m6502_42,m6502_43,m6502_44,m6502_45,m6502_46,m6502_47, + m6502_48,m6502_49,m6502_4a,m6502_4b,m6502_4c,m6502_4d,m6502_4e,m6502_4f, + m6502_50,m6502_51,m6502_52,m6502_53,m6502_54,m6502_55,m6502_56,m6502_57, + m6502_58,m6502_59,m6502_5a,m6502_5b,m6502_5c,m6502_5d,m6502_5e,m6502_5f, + m6502_60,m6502_61,m6502_62,m6502_63,m6502_64,m6502_65,m6502_66,m6502_67, + m6502_68,m6502_69,m6502_6a,m6502_6b,m6502_6c,m6502_6d,m6502_6e,m6502_6f, + m6502_70,m6502_71,m6502_72,m6502_73,m6502_74,m6502_75,m6502_76,m6502_77, + m6502_78,m6502_79,m6502_7a,m6502_7b,m6502_7c,m6502_7d,m6502_7e,m6502_7f, + m6502_80,m6502_81,m6502_82,m6502_83,m6502_84,m6502_85,m6502_86,m6502_87, + m6502_88,m6502_89,m6502_8a,m6502_8b,m6502_8c,m6502_8d,m6502_8e,m6502_8f, + m6502_90,m6502_91,m6502_92,m6502_93,m6502_94,m6502_95,m6502_96,m6502_97, + m6502_98,m6502_99,m6502_9a,m6502_9b,m6502_9c,m6502_9d,m6502_9e,m6502_9f, + m6502_a0,m6502_a1,m6502_a2,m6502_a3,m6502_a4,m6502_a5,m6502_a6,m6502_a7, + m6502_a8,m6502_a9,m6502_aa,m6502_ab,m6502_ac,m6502_ad,m6502_ae,m6502_af, + m6502_b0,m6502_b1,m6502_b2,m6502_b3,m6502_b4,m6502_b5,m6502_b6,m6502_b7, + m6502_b8,m6502_b9,m6502_ba,m6502_bb,m6502_bc,m6502_bd,m6502_be,m6502_bf, + m6502_c0,m6502_c1,m6502_c2,m6502_c3,m6502_c4,m6502_c5,m6502_c6,m6502_c7, + m6502_c8,m6502_c9,m6502_ca,m6502_cb,m6502_cc,m6502_cd,m6502_ce,m6502_cf, + m6502_d0,m6502_d1,m6502_d2,m6502_d3,m6502_d4,m6502_d5,m6502_d6,m6502_d7, + m6502_d8,m6502_d9,m6502_da,m6502_db,m6502_dc,m6502_dd,m6502_de,m6502_df, + m6502_e0,m6502_e1,m6502_e2,m6502_e3,m6502_e4,m6502_e5,m6502_e6,m6502_e7, + m6502_e8,m6502_e9,m6502_ea,m6502_eb,m6502_ec,m6502_ed,m6502_ee,m6502_ef, + m6502_f0,m6502_f1,m6502_f2,m6502_f3,m6502_f4,m6502_f5,m6502_f6,m6502_f7, + m6502_f8,m6502_f9,m6502_fa,m6502_fb,m6502_fc,m6502_fd,m6502_fe,m6502_ff + }; + insn = insn6502; + } + public void m6502_common_init(irq_delegate irqcallback) + { + irq_callback = irqcallback; + subtype = 0; + rdmem_id = default_rdmem_id; + wrmem_id = default_wdmem_id; + } + public override void Reset() + { + m6502_reset(); + } + public void m6502_reset() + { + pc.LowByte = RDMEM(M6502_RST_VEC); + pc.HighByte = RDMEM((ushort)(M6502_RST_VEC + 1)); + sp.d = 0x01ff; + p = (byte)(F_T | F_I | F_Z | F_B | (p & F_D)); + pending_irq = 0; + after_cli = 0; + irq_state = 0; + nmi_state = 0; + } + public void m6502_take_irq() + { + if ((p & F_I) == 0) + { + ea.d = M6502_IRQ_VEC; + pendingCycles -= 2; + PUSH(pc.HighByte); + PUSH(pc.LowByte); + PUSH((byte)(p & ~F_B)); + p |= F_I; + pc.LowByte = RDMEM((ushort)ea.d); + pc.HighByte = RDMEM((ushort)(ea.d + 1)); + if (irq_callback != null) + { + irq_callback(0); + } + } + pending_irq = 0; + } + public override int ExecuteCycles(int cycles) + { + return m6502_execute(cycles); + } + public int m6502_execute(int cycles) + { + pendingCycles = cycles; + do + { + byte op; + ppc.d = pc.d; + if (pending_irq != 0) + { + m6502_take_irq(); + } + op = ReadOp(pc.LowWord); + pc.LowWord++; + pendingCycles -= 1; + insn[op](); + if (after_cli != 0) + { + after_cli = 0; + if (irq_state != (byte)LineState.CLEAR_LINE) + { + pending_irq = 1; + } + } + else + { + if (pending_irq == 2) + { + if (m6502_IntOccured - pendingCycles > 1) + { + pending_irq = 1; + } + } + if (pending_irq == 1) + { + m6502_take_irq(); + } + if (pending_irq == 2) + { + pending_irq = 1; + } + } + } + while (pendingCycles > 0); + return cycles - pendingCycles; + } + public override void set_irq_line(int irqline, LineState state) + { + m6502_set_irq_line(irqline, state); + } + public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) + { + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + private void m6502_set_irq_line(int irqline, LineState state) + { + if (irqline == (byte)LineState.INPUT_LINE_NMI) + { + if (nmi_state == (byte)state) + { + return; + } + nmi_state = (byte)state; + if (state != LineState.CLEAR_LINE) + { + ea.d = M6502_NMI_VEC; + pendingCycles -= 2; + PUSH(pc.HighByte); + PUSH(pc.LowByte); + PUSH((byte)(p & ~F_B)); + p |= F_I; + pc.LowByte = RDMEM((ushort)ea.d); + pc.HighByte = RDMEM((ushort)(ea.d + 1)); + } + } + else + { + if (irqline == M6502_SET_OVERFLOW) + { + if (so_state != 0 && state == 0) + { + p |= F_V; + } + so_state = (byte)state; + return; + } + irq_state = (byte)state; + if (state != LineState.CLEAR_LINE) + { + pending_irq = 1; + m6502_IntOccured = pendingCycles; + } + } + } + public void SaveStateBinary(BinaryWriter writer) + { + writer.Write(subtype); + writer.Write(ppc.LowWord); + writer.Write(pc.LowWord); + writer.Write(sp.LowWord); + writer.Write(p); + writer.Write(a); + writer.Write(x); + writer.Write(y); + writer.Write(pending_irq); + writer.Write(after_cli); + writer.Write(nmi_state); + writer.Write(irq_state); + writer.Write(so_state); + writer.Write(TotalExecutedCycles); + writer.Write(PendingCycles); + } + public void LoadStateBinary(BinaryReader reader) + { + subtype = reader.ReadByte(); + ppc.LowWord = reader.ReadUInt16(); + pc.LowWord = reader.ReadUInt16(); + sp.LowWord = reader.ReadUInt16(); + p = reader.ReadByte(); + a = reader.ReadByte(); + x = reader.ReadByte(); + y = reader.ReadByte(); + pending_irq = reader.ReadByte(); + after_cli = reader.ReadByte(); + nmi_state = reader.ReadByte(); + irq_state = reader.ReadByte(); + so_state = reader.ReadByte(); + TotalExecutedCycles = reader.ReadUInt64(); + PendingCycles = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502.cs.meta new file mode 100644 index 00000000..37f0a1a0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e27c96a34afca8c4f991cc6209a8895e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502op.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502op.cs new file mode 100644 index 00000000..b7885a84 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502op.cs @@ -0,0 +1,293 @@ +namespace cpu.m6502 +{ + public partial class M6502 + { + protected void m6502_00() { BRK(); } + protected void m6502_20() { JSR(); } + protected void m6502_40() { RTI(); } + protected void m6502_60() { RTS(); } + protected void m6502_80() { int tmp; tmp = RDOPARG(); } + protected void m6502_a0() { int tmp; tmp = RDOPARG(); LDY(tmp); } + protected void m6502_c0() { int tmp; tmp = RDOPARG(); CPY(tmp); } + protected void m6502_e0() { int tmp; tmp = RDOPARG(); CPX(tmp); } + + protected void m6502_10() { BPL(); } + protected void m6502_30() { BMI(); } + protected void m6502_50() { BVC(); } + protected void m6502_70() { BVS(); } + protected void m6502_90() { BCC(); } + protected void m6502_b0() { BCS(); } + protected void m6502_d0() { BNE(); } + protected void m6502_f0() { BEQ(); } + + protected void m6502_01() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; ORA(tmp); } + protected void m6502_21() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; AND(tmp); } + protected void m6502_41() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; EOR(tmp); } + protected void m6502_61() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; ADC(tmp); } + protected void m6502_81() { int tmp = 0; STA(ref tmp); EA_IDX(); wrmem_id((ushort)ea.d, (byte)tmp); pendingCycles -= 1; } + protected void m6502_a1() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; LDA(tmp); } + protected void m6502_c1() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; CMP(tmp); } + protected void m6502_e1() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; SBC(tmp); } + + protected void m6502_11() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; ORA(tmp); } + protected void m6502_31() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; AND(tmp); } + protected void m6502_51() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; EOR(tmp); } + protected void m6502_71() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; ADC(tmp); } + protected void m6502_91() { int tmp = 0; STA(ref tmp); EA_IDY_NP(); wrmem_id((ushort)ea.d, (byte)tmp); pendingCycles -= 1; } + protected void m6502_b1() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; LDA(tmp); } + protected void m6502_d1() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; CMP(tmp); } + protected void m6502_f1() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; SBC(tmp); } + + protected void m6502_02() { KIL(); } + protected void m6502_22() { KIL(); } + protected void m6502_42() { KIL(); } + protected void m6502_62() { KIL(); } + protected void m6502_82() { int tmp; tmp = RDOPARG(); } + protected void m6502_a2() { int tmp; tmp = RDOPARG(); LDX(tmp); } + protected void m6502_c2() { int tmp; tmp = RDOPARG(); } + protected void m6502_e2() { int tmp; tmp = RDOPARG(); } + + protected void m6502_12() { KIL(); } + protected void m6502_32() { KIL(); } + protected void m6502_52() { KIL(); } + protected void m6502_72() { KIL(); } + protected void m6502_92() { KIL(); } + protected void m6502_b2() { KIL(); } + protected void m6502_d2() { KIL(); } + protected void m6502_f2() { KIL(); } + + protected void m6502_03() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); SLO(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_23() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); RLA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_43() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); SRE(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_63() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); RRA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_83() { int tmp = 0; SAX(ref tmp); EA_IDX(); wrmem_id((ushort)ea.d, (byte)tmp); pendingCycles -= 1; } + protected void m6502_a3() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; LAX(tmp); } + protected void m6502_c3() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); DCP(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_e3() { int tmp; EA_IDX(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); ISB(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_13() { int tmp; EA_IDY_NP(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); SLO(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_33() { int tmp; EA_IDY_NP(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); RLA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_53() { int tmp; EA_IDY_NP(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); SRE(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_73() { int tmp; EA_IDY_NP(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); RRA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_93() { int tmp = 0; EA_IDY_NP(); SAH(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_b3() { int tmp; EA_IDY_P(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; LAX(tmp); } + protected void m6502_d3() { int tmp; EA_IDY_NP(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); DCP(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_f3() { int tmp; EA_IDY_NP(); tmp = rdmem_id((ushort)ea.d); pendingCycles -= 1; WRMEM((ushort)ea.d, (byte)tmp); ISB(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_04() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_24() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); BIT(tmp); } + protected void m6502_44() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_64() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_84() { int tmp = 0; STY(ref tmp); EA_ZPG(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_a4() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); LDY(tmp); } + protected void m6502_c4() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); CPY(tmp); } + protected void m6502_e4() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); CPX(tmp); } + + protected void m6502_14() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_34() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_54() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_74() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_94() { int tmp = 0; STY(ref tmp); EA_ZPX(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_b4() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); LDY(tmp); } + protected void m6502_d4() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_f4() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); } + + protected void m6502_05() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); ORA(tmp); } + protected void m6502_25() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); AND(tmp); } + protected void m6502_45() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); EOR(tmp); } + protected void m6502_65() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); ADC(tmp); } + protected void m6502_85() { int tmp = 0; STA(ref tmp); EA_ZPG(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_a5() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); LDA(tmp); } + protected void m6502_c5() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); CMP(tmp); } + protected void m6502_e5() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); SBC(tmp); } + + protected void m6502_15() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); ORA(tmp); } + protected void m6502_35() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); AND(tmp); } + protected void m6502_55() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); EOR(tmp); } + protected void m6502_75() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); ADC(tmp); } + protected void m6502_95() { int tmp = 0; STA(ref tmp); EA_ZPX(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_b5() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); LDA(tmp); } + protected void m6502_d5() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); CMP(tmp); } + protected void m6502_f5() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); SBC(tmp); } + + protected void m6502_06() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ASL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_26() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_46() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); LSR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_66() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_86() { int tmp = 0; STX(ref tmp); EA_ZPG(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_a6() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); LDX(tmp); } + protected void m6502_c6() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DEC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_e6() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); INC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_16() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ASL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_36() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_56() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); LSR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_76() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_96() { int tmp = 0; STX(ref tmp); EA_ZPY(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_b6() { int tmp; EA_ZPY(); tmp = RDMEM((ushort)ea.d); LDX(tmp); } + protected void m6502_d6() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DEC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_f6() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); INC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_07() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SLO(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_27() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RLA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_47() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SRE(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_67() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RRA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_87() { int tmp = 0; SAX(ref tmp); EA_ZPG(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_a7() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); LAX(tmp); } + protected void m6502_c7() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DCP(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_e7() { int tmp; EA_ZPG(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ISB(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_17() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SLO(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_37() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RLA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_57() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SRE(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_77() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RRA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_97() { int tmp = 0; SAX(ref tmp); EA_ZPY(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_b7() { int tmp; EA_ZPY(); tmp = RDMEM((ushort)ea.d); LAX(tmp); } + protected void m6502_d7() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DCP(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_f7() { int tmp; EA_ZPX(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ISB(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_08() { RDMEM(pc.LowWord); PHP(); } + protected void m6502_28() { RDMEM(pc.LowWord); PLP(); } + protected void m6502_48() { RDMEM(pc.LowWord); PHA(); } + protected void m6502_68() { RDMEM(pc.LowWord); PLA(); } + protected void m6502_88() { RDMEM(pc.LowWord); DEY(); } + protected void m6502_a8() { RDMEM(pc.LowWord); TAY(); } + protected void m6502_c8() { RDMEM(pc.LowWord); INY(); } + protected void m6502_e8() { RDMEM(pc.LowWord); INX(); } + + protected void m6502_18() { RDMEM(pc.LowWord); CLC(); } + protected void m6502_38() { RDMEM(pc.LowWord); SEC(); } + protected void m6502_58() { RDMEM(pc.LowWord); CLI(); } + protected void m6502_78() { RDMEM(pc.LowWord); SEI(); } + protected void m6502_98() { RDMEM(pc.LowWord); TYA(); } + protected void m6502_b8() { RDMEM(pc.LowWord); CLV(); } + protected void m6502_d8() { RDMEM(pc.LowWord); CLD(); } + protected void m6502_f8() { RDMEM(pc.LowWord); SED(); } + + protected void m6502_09() { int tmp; tmp = RDOPARG(); ORA(tmp); } + protected void m6502_29() { int tmp; tmp = RDOPARG(); AND(tmp); } + protected void m6502_49() { int tmp; tmp = RDOPARG(); EOR(tmp); } + protected void m6502_69() { int tmp; tmp = RDOPARG(); ADC(tmp); } + protected void m6502_89() { int tmp; tmp = RDOPARG(); } + protected void m6502_a9() { int tmp; tmp = RDOPARG(); LDA(tmp); } + protected void m6502_c9() { int tmp; tmp = RDOPARG(); CMP(tmp); } + protected void m6502_e9() { int tmp; tmp = RDOPARG(); SBC(tmp); } + + protected void m6502_19() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); ORA(tmp); } + protected void m6502_39() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); AND(tmp); } + protected void m6502_59() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); EOR(tmp); } + protected void m6502_79() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); ADC(tmp); } + protected void m6502_99() { int tmp = 0; STA(ref tmp); EA_ABY_NP(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_b9() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); LDA(tmp); } + protected void m6502_d9() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); CMP(tmp); } + protected void m6502_f9() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); SBC(tmp); } + + protected void m6502_0a() { int tmp; RDMEM(pc.LowWord); tmp = a; ASL(ref tmp); a = (byte)tmp; } + protected void m6502_2a() { int tmp; RDMEM(pc.LowWord); tmp = a; ROL(ref tmp); a = (byte)tmp; } + protected void m6502_4a() { int tmp; RDMEM(pc.LowWord); tmp = a; LSR(ref tmp); a = (byte)tmp; } + protected void m6502_6a() { int tmp; RDMEM(pc.LowWord); tmp = a; ROR(ref tmp); a = (byte)tmp; } + protected void m6502_8a() { RDMEM(pc.LowWord); TXA(); } + protected void m6502_aa() { RDMEM(pc.LowWord); TAX(); } + protected void m6502_ca() { RDMEM(pc.LowWord); DEX(); } + protected void m6502_ea() { RDMEM(pc.LowWord); } + + protected void m6502_1a() { RDMEM(pc.LowWord); } + protected void m6502_3a() { RDMEM(pc.LowWord); } + protected void m6502_5a() { RDMEM(pc.LowWord); } + protected void m6502_7a() { RDMEM(pc.LowWord); } + protected void m6502_9a() { RDMEM(pc.LowWord); TXS(); } + protected void m6502_ba() { RDMEM(pc.LowWord); TSX(); } + protected void m6502_da() { RDMEM(pc.LowWord); } + protected void m6502_fa() { RDMEM(pc.LowWord); } + + protected void m6502_0b() { int tmp; tmp = RDOPARG(); ANC(tmp); } + protected void m6502_2b() { int tmp; tmp = RDOPARG(); ANC(tmp); } + protected void m6502_4b() { int tmp; tmp = RDOPARG(); ASR(ref tmp); a = (byte)tmp; } + protected void m6502_6b() { int tmp; tmp = RDOPARG(); ARR(ref tmp); a = (byte)tmp; } + protected void m6502_8b() { int tmp; tmp = RDOPARG(); AXA(tmp); } + protected void m6502_ab() { int tmp; tmp = RDOPARG(); OAL(tmp); } + protected void m6502_cb() { int tmp; tmp = RDOPARG(); ASX(tmp); } + protected void m6502_eb() { int tmp; tmp = RDOPARG(); SBC(tmp); } + + protected void m6502_1b() { int tmp; EA_ABY_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SLO(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_3b() { int tmp; EA_ABY_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RLA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_5b() { int tmp; EA_ABY_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SRE(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_7b() { int tmp; EA_ABY_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RRA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_9b() { int tmp = 0; EA_ABY_NP(); SSH(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_bb() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); AST(tmp); } + protected void m6502_db() { int tmp; EA_ABY_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DCP(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_fb() { int tmp; EA_ABY_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ISB(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_0c() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_2c() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); BIT(tmp); } + protected void m6502_4c() { EA_ABS(); JMP(); } + protected void m6502_6c() { int tmp; EA_IND(); JMP(); } + protected void m6502_8c() { int tmp = 0; STY(ref tmp); EA_ABS(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_ac() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); LDY(tmp); } + protected void m6502_cc() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); CPY(tmp); } + protected void m6502_ec() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); CPX(tmp); } + + protected void m6502_1c() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_3c() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_5c() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_7c() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_9c() { int tmp = 0; EA_ABX_NP(); SYH(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_bc() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); LDY(tmp); } + protected void m6502_dc() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); } + protected void m6502_fc() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); } + + protected void m6502_0d() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); ORA(tmp); } + protected void m6502_2d() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); AND(tmp); } + protected void m6502_4d() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); EOR(tmp); } + protected void m6502_6d() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); ADC(tmp); } + protected void m6502_8d() { int tmp = 0; STA(ref tmp); EA_ABS(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_ad() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); LDA(tmp); } + protected void m6502_cd() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); CMP(tmp); } + protected void m6502_ed() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); SBC(tmp); } + + protected void m6502_1d() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); ORA(tmp); } + protected void m6502_3d() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); AND(tmp); } + protected void m6502_5d() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); EOR(tmp); } + protected void m6502_7d() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); ADC(tmp); } + protected void m6502_9d() { int tmp = 0; STA(ref tmp); EA_ABX_NP(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_bd() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); LDA(tmp); } + protected void m6502_dd() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); CMP(tmp); } + protected void m6502_fd() { int tmp; EA_ABX_P(); tmp = RDMEM((ushort)ea.d); SBC(tmp); } + + protected void m6502_0e() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ASL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_2e() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_4e() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); LSR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_6e() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_8e() { int tmp = 0; STX(ref tmp); EA_ABS(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_ae() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); LDX(tmp); } + protected void m6502_ce() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DEC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_ee() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); INC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_1e() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ASL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_3e() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROL(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_5e() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); LSR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_7e() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ROR(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_9e() { int tmp = 0; EA_ABY_NP(); SXH(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_be() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); LDX(tmp); } + protected void m6502_de() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DEC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_fe() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); INC(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_0f() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SLO(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_2f() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RLA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_4f() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SRE(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_6f() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RRA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_8f() { int tmp = 0; SAX(ref tmp); EA_ABS(); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_af() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); LAX(tmp); } + protected void m6502_cf() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DCP(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_ef() { int tmp; EA_ABS(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ISB(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + + protected void m6502_1f() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SLO(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_3f() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RLA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_5f() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); SRE(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_7f() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); RRA(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_9f() { int tmp = 0; EA_ABY_NP(); SAH(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_bf() { int tmp; EA_ABY_P(); tmp = RDMEM((ushort)ea.d); LAX(tmp); } + protected void m6502_df() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); DCP(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + protected void m6502_ff() { int tmp; EA_ABX_NP(); tmp = RDMEM((ushort)ea.d); WRMEM((ushort)ea.d, (byte)tmp); ISB(ref tmp); WRMEM((ushort)ea.d, (byte)tmp); } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502op.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502op.cs.meta new file mode 100644 index 00000000..ec9f9efd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/M6502op.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb223c61fecbecc4fb762d9ebe649194 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ops02.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ops02.cs new file mode 100644 index 00000000..83b50209 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ops02.cs @@ -0,0 +1,589 @@ +using MAME.Core; + +namespace cpu.m6502 +{ + public partial class M6502 + { + public byte F_C = 0x01, F_Z = 0x02, F_I = 0x04, F_D = 0x08, F_B = 0x10, F_T = 0x20, F_V = 0x40, F_N = 0x80; + private void SET_NZ(byte n) + { + if (n == 0) + { + p = (byte)((p & ~F_N) | F_Z); + } + else + { + p = (byte)((p & ~(F_N | F_Z)) | (n & F_N)); + } + } + private void SET_Z(byte n) + { + if ((n) == 0) + { + p |= F_Z; + } + else + { + p &= (byte)(~F_Z); + } + } + private byte RDOPARG() + { + byte b1; + b1 = ReadOpArg(pc.LowWord++); + pendingCycles -= 1; + return b1; + } + private byte RDMEM(ushort addr) + { + byte b1; + b1 = ReadMemory(addr); + pendingCycles -= 1; + return b1; + } + private void WRMEM(ushort addr, byte data) + { + WriteMemory(addr, data); + pendingCycles -= 1; + } + private void BRA(bool cond) + { + sbyte tmp2 = (sbyte)RDOPARG(); + if (cond) + { + RDMEM(pc.LowWord); + ea.LowWord = (ushort)(pc.LowWord + (sbyte)tmp2); + if (ea.HighByte != pc.HighByte) + { + RDMEM((ushort)((pc.HighByte << 8) | ea.LowByte)); + } + pc.d = ea.d; + } + } + private void EA_ZPG() + { + zp.LowByte = RDOPARG(); + ea.d = zp.d; + } + private void EA_ZPX() + { + zp.LowByte = RDOPARG(); + RDMEM((ushort)zp.d); + zp.LowByte = (byte)(x + zp.LowByte); + ea.d = zp.d; + } + private void EA_ZPY() + { + zp.LowByte = RDOPARG(); + RDMEM((ushort)zp.d); + zp.LowByte = (byte)(y + zp.LowByte); + ea.d = zp.d; + } + private void EA_ABS() + { + ea.LowByte = RDOPARG(); + ea.HighByte = RDOPARG(); + } + private void EA_ABX_P() + { + EA_ABS(); + if (ea.LowByte + x > 0xff) + { + RDMEM((ushort)((ea.HighByte << 8) | ((ea.LowByte + x) & 0xff))); + } + ea.LowWord += x; + } + private void EA_ABX_NP() + { + EA_ABS(); + RDMEM((ushort)((ea.HighByte << 8) | ((ea.LowByte + x) & 0xff))); + ea.LowWord += x; + } + private void EA_ABY_P() + { + EA_ABS(); + if (ea.LowByte + y > 0xff) + { + RDMEM((ushort)((ea.HighByte << 8) | ((ea.LowByte + y) & 0xff))); + } + ea.LowWord += y; + } + private void EA_ABY_NP() + { + EA_ABS(); + RDMEM((ushort)((ea.HighByte << 8) | ((ea.LowByte + y) & 0xff))); + ea.LowWord += y; + } + private void EA_IDX() + { + zp.LowByte = RDOPARG(); + RDMEM((ushort)zp.d); + zp.LowByte = (byte)(zp.LowByte + x); + ea.LowByte = RDMEM((ushort)zp.d); + zp.LowByte++; + ea.HighByte = RDMEM((ushort)zp.d); + } + private void EA_IDY_P() + { + zp.LowByte = RDOPARG(); + ea.LowByte = RDMEM((ushort)zp.d); + zp.LowByte++; + ea.HighByte = RDMEM((ushort)zp.d); + if (ea.LowByte + y > 0xff) + { + RDMEM((ushort)((ea.HighByte << 8) | ((ea.LowByte + y) & 0xff))); + } + ea.LowWord += y; + } + private void EA_IDY_NP() + { + zp.LowByte = RDOPARG(); + ea.LowByte = RDMEM((ushort)zp.d); + zp.LowByte++; + ea.HighByte = RDMEM((ushort)zp.d); + RDMEM((ushort)((ea.HighByte << 8) | ((ea.LowByte + y) & 0xff))); + ea.LowWord += y; + } + private void EA_ZPI() + { + zp.LowByte = RDOPARG(); + ea.LowByte = RDMEM((ushort)zp.d); + zp.LowByte++; + ea.HighByte = RDMEM((ushort)zp.d); + } + private void EA_IND() + { + byte tmp; + EA_ABS(); + tmp = RDMEM((ushort)ea.d); + ea.LowByte++; + ea.HighByte = RDMEM((ushort)ea.d); + ea.LowByte = tmp; + } + private void PUSH(byte Rg) + { + WRMEM((ushort)sp.d, Rg); + sp.LowByte--; + } + private void PULL(ref byte Rg) + { + sp.LowByte++; + Rg = RDMEM((ushort)sp.d); + } + private void ADC(int tmp) + { + if ((p & F_D) != 0) + { + int c = (p & F_C); + int lo = (a & 0x0f) + (tmp & 0x0f) + c; + int hi = (a & 0xf0) + (tmp & 0xf0); + p &= (byte)(~(F_V | F_C | F_N | F_Z)); + if (((lo + hi) & 0xff) == 0) + { + p |= F_Z; + } + if (lo > 0x09) + { + hi += 0x10; + lo += 0x06; + } + if ((hi & 0x80) != 0) + { + p |= F_N; + } + if ((~(a ^ tmp) & (a ^ hi) & F_N) != 0) + { + p |= F_V; + } + if (hi > 0x90) + { + hi += 0x60; + } + if ((hi & 0xff00) != 0) + { + p |= F_C; + } + a = (byte)((lo & 0x0f) + (hi & 0xf0)); + } + else + { + int c = (p & F_C); + int sum = a + tmp + c; + p &= (byte)(~(F_V | F_C)); + if ((~(a ^ tmp) & (a ^ sum) & F_N) != 0) + { + p |= F_V; + } + if ((sum & 0xff00) != 0) + { + p |= F_C; + } + a = (byte)sum; + SET_NZ(a); + } + } + private void AND(int tmp) + { + a = (byte)(a & tmp); + SET_NZ(a); + } + private void ASL(ref int tmp) + { + p = (byte)((p & ~F_C) | ((tmp >> 7) & F_C)); + tmp = (byte)(tmp << 1); + SET_NZ((byte)tmp); + } + private void BCC() + { + BRA((p & F_C) == 0); + } + private void BCS() + { + BRA((p & F_C) != 0); + } + private void BEQ() + { + BRA((p & F_Z) != 0); + } + private void BIT(int tmp) + { + p &= (byte)(~(F_N | F_V | F_Z)); + p |= (byte)(tmp & (F_N | F_V)); + if ((tmp & a) == 0) + { + p |= F_Z; + } + } + private void BMI() + { + BRA((p & F_N) != 0); + } + private void BNE() + { + BRA((p & F_Z) == 0); + } + private void BPL() + { + BRA((p & F_N) == 0); + } + private void BRK() + { + RDOPARG(); + PUSH(pc.HighByte); + PUSH(pc.LowByte); + PUSH((byte)(p | F_B)); + p = ((byte)(p | F_I)); + pc.LowByte = RDMEM(M6502_IRQ_VEC); + pc.HighByte = RDMEM((ushort)(M6502_IRQ_VEC + 1)); + } + private void BVC() + { + BRA((p & F_V) == 0); + } + private void BVS() + { + BRA((p & F_V) != 0); + } + private void CLC() + { + p &= (byte)~F_C; + } + private void CLD() + { + p &= (byte)~F_D; + } + private void CLI() + { + if ((irq_state != (byte)LineState.CLEAR_LINE) && ((p & F_I) != 0)) + { + after_cli = 1; + } + p &= (byte)~F_I; + } + private void CLV() + { + p &= (byte)~F_V; + } + private void CMP(int tmp) + { + p &= (byte)~F_C; + if (a >= tmp) + { + p |= F_C; + } + SET_NZ((byte)(a - tmp)); + } + private void CPX(int tmp) + { + p &= (byte)~F_C; + if (x >= tmp) + { + p |= F_C; + } + SET_NZ((byte)(x - tmp)); + } + private void CPY(int tmp) + { + p &= (byte)~F_C; + if (y >= tmp) + { + p |= F_C; + } + SET_NZ((byte)(y - tmp)); + } + private void DEC(ref int tmp) + { + tmp = (byte)(tmp - 1); + SET_NZ((byte)tmp); + } + private void DEX() + { + x = (byte)(x - 1); + SET_NZ(x); + } + private void DEY() + { + y = (byte)(y - 1); + SET_NZ(y); + } + private void EOR(int tmp) + { + a = (byte)(a ^ tmp); + SET_NZ(a); + } + private void INC(ref int tmp) + { + tmp = (byte)(tmp + 1); + SET_NZ((byte)tmp); + } + private void INX() + { + x = (byte)(x + 1); + SET_NZ(x); + } + private void INY() + { + y = (byte)(y + 1); + SET_NZ(y); + } + private void JMP() + { + if (ea.d == ppc.d && pending_irq == 0 && after_cli == 0) + { + if (pendingCycles > 0) + { + pendingCycles = 0; + } + } + pc.d = ea.d; + } + private void JSR() + { + ea.LowByte = RDOPARG(); + RDMEM((ushort)sp.d); + PUSH(pc.HighByte); + PUSH(pc.LowByte); + ea.HighByte = RDOPARG(); + pc.d = ea.d; + } + private void LDA(int tmp) + { + a = (byte)tmp; + SET_NZ(a); + } + private void LDX(int tmp) + { + x = (byte)tmp; + SET_NZ(x); + } + private void LDY(int tmp) + { + y = (byte)tmp; + SET_NZ(y); + } + private void LSR(ref int tmp) + { + p = (byte)((p & ~F_C) | (tmp & F_C)); + tmp = (byte)tmp >> 1; + SET_NZ((byte)tmp); + } + private void ORA(int tmp) + { + a = (byte)(a | tmp); + SET_NZ(a); + } + private void PHA() + { + PUSH(a); + } + private void PHP() + { + PUSH(p); + } + private void PLA() + { + RDMEM((ushort)sp.d); + PULL(ref a); + SET_NZ(a); + } + private void PLP() + { + RDMEM((ushort)sp.d); + if ((p & F_I) != 0) + { + PULL(ref p); + if ((irq_state != (byte)LineState.CLEAR_LINE) && ((p & F_I) == 0)) + { + after_cli = 1; + } + } + else + { + PULL(ref p); + } + p |= (byte)(F_T | F_B); + } + private void ROL(ref int tmp) + { + tmp = (tmp << 1) | (p & F_C); + p = (byte)((p & ~F_C) | ((tmp >> 8) & F_C)); + tmp = (byte)tmp; + SET_NZ((byte)tmp); + } + private void ROR(ref int tmp) + { + tmp |= (p & F_C) << 8; + p = (byte)((p & ~F_C) | (tmp & F_C)); + tmp = (byte)(tmp >> 1); + SET_NZ((byte)tmp); + } + private void RTI() + { + RDOPARG(); + RDMEM((ushort)sp.d); + PULL(ref p); + PULL(ref pc.LowByte); + PULL(ref pc.HighByte); + p |= (byte)(F_T | F_B); + if ((irq_state != (byte)LineState.CLEAR_LINE) && ((p & F_I) == 0)) + { + after_cli = 1; + } + } + private void RTS() + { + RDOPARG(); + RDMEM((ushort)sp.d); + PULL(ref pc.LowByte); + PULL(ref pc.HighByte); + RDMEM(pc.LowWord); + pc.LowWord++; + } + private void SBC(int tmp) + { + if ((p & F_D) != 0) + { + int c = (p & F_C) ^ F_C; + int sum = a - tmp - c; + int lo = (a & 0x0f) - (tmp & 0x0f) - c; + int hi = (a & 0xf0) - (tmp & 0xf0); + if ((lo & 0x10) != 0) + { + lo -= 6; + hi--; + } + p &= (byte)~(F_V | F_C | F_Z | F_N); + if (((a ^ tmp) & (a ^ sum) & F_N) != 0) + { + p |= F_V; + } + if ((hi & 0x0100) != 0) + { + hi -= 0x60; + } + if ((sum & 0xff00) == 0) + { + p |= F_C; + } + if (((a - tmp - c) & 0xff) == 0) + { + p |= F_Z; + } + if (((a - tmp - c) & 0x80) != 0) + { + p |= F_N; + } + a = (byte)((lo & 0x0f) | (hi & 0xf0)); + } + else + { + int c = (p & F_C) ^ F_C; + int sum = a - tmp - c; + p &= (byte)~(F_V | F_C); + if (((a ^ tmp) & (a ^ sum) & F_N) != 0) + { + p |= F_V; + } + if ((sum & 0xff00) == 0) + { + p |= F_C; + } + a = (byte)sum; + SET_NZ(a); + } + } + private void SEC() + { + p |= F_C; + } + private void SED() + { + p |= F_D; + } + private void SEI() + { + p |= F_I; + } + private void STA(ref int tmp) + { + tmp = a; + } + private void STX(ref int tmp) + { + tmp = x; + } + private void STY(ref int tmp) + { + tmp = y; + } + private void TAX() + { + x = a; + SET_NZ(x); + } + private void TAY() + { + y = a; + SET_NZ(y); + } + private void TSX() + { + x = sp.LowByte; + SET_NZ(x); + } + private void TXA() + { + a = x; + SET_NZ(a); + } + private void TXS() + { + sp.LowByte = x; + } + private void TYA() + { + a = y; + SET_NZ(a); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ops02.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ops02.cs.meta new file mode 100644 index 00000000..488ddaad --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6502/Ops02.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df989ce237c20a84aa97ead349d2093e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800.meta new file mode 100644 index 00000000..b03e2d96 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 317be4f8630ce90409e488310814c936 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800.cs new file mode 100644 index 00000000..ed7c5c65 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800.cs @@ -0,0 +1,1386 @@ +using MAME.Core; +using System; +using System.IO; + +namespace cpu.m6800 +{ + public partial class M6800 : cpuexec_data + { + public static M6800 m1; + public static Action action_rx, action_tx; + public Action[] insn, m6800_insn, hd63701_insn, m6803_insn; + public Register PPC, PC; + public Register S, X, D, EA; + public byte[] cycles; + public byte cc, wai_state, ic_eddge; + public byte[] irq_state = new byte[2]; + public byte nmi_state; + public int extra_cycles; + public delegate int irq_delegate(int i); + public irq_delegate irq_callback; + public byte port1_ddr, port2_ddr, port3_ddr, port4_ddr, port1_data, port2_data, port3_data, port4_data; + public byte tcsr, pending_tcsr, irq2, ram_ctrl; + public Register counter, output_compare, timer_over; + public ushort input_capture; + public int clock; + public byte trcsr, rmcr, rdr, tdr, rsr, tsr; + public int rxbits, txbits, trcsr_read, tx; + public M6800_TX_STATE txstate; + public EmuTimer.emu_timer m6800_rx_timer, m6800_tx_timer; + private byte TCSR_OLVL = 0x01, TCSR_IEDG = 0x02, TCSR_ETOI = 0x04, TCSR_EOCI = 0x08, TCSR_EICI = 0x10, TCSR_TOF = 0x20, TCSR_OCF = 0x40, TCSR_ICF = 0x80; + protected byte M6800_WAI = 8, M6800_SLP = 0x10; + private const byte M6800_IRQ_LINE = 0, M6800_TIN_LINE = 1; + private ushort M6803_DDR1 = 0x00, M6803_DDR2 = 0x01, M6803_DDR3 = 0x04, M6803_DDR4 = 0x05, M6803_PORT1 = 0x100, M6803_PORT2 = 0x101, M6803_PORT3 = 0x102, M6803_PORT4 = 0x103; + private byte M6800_RMCR_SS_MASK = 0x03, M6800_RMCR_SS_4096 = 0x03, M6800_RMCR_SS_1024 = 0x02, M6800_RMCR_SS_128 = 0x01, M6800_RMCR_SS_16 = 0x00, M6800_RMCR_CC_MASK = 0x0c; + private byte M6800_TRCSR_RDRF = 0x80, M6800_TRCSR_ORFE = 0x40, M6800_TRCSR_TDRE = 0x20, M6800_TRCSR_RIE = 0x10, M6800_TRCSR_RE = 0x08, M6800_TRCSR_TIE = 0x04, M6800_TRCSR_TE = 0x02, M6800_TRCSR_WU = 0x01, M6800_PORT2_IO4 = 0x10, M6800_PORT2_IO3 = 0x08; + private int[] M6800_RMCR_SS = new int[] { 16, 128, 1024, 4096 }; + public enum M6800_TX_STATE + { + INIT = 0, + READY + } + private byte CLEAR_LINE = 0, INPUT_LINE_NMI = 32; + protected ulong totalExecutedCycles; + protected int pendingCycles; + public override ulong TotalExecutedCycles + { + get + { + return totalExecutedCycles; + } + set + { + totalExecutedCycles = value; + } + } + public override int PendingCycles + { + get + { + return pendingCycles; + } + set + { + pendingCycles = value; + } + } + public uint timer_next; + public byte[] flags8i = new byte[256] /* increment */ +{ +0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x0a,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 +}; + private byte[] flags8d = new byte[256] /* decrement */ +{ +0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 +}; + private byte[] cycles_6800 = new byte[] +{ + /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + /*0*/ 99, 2,99,99,99,99, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, + /*1*/ 2, 2,99,99,99,99, 2, 2,99, 2,99, 2,99,99,99,99, + /*2*/ 4,99, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + /*3*/ 4, 4, 4, 4, 4, 4, 4, 4,99, 5,99,10,99,99, 9,12, + /*4*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, + /*5*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, + /*6*/ 7,99,99, 7, 7,99, 7, 7, 7, 7, 7,99, 7, 7, 4, 7, + /*7*/ 6,99,99, 6, 6,99, 6, 6, 6, 6, 6,99, 6, 6, 3, 6, + /*8*/ 2, 2, 2,99, 2, 2, 2,99, 2, 2, 2, 2, 3, 8, 3,99, + /*9*/ 3, 3, 3,99, 3, 3, 3, 4, 3, 3, 3, 3, 4,99, 4, 5, + /*A*/ 5, 5, 5,99, 5, 5, 5, 6, 5, 5, 5, 5, 6, 8, 6, 7, + /*B*/ 4, 4, 4,99, 4, 4, 4, 5, 4, 4, 4, 4, 5, 9, 5, 6, + /*C*/ 2, 2, 2,99, 2, 2, 2,99, 2, 2, 2, 2,99,99, 3,99, + /*D*/ 3, 3, 3,99, 3, 3, 3, 4, 3, 3, 3, 3,99,99, 4, 5, + /*E*/ 5, 5, 5,99, 5, 5, 5, 6, 5, 5, 5, 5,99,99, 6, 7, + /*F*/ 4, 4, 4,99, 4, 4, 4, 5, 4, 4, 4, 4,99,99, 5, 6 +}; + protected byte[] cycles_6803 = +{ + /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + /*0*/ 99, 2,99,99, 3, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, + /*1*/ 2, 2,99,99,99,99, 2, 2,99, 2,99, 2,99,99,99,99, + /*2*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /*3*/ 3, 3, 4, 4, 3, 3, 3, 3, 5, 5, 3,10, 4,10, 9,12, + /*4*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, + /*5*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, + /*6*/ 6,99,99, 6, 6,99, 6, 6, 6, 6, 6,99, 6, 6, 3, 6, + /*7*/ 6,99,99, 6, 6,99, 6, 6, 6, 6, 6,99, 6, 6, 3, 6, + /*8*/ 2, 2, 2, 4, 2, 2, 2,99, 2, 2, 2, 2, 4, 6, 3,99, + /*9*/ 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 4, 4, + /*A*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 5, 5, + /*B*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 5, 5, + /*C*/ 2, 2, 2, 4, 2, 2, 2,99, 2, 2, 2, 2, 3,99, 3,99, + /*D*/ 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + /*E*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, + /*F*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 +}; + private byte[] cycles_63701 = +{ + /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + /*0*/ 99, 1,99,99, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /*1*/ 1, 1,99,99,99,99, 1, 1, 2, 2, 4, 1,99,99,99,99, + /*2*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /*3*/ 1, 1, 3, 3, 1, 1, 4, 4, 4, 5, 1,10, 5, 7, 9,12, + /*4*/ 1,99,99, 1, 1,99, 1, 1, 1, 1, 1,99, 1, 1,99, 1, + /*5*/ 1,99,99, 1, 1,99, 1, 1, 1, 1, 1,99, 1, 1,99, 1, + /*6*/ 6, 7, 7, 6, 6, 7, 6, 6, 6, 6, 6, 5, 6, 4, 3, 5, + /*7*/ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 4, 3, 5, + /*8*/ 2, 2, 2, 3, 2, 2, 2,99, 2, 2, 2, 2, 3, 5, 3,99, + /*9*/ 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 4, 4, + /*A*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, + /*B*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 5, 5, + /*C*/ 2, 2, 2, 3, 2, 2, 2,99, 2, 2, 2, 2, 3,99, 3,99, + /*D*/ 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + /*E*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, + /*F*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 +}; + + public Func ReadOp, ReadOpArg; + public Func ReadMemory; + public Action WriteMemory; + public Func ReadIO; + public Action WriteIO; + + public M6800() + { + m6800_insn = new Action[256] + { + illegal,nop, illegal,illegal,illegal,illegal,tap, tpa, + inx, dex, clv, sev, clc, sec, cli, sei, + sba, cba, illegal,illegal,illegal,illegal,tab, tba, + illegal,daa, illegal,aba, illegal,illegal,illegal,illegal, + bra, brn, bhi, bls, bcc, bcs, bne, beq, + bvc, bvs, bpl, bmi, bge, blt, bgt, ble, + tsx, ins, pula, pulb, des, txs, psha, pshb, + illegal,rts, illegal,rti, illegal,illegal,wai, swi, + nega, illegal,illegal,coma, lsra, illegal,rora, asra, + asla, rola, deca, illegal,inca, tsta, illegal,clra, + negb, illegal,illegal,comb, lsrb, illegal,rorb, asrb, + aslb, rolb, decb, illegal,incb, tstb, illegal,clrb, + neg_ix, illegal,illegal,com_ix, lsr_ix, illegal,ror_ix, asr_ix, + asl_ix, rol_ix, dec_ix, illegal,inc_ix, tst_ix, jmp_ix, clr_ix, + neg_ex, illegal,illegal,com_ex, lsr_ex, illegal,ror_ex, asr_ex, + asl_ex, rol_ex, dec_ex, illegal,inc_ex, tst_ex, jmp_ex, clr_ex, + suba_im,cmpa_im,sbca_im,illegal,anda_im,bita_im,lda_im, sta_im, + eora_im,adca_im,ora_im, adda_im,cmpx_im,bsr, lds_im, sts_im, + suba_di,cmpa_di,sbca_di,illegal,anda_di,bita_di,lda_di, sta_di, + eora_di,adca_di,ora_di, adda_di,cmpx_di,jsr_di, lds_di, sts_di, + suba_ix,cmpa_ix,sbca_ix,illegal,anda_ix,bita_ix,lda_ix, sta_ix, + eora_ix,adca_ix,ora_ix, adda_ix,cmpx_ix,jsr_ix, lds_ix, sts_ix, + suba_ex,cmpa_ex,sbca_ex,illegal,anda_ex,bita_ex,lda_ex, sta_ex, + eora_ex,adca_ex,ora_ex, adda_ex,cmpx_ex,jsr_ex, lds_ex, sts_ex, + subb_im,cmpb_im,sbcb_im,illegal,andb_im,bitb_im,ldb_im, stb_im, + eorb_im,adcb_im,orb_im, addb_im,illegal,illegal,ldx_im, stx_im, + subb_di,cmpb_di,sbcb_di,illegal,andb_di,bitb_di,ldb_di, stb_di, + eorb_di,adcb_di,orb_di, addb_di,illegal,illegal,ldx_di, stx_di, + subb_ix,cmpb_ix,sbcb_ix,illegal,andb_ix,bitb_ix,ldb_ix, stb_ix, + eorb_ix,adcb_ix,orb_ix, addb_ix,illegal,illegal,ldx_ix, stx_ix, + subb_ex,cmpb_ex,sbcb_ex,illegal,andb_ex,bitb_ex,ldb_ex, stb_ex, + eorb_ex,adcb_ex,orb_ex, addb_ex,illegal,illegal,ldx_ex, stx_ex + }; + hd63701_insn = new Action[] + { + trap, nop, trap ,trap ,lsrd, asld, tap, tpa, + inx, dex, clv, sev, clc, sec, cli, sei, + sba, cba, undoc1, undoc2, trap ,trap ,tab, tba, + xgdx, daa, slp ,aba, trap ,trap ,trap ,trap , + bra, brn, bhi, bls, bcc, bcs, bne, beq, + bvc, bvs, bpl, bmi, bge, blt, bgt, ble, + tsx, ins, pula, pulb, des, txs, psha, pshb, + pulx, rts, abx, rti, pshx, mul, wai, swi, + nega, trap ,trap ,coma, lsra, trap ,rora, asra, + asla, rola, deca, trap ,inca, tsta, trap ,clra, + negb, trap ,trap ,comb, lsrb, trap ,rorb, asrb, + aslb, rolb, decb, trap ,incb, tstb, trap ,clrb, + neg_ix, aim_ix, oim_ix, com_ix, lsr_ix, eim_ix, ror_ix, asr_ix, + asl_ix, rol_ix, dec_ix, tim_ix, inc_ix, tst_ix, jmp_ix, clr_ix, + neg_ex, aim_di, oim_di, com_ex, lsr_ex, eim_di, ror_ex, asr_ex, + asl_ex, rol_ex, dec_ex, tim_di, inc_ex, tst_ex, jmp_ex, clr_ex, + suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im, sta_im, + eora_im,adca_im,ora_im, adda_im,cpx_im ,bsr, lds_im, sts_im, + suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di, sta_di, + eora_di,adca_di,ora_di, adda_di,cpx_di ,jsr_di, lds_di, sts_di, + suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix, sta_ix, + eora_ix,adca_ix,ora_ix, adda_ix,cpx_ix ,jsr_ix, lds_ix, sts_ix, + suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex, sta_ex, + eora_ex,adca_ex,ora_ex, adda_ex,cpx_ex ,jsr_ex, lds_ex, sts_ex, + subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im, stb_im, + eorb_im,adcb_im,orb_im, addb_im,ldd_im, std_im, ldx_im, stx_im, + subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di, stb_di, + eorb_di,adcb_di,orb_di, addb_di,ldd_di, std_di, ldx_di, stx_di, + subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix, stb_ix, + eorb_ix,adcb_ix,orb_ix, addb_ix,ldd_ix, std_ix, ldx_ix, stx_ix, + subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex, stb_ex, + eorb_ex,adcb_ex,orb_ex, addb_ex,ldd_ex, std_ex, ldx_ex, stx_ex + }; + insn = hd63701_insn; + cycles = cycles_63701; + clock = 1536000; + irq_callback = null; + m6800_rx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_rx, false); + m6800_tx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_tx, false); + } + public override void Reset() + { + m6800_reset(); + } + private byte IMMBYTE() + { + byte b = ReadOpArg(PC.LowWord); + PC.LowWord++; + return b; + } + private Register IMMWORD() + { + Register w = new Register(); + w.d = (uint)((ReadOpArg(PC.LowWord) << 8) | ReadOpArg((ushort)((PC.LowWord + 1) & 0xffff))); + PC.LowWord += 2; + return w; + } + private void PUSHBYTE(byte b) + { + WriteMemory(S.LowWord, b); + --S.LowWord; + } + private void PUSHWORD(Register w) + { + WriteMemory(S.LowWord, w.LowByte); + --S.LowWord; + WriteMemory(S.LowWord, w.HighByte); + --S.LowWord; + } + private byte PULLBYTE() + { + S.LowWord++; + return ReadMemory(S.LowWord); + } + private Register PULLWORD() + { + Register w = new Register(); + S.LowWord++; + w.d = (uint)(ReadMemory(S.LowWord) << 8); + S.LowWord++; + w.d |= ReadMemory(S.LowWord); + return w; + } + private void MODIFIED_tcsr() + { + irq2 = (byte)((tcsr & (tcsr << 3)) & (TCSR_ICF | TCSR_OCF | TCSR_TOF)); + } + private void SET_TIMER_EVENT() + { + timer_next = (output_compare.d - counter.d < timer_over.d - counter.d) ? output_compare.d : timer_over.d; + } + protected void CLEANUP_conters() + { + output_compare.HighWord -= counter.HighWord; + timer_over.LowWord -= counter.HighWord; + counter.HighWord = 0; + SET_TIMER_EVENT(); + } + private void MODIFIED_counters() + { + output_compare.HighWord = (output_compare.LowWord >= counter.LowWord) ? counter.HighWord : (ushort)(counter.HighWord + 1); + SET_TIMER_EVENT(); + } + private void TAKE_ICI() + { + ENTER_INTERRUPT(0xfff6); + } + private void TAKE_OCI() + { + ENTER_INTERRUPT(0xfff4); + } + private void TAKE_TOI() + { + ENTER_INTERRUPT(0xfff2); + } + private void TAKE_SCI() + { + ENTER_INTERRUPT(0xfff0); + } + private void TAKE_TRAP() + { + ENTER_INTERRUPT(0xffee); + } + private void ONE_MORE_INSN() + { + byte ireg; + PPC = PC; + //debugger_instruction_hook(Machine, PCD); + ireg = ReadOp(PC.LowWord); + PC.LowWord++; + insn[ireg](); + INCREMENT_COUNTER(cycles[ireg]); + } + private void CHECK_IRQ_LINES() + { + if ((cc & 0x10) == 0) + { + if (irq_state[0] != (byte)LineState.CLEAR_LINE) + { + ENTER_INTERRUPT(0xfff8); + if (irq_callback != null) + { + irq_callback(0); + } + } + else + { + m6800_check_irq2(); + } + } + } + private void CLR_HNZVC() + { + cc &= 0xd0; + } + private void CLR_NZV() + { + cc &= 0xf1; + } + private void CLR_HNZC() + { + cc &= 0xd2; + } + private void CLR_NZVC() + { + cc &= 0xf0; + } + private void CLR_Z() + { + cc &= 0xfb; + } + private void CLR_NZC() + { + cc &= 0xf2; + } + private void CLR_ZC() + { + cc &= 0xfa; + } + private void CLR_C() + { + cc &= 0xfe; + } + private void SET_Z(byte a) + { + if (a == 0) + { + SEZ(); + } + } + private void SET_Z(ushort a) + { + if (a == 0) + { + SEZ(); + } + } + private void SET_Z8(byte a) + { + SET_Z(a); + } + private void SET_Z16(ushort a) + { + SET_Z(a); + } + private void SET_N8(byte a) + { + cc |= (byte)(((a) & 0x80) >> 4); + } + private void SET_N16(ushort a) + { + cc |= (byte)(((a) & 0x8000) >> 12); + } + private void SET_H(ushort a, ushort b, ushort r) + { + cc |= (byte)((((a) ^ (b) ^ (r)) & 0x10) << 1); + } + private void SET_C8(ushort a) + { + cc |= (byte)(((a) & 0x100) >> 8); + } + private void SET_C16(uint a) + { + cc |= (byte)(((a) & 0x10000) >> 16); + } + private void SET_V8(ushort a, ushort b, ushort r) + { + cc |= (byte)((((a) ^ (b) ^ (r) ^ ((r) >> 1)) & 0x80) >> 6); + } + private void SET_V16(uint a, uint b, uint r) + { + cc |= (byte)((((a) ^ (b) ^ (r) ^ ((r) >> 1)) & 0x8000) >> 14); + } + private void SET_FLAGS8I(byte a) + { + cc |= flags8i[(a) & 0xff]; + } + private void SET_FLAGS8D(byte a) + { + cc |= flags8d[(a) & 0xff]; + } + private void SET_NZ8(byte a) + { + SET_N8(a); + SET_Z8(a); + } + private void SET_NZ16(ushort a) + { + SET_N16(a); + SET_Z16(a); + } + private void SET_FLAGS8(ushort a, ushort b, ushort r) + { + SET_N8((byte)r); + SET_Z8((byte)r); + SET_V8(a, b, r); + SET_C8(r); + } + private void SET_FLAGS16(uint a, uint b, uint r) + { + SET_N16((ushort)r); + SET_Z16((ushort)r); + SET_V16(a, b, r); + SET_C16(r); + } + private short SIGNED(byte b) + { + return (short)((b & 0x80) != 0 ? b | 0xff00 : b); + } + private void DIRECT() + { + EA.d = IMMBYTE(); + } + private void IMM8() + { + EA.LowWord = PC.LowWord++; + } + private void IMM16() + { + EA.LowWord = PC.LowWord; + PC.LowWord += 2; + } + private void EXTENDED() + { + EA = IMMWORD(); + } + private void INDEXED() + { + EA.LowWord = (ushort)(X.LowWord + ReadOpArg(PC.LowWord)); + PC.LowWord++; + } + protected void SEC() + { + cc |= 0x01; + } + protected void CLC() + { + cc &= 0xfe; + } + protected void SEZ() + { + cc |= 0x04; + } + protected void CLZ() + { + cc &= 0xfb; + } + protected void SEN() + { + cc |= 0x08; + } + protected void CLN() + { + cc &= 0xf7; + } + protected void SEV() + { + cc |= 0x02; + } + protected void CLV() + { + cc &= 0xfd; + } + protected void SEH() + { + cc |= 0x20; + } + protected void CLH() + { + cc &= 0xdf; + } + protected void SEI() + { + cc |= 0x10; + } + protected void CLI() + { + cc &= unchecked((byte)(~0x10)); + } + protected void INCREMENT_COUNTER(int amount) + { + pendingCycles -= amount; + counter.d += (uint)amount; + if (counter.d >= timer_next) + check_timer_event(); + } + protected void EAT_CYCLES() + { + int cycles_to_eat; + cycles_to_eat = (int)(timer_next - counter.d); + if (cycles_to_eat > pendingCycles) + cycles_to_eat = pendingCycles; + if (cycles_to_eat > 0) + { + INCREMENT_COUNTER(cycles_to_eat); + } + } + private byte DIRBYTE() + { + DIRECT(); + return ReadMemory(EA.LowWord); + } + private Register DIRWORD() + { + Register w = new Register(); + DIRECT(); + w.LowWord = RM16(EA.LowWord); + return w; + } + private byte EXTBYTE() + { + EXTENDED(); + return ReadMemory(EA.LowWord); + } + private Register EXTWORD() + { + Register w = new Register(); + EXTENDED(); + w.LowWord = RM16(EA.LowWord); + return w; + } + private byte IDXBYTE() + { + INDEXED(); + return ReadMemory(EA.LowWord); + } + private Register IDXWORD() + { + Register w = new Register(); + INDEXED(); + w.LowWord = RM16(EA.LowWord); + return w; + } + private void BRANCH(bool f) + { + byte t = IMMBYTE(); + if (f) + { + PC.LowWord += (ushort)SIGNED(t); + } + } + private byte NXORV() + { + return (byte)((cc & 0x08) ^ ((cc & 0x02) << 2)); + } + private ushort RM16(ushort Addr) + { + ushort result = (ushort)(ReadMemory(Addr) << 8); + return (ushort)(result | ReadMemory((ushort)(Addr + 1))); + } + private void WM16(ushort Addr, Register p) + { + WriteMemory(Addr, p.HighByte); + WriteMemory((ushort)(Addr + 1), p.LowByte); + } + private void ENTER_INTERRUPT(ushort irq_vector) + { + if ((wai_state & (M6800_WAI | M6800_SLP)) != 0) + { + if ((wai_state & M6800_WAI) != 0) + extra_cycles += 4; + wai_state &= (byte)(~(M6800_WAI | M6800_SLP)); + } + else + { + PUSHWORD(PC); + PUSHWORD(X); + PUSHBYTE(D.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(cc); + extra_cycles += 12; + } + SEI(); + PC.d = RM16(irq_vector); + } + private void m6800_check_irq2() + { + if ((tcsr & (TCSR_EICI | TCSR_ICF)) == (TCSR_EICI | TCSR_ICF)) + { + TAKE_ICI(); + //if( m6800.irq_callback ) + // (void)(*m6800.irq_callback)(M6800_TIN_LINE); + } + else if ((tcsr & (TCSR_EOCI | TCSR_OCF)) == (TCSR_EOCI | TCSR_OCF)) + { + TAKE_OCI(); + } + else if ((tcsr & (TCSR_ETOI | TCSR_TOF)) == (TCSR_ETOI | TCSR_TOF)) + { + TAKE_TOI(); + } + else if (((trcsr & (M6800_TRCSR_RIE | M6800_TRCSR_RDRF)) == (M6800_TRCSR_RIE | M6800_TRCSR_RDRF)) || + ((trcsr & (M6800_TRCSR_RIE | M6800_TRCSR_ORFE)) == (M6800_TRCSR_RIE | M6800_TRCSR_ORFE)) || + ((trcsr & (M6800_TRCSR_TIE | M6800_TRCSR_TDRE)) == (M6800_TRCSR_TIE | M6800_TRCSR_TDRE))) + { + TAKE_SCI(); + } + } + private void check_timer_event() + { + if (counter.d >= output_compare.d) + { + output_compare.HighWord++; + tcsr |= TCSR_OCF; + pending_tcsr |= TCSR_OCF; + MODIFIED_tcsr(); + if (((cc & 0x10) == 0) && ((tcsr & TCSR_EOCI) != 0)) + TAKE_OCI(); + } + if (counter.d >= timer_over.d) + { + timer_over.LowWord++; + tcsr |= TCSR_TOF; + pending_tcsr |= TCSR_TOF; + MODIFIED_tcsr(); + if (((cc & 0x10) == 0) && (tcsr & TCSR_ETOI) != 0) + TAKE_TOI(); + } + SET_TIMER_EVENT(); + } + private void m6800_tx(int value) + { + port2_data = (byte)((port2_data & 0xef) | (value << 4)); + if (port2_ddr == 0xff) + WriteIO(M6803_PORT2, port2_data); + else + WriteIO(M6803_PORT2, (byte)((port2_data & port2_ddr) | (ReadIO(M6803_PORT2) & (port2_ddr ^ 0xff)))); + } + private int m6800_rx() + { + return (ReadIO(M6803_PORT2) & M6800_PORT2_IO3) >> 3; + } + public void m6800_tx_tick() + { + if ((trcsr & M6800_TRCSR_TE) != 0) + { + port2_ddr |= M6800_PORT2_IO4; + switch (txstate) + { + case M6800_TX_STATE.INIT: + tx = 1; + txbits++; + + if (txbits == 10) + { + txstate = M6800_TX_STATE.READY; + txbits = 0; + } + break; + + case M6800_TX_STATE.READY: + switch (txbits) + { + case 0: + if ((trcsr & M6800_TRCSR_TDRE) != 0) + { + tx = 1; + } + else + { + tsr = tdr; + trcsr |= M6800_TRCSR_TDRE; + tx = 0; + txbits++; + } + break; + + case 9: + // send stop bit '1' + tx = 1; + CHECK_IRQ_LINES(); + txbits = 0; + break; + + default: + tx = tsr & 0x01; + tsr >>= 1; + txbits++; + break; + } + break; + } + } + m6800_tx(tx); + } + public void m6800_rx_tick() + { + if ((trcsr & M6800_TRCSR_RE) != 0) + { + if ((trcsr & M6800_TRCSR_WU) != 0) + { + if (m6800_rx() == 1) + { + rxbits++; + if (rxbits == 10) + { + trcsr &= (byte)(~M6800_TRCSR_WU); + rxbits = 0; + } + } + else + { + rxbits = 0; + } + } + else + { + switch (rxbits) + { + case 0: + if (m6800_rx() == 0) + { + rxbits++; + } + break; + case 9: + if (m6800_rx() == 1) + { + if ((trcsr & M6800_TRCSR_RDRF) != 0) + { + trcsr |= M6800_TRCSR_ORFE; + CHECK_IRQ_LINES(); + } + else + { + if ((trcsr & M6800_TRCSR_ORFE) == 0) + { + rdr = rsr; + trcsr |= M6800_TRCSR_RDRF; + CHECK_IRQ_LINES(); + } + } + } + else + { + if ((trcsr & M6800_TRCSR_ORFE) == 0) + { + // transfer unframed data into receive register + rdr = rsr; + } + trcsr |= (byte)M6800_TRCSR_ORFE; + trcsr &= (byte)(~M6800_TRCSR_RDRF); + CHECK_IRQ_LINES(); + } + rxbits = 0; + break; + default: + rsr >>= 1; + rsr |= (byte)(m6800_rx() << 7); + rxbits++; + break; + } + } + } + } + private void m6800_reset() + { + SEI(); /* IRQ disabled */ + PC.LowWord = RM16(0xfffe); + wai_state = 0; + nmi_state = 0; + irq_state[0] = 0; + irq_state[1] = 0; + ic_eddge = 0; + port1_ddr = 0x00; + port2_ddr = 0x00; + tcsr = 0x00; + pending_tcsr = 0x00; + irq2 = 0; + counter.d = 0x0000; + output_compare.d = 0xffff; + timer_over.d = 0xffff; + ram_ctrl |= 0x40; + trcsr = M6800_TRCSR_TDRE; + rmcr = 0; + EmuTimer.timer_enable(m6800_rx_timer, false); + EmuTimer.timer_enable(m6800_tx_timer, false); + txstate = M6800_TX_STATE.INIT; + txbits = rxbits = 0; + trcsr_read = 0; + } + public override void set_irq_line(int irqline, LineState state) + { + if (irqline == INPUT_LINE_NMI) + { + if (nmi_state == (byte)state) + { + return; + } + nmi_state = (byte)state; + if (state == LineState.CLEAR_LINE) + { + return; + } + ENTER_INTERRUPT(0xfffc); + } + else + { + int eddge; + if (irq_state[irqline] == (byte)state) + { + return; + } + irq_state[irqline] = (byte)state; + switch (irqline) + { + case M6800_IRQ_LINE: + if (state == LineState.CLEAR_LINE) + { + return; + } + break; + case M6800_TIN_LINE: + eddge = (state == LineState.CLEAR_LINE) ? 2 : 0; + if (((tcsr & TCSR_IEDG) ^ (state == LineState.CLEAR_LINE ? TCSR_IEDG : 0)) == 0) + { + return; + } + /* active edge in */ + tcsr |= TCSR_ICF; + pending_tcsr |= TCSR_ICF; + input_capture = counter.LowWord; + MODIFIED_tcsr(); + if ((cc & 0x10) == 0) + { + m6800_check_irq2(); + } + break; + default: + return; + } + CHECK_IRQ_LINES(); /* HJB 990417 */ + } + } + public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) + { + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + public override int ExecuteCycles(int cycles) + { + byte ireg; + pendingCycles = cycles; + CLEANUP_conters(); + INCREMENT_COUNTER(extra_cycles); + extra_cycles = 0; + do + { + int prevCycles = pendingCycles; + if ((wai_state & (M6800_WAI | M6800_SLP)) != 0) + { + EAT_CYCLES(); + } + else + { + PPC = PC; + //debugger_instruction_hook(Machine, PCD); + ireg = ReadOp(PC.LowWord); + PC.LowWord++; + insn[ireg](); + INCREMENT_COUNTER(this.cycles[ireg]); + int delta = prevCycles - pendingCycles; + totalExecutedCycles += (ulong)delta; + } + } while (pendingCycles > 0); + INCREMENT_COUNTER(extra_cycles); + extra_cycles = 0; + return cycles - pendingCycles; + } + public byte hd63701_internal_registers_r(int offset) + { + return m6803_internal_registers_r(offset); + } + public void hd63701_internal_registers_w(int offset, byte data) + { + m6803_internal_registers_w(offset, data); + } + private byte m6803_internal_registers_r(int offset) + { + switch (offset) + { + case 0x00: + return port1_ddr; + case 0x01: + return port2_ddr; + case 0x02: + return (byte)((ReadIO(0x100) & (port1_ddr ^ 0xff)) | (port1_data & port1_ddr)); + case 0x03: + return (byte)((ReadIO(0x101) & (port2_ddr ^ 0xff)) | (port2_data & port2_ddr)); + case 0x04: + return port3_ddr; + case 0x05: + return port4_ddr; + case 0x06: + return (byte)((ReadIO(0x102) & (port3_ddr ^ 0xff)) | (port3_data & port3_ddr)); + case 0x07: + return (byte)((ReadIO(0x103) & (port4_ddr ^ 0xff)) | (port4_data & port4_ddr)); + case 0x08: + pending_tcsr = 0; + return tcsr; + case 0x09: + if ((pending_tcsr & TCSR_TOF) == 0) + { + tcsr &= (byte)(~TCSR_TOF); + MODIFIED_tcsr(); + } + return counter.HighByte; + case 0x0a: + return counter.LowByte; + case 0x0b: + if ((pending_tcsr & TCSR_OCF) == 0) + { + tcsr &= (byte)(~TCSR_OCF); + MODIFIED_tcsr(); + } + return output_compare.HighByte; + case 0x0c: + if ((pending_tcsr & TCSR_OCF) == 0) + { + tcsr &= (byte)(~TCSR_OCF); + MODIFIED_tcsr(); + } + return output_compare.LowByte; + case 0x0d: + if ((pending_tcsr & TCSR_ICF) == 0) + { + tcsr &= (byte)(~TCSR_ICF); + MODIFIED_tcsr(); + } + return (byte)((input_capture >> 0) & 0xff); + case 0x0e: + return (byte)((input_capture >> 8) & 0xff); + case 0x0f: + //logerror("CPU #%d PC %04x: warning - read from unsupported register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); + return 0; + case 0x10: + return rmcr; + case 0x11: + trcsr_read = 1; + return trcsr; + case 0x12: + if (trcsr_read != 0) + { + trcsr_read = 0; + trcsr = (byte)(trcsr & 0x3f); + } + return rdr; + case 0x13: + return tdr; + case 0x14: + //logerror("CPU #%d PC %04x: read RAM control register\n",cpu_getactivecpu(),activecpu_get_pc()); + return ram_ctrl; + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1a: + case 0x1b: + case 0x1c: + case 0x1d: + case 0x1e: + case 0x1f: + default: + //logerror("CPU #%d PC %04x: warning - read from reserved internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); + return 0; + } + } + private void m6803_internal_registers_w(int offset, byte data) + { + int latch09 = 0; + switch (offset) + { + case 0x00: + if (port1_ddr != data) + { + port1_ddr = data; + if (port1_ddr == 0xff) + WriteIO(0x100, port1_data); + else + WriteIO(0x100, (byte)((port1_data & port1_ddr) | (ReadIO(0x100) & (port1_ddr ^ 0xff)))); + } + break; + case 0x01: + if (port2_ddr != data) + { + port2_ddr = data; + if (port2_ddr == 0xff) + WriteIO(0x101, port2_data); + else + WriteIO(0x101, (byte)((port2_data & port2_ddr) | (ReadIO(0x101) & (port2_ddr ^ 0xff)))); + + if ((port2_ddr & 2) != 0) + { + //logerror("CPU #%d PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n", cpu_getactivecpu(), activecpu_get_pc()); + } + } + break; + case 0x02: + port1_data = data; + if (port1_ddr == 0xff) + WriteIO(0x100, port1_data); + else + WriteIO(0x100, (byte)((port1_data & port1_ddr) | (ReadIO(0x100) & (port1_ddr ^ 0xff)))); + break; + case 0x03: + if ((trcsr & M6800_TRCSR_TE) != 0) + { + port2_data = (byte)((data & 0xef) | (tx << 4)); + } + else + { + port2_data = data; + } + if (port2_ddr == 0xff) + WriteIO(0x101, port2_data); + else + WriteIO(0x101, (byte)((port2_data & port2_ddr) | (ReadIO(0x101) & (port2_ddr ^ 0xff)))); + break; + case 0x04: + if (port3_ddr != data) + { + port3_ddr = data; + if (port3_ddr == 0xff) + WriteIO(0x102, port3_data); + else + WriteIO(0x102, (byte)((port3_data & port3_ddr) | (ReadIO(0x102) & (port3_ddr ^ 0xff)))); + } + break; + case 0x05: + if (port4_ddr != data) + { + port4_ddr = data; + if (port4_ddr == 0xff) + WriteIO(0x103, port4_data); + else + WriteIO(0x103, (byte)((port4_data & port4_ddr) | (ReadIO(0x103) & (port4_ddr ^ 0xff)))); + } + break; + case 0x06: + port3_data = data; + if (port3_ddr == 0xff) + WriteIO(0x102, port3_data); + else + WriteIO(0x102, (byte)((port3_data & port3_ddr) | (ReadIO(0x102) & (port3_ddr ^ 0xff)))); + break; + case 0x07: + port4_data = data; + if (port4_ddr == 0xff) + WriteIO(0x103, port4_data); + else + WriteIO(0x103, (byte)((port4_data & port4_ddr) | (ReadIO(0x103) & (port4_ddr ^ 0xff)))); + break; + case 0x08: + tcsr = data; + pending_tcsr &= tcsr; + MODIFIED_tcsr(); + if ((cc & 0x10) == 0) + m6800_check_irq2(); + break; + case 0x09: + latch09 = data & 0xff; /* 6301 only */ + counter.LowWord = 0xfff8; + timer_over.LowWord = counter.HighWord; + MODIFIED_counters(); + break; + case 0x0a: /* 6301 only */ + counter.LowWord = (ushort)((latch09 << 8) | (data & 0xff)); + timer_over.LowWord = counter.HighWord; + MODIFIED_counters(); + break; + case 0x0b: + if (output_compare.HighByte != data) + { + output_compare.HighByte = data; + MODIFIED_counters(); + } + break; + case 0x0c: + if (output_compare.LowByte != data) + { + output_compare.LowByte = data; + MODIFIED_counters(); + } + break; + case 0x0d: + case 0x0e: + case 0x12: + //logerror("CPU #%d PC %04x: warning - write %02x to read only internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + break; + case 0x0f: + //logerror("CPU #%d PC %04x: warning - write %02x to unsupported internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + break; + case 0x10: + rmcr = (byte)(data & 0x0f); + switch ((rmcr & M6800_RMCR_CC_MASK) >> 2) + { + case 0: + case 3: // not implemented + EmuTimer.timer_enable(m6800_rx_timer, false); + EmuTimer.timer_enable(m6800_tx_timer, false); + break; + + case 1: + case 2: + { + int divisor = M6800_RMCR_SS[rmcr & M6800_RMCR_SS_MASK]; + EmuTimer.timer_adjust_periodic(m6800_rx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor)))); + EmuTimer.timer_adjust_periodic(m6800_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor)))); + } + break; + } + break; + case 0x11: + if ((data & M6800_TRCSR_TE) != 0 && (trcsr & M6800_TRCSR_TE) == 0) + { + txstate = 0; + } + trcsr = (byte)((trcsr & 0xe0) | (data & 0x1f)); + break; + case 0x13: + if (trcsr_read != 0) + { + trcsr_read = (int)M6800_TX_STATE.INIT; + trcsr &= (byte)(~M6800_TRCSR_TDRE); + } + tdr = data; + break; + case 0x14: + //logerror("CPU #%d PC %04x: write %02x to RAM control register\n",cpu_getactivecpu(),activecpu_get_pc(),data); + ram_ctrl = data; + break; + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1a: + case 0x1b: + case 0x1c: + case 0x1d: + case 0x1e: + case 0x1f: + default: + //logerror("CPU #%d PC %04x: warning - write %02x to reserved internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + break; + } + } + public void SaveStateBinary(BinaryWriter writer) + { + writer.Write(PPC.LowWord); + writer.Write(PC.LowWord); + writer.Write(S.LowWord); + writer.Write(X.LowWord); + writer.Write(D.LowWord); + writer.Write(cc); + writer.Write(wai_state); + writer.Write(nmi_state); + writer.Write(irq_state[0]); + writer.Write(irq_state[1]); + writer.Write(ic_eddge); + writer.Write(port1_ddr); + writer.Write(port2_ddr); + writer.Write(port3_ddr); + writer.Write(port4_ddr); + writer.Write(port1_data); + writer.Write(port2_data); + writer.Write(port3_data); + writer.Write(port4_data); + writer.Write(tcsr); + writer.Write(pending_tcsr); + writer.Write(irq2); + writer.Write(ram_ctrl); + writer.Write(counter.d); + writer.Write(output_compare.d); + writer.Write(input_capture); + writer.Write(timer_over.d); + writer.Write(clock); + writer.Write(trcsr); + writer.Write(rmcr); + writer.Write(rdr); + writer.Write(tdr); + writer.Write(rsr); + writer.Write(tsr); + writer.Write(rxbits); + writer.Write(txbits); + writer.Write((int)txstate); + writer.Write(trcsr_read); + writer.Write(tx); + writer.Write(TotalExecutedCycles); + writer.Write(PendingCycles); + } + public void LoadStateBinary(BinaryReader reader) + { + PPC.LowWord = reader.ReadUInt16(); + PC.LowWord = reader.ReadUInt16(); + S.LowWord = reader.ReadUInt16(); + X.LowWord = reader.ReadUInt16(); + D.LowWord = reader.ReadUInt16(); + cc = reader.ReadByte(); + wai_state = reader.ReadByte(); + nmi_state = reader.ReadByte(); + irq_state[0] = reader.ReadByte(); + irq_state[1] = reader.ReadByte(); + ic_eddge = reader.ReadByte(); + port1_ddr = reader.ReadByte(); + port2_ddr = reader.ReadByte(); + port3_ddr = reader.ReadByte(); + port4_ddr = reader.ReadByte(); + port1_data = reader.ReadByte(); + port2_data = reader.ReadByte(); + port3_data = reader.ReadByte(); + port4_data = reader.ReadByte(); + tcsr = reader.ReadByte(); + pending_tcsr = reader.ReadByte(); + irq2 = reader.ReadByte(); + ram_ctrl = reader.ReadByte(); + counter.d = reader.ReadUInt32(); + output_compare.d = reader.ReadUInt32(); + input_capture = reader.ReadUInt16(); + timer_over.d = reader.ReadUInt32(); + clock = reader.ReadInt32(); + trcsr = reader.ReadByte(); + rmcr = reader.ReadByte(); + rdr = reader.ReadByte(); + tdr = reader.ReadByte(); + rsr = reader.ReadByte(); + tsr = reader.ReadByte(); + rxbits = reader.ReadInt32(); + txbits = reader.ReadInt32(); + txstate = (M6800.M6800_TX_STATE)reader.ReadInt32(); + trcsr_read = reader.ReadInt32(); + tx = reader.ReadInt32(); + TotalExecutedCycles = reader.ReadUInt64(); + PendingCycles = reader.ReadInt32(); + } + } + public class M6801 : M6800 + { + public M6801() + { + m6803_insn = new Action[256]{ + illegal,nop, illegal,illegal,lsrd, asld, tap, tpa, + inx, dex, CLV, SEV, CLC, SEC, cli, sei, + sba, cba, illegal,illegal,illegal,illegal,tab, tba, + illegal,daa, illegal,aba, illegal,illegal,illegal,illegal, + bra, brn, bhi, bls, bcc, bcs, bne, beq, + bvc, bvs, bpl, bmi, bge, blt, bgt, ble, + tsx, ins, pula, pulb, des, txs, psha, pshb, + pulx, rts, abx, rti, pshx, mul, wai, swi, + nega, illegal,illegal,coma, lsra, illegal,rora, asra, + asla, rola, deca, illegal,inca, tsta, illegal,clra, + negb, illegal,illegal,comb, lsrb, illegal,rorb, asrb, + aslb, rolb, decb, illegal,incb, tstb, illegal,clrb, + neg_ix, illegal,illegal,com_ix, lsr_ix, illegal,ror_ix, asr_ix, + asl_ix, rol_ix, dec_ix, illegal,inc_ix, tst_ix, jmp_ix, clr_ix, + neg_ex, illegal,illegal,com_ex, lsr_ex, illegal,ror_ex, asr_ex, + asl_ex, rol_ex, dec_ex, illegal,inc_ex, tst_ex, jmp_ex, clr_ex, + suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im, sta_im, + eora_im,adca_im,ora_im, adda_im,cpx_im, bsr, lds_im, sts_im, + suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di, sta_di, + eora_di,adca_di,ora_di, adda_di,cpx_di, jsr_di, lds_di, sts_di, + suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix, sta_ix, + eora_ix,adca_ix,ora_ix, adda_ix,cpx_ix, jsr_ix, lds_ix, sts_ix, + suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex, sta_ex, + eora_ex,adca_ex,ora_ex, adda_ex,cpx_ex, jsr_ex, lds_ex, sts_ex, + subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im, stb_im, + eorb_im,adcb_im,orb_im, addb_im,ldd_im, std_im, ldx_im, stx_im, + subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di, stb_di, + eorb_di,adcb_di,orb_di, addb_di,ldd_di, std_di, ldx_di, stx_di, + subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix, stb_ix, + eorb_ix,adcb_ix,orb_ix, addb_ix,ldd_ix, std_ix, ldx_ix, stx_ix, + subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex, stb_ex, + eorb_ex,adcb_ex,orb_ex, addb_ex,ldd_ex, std_ex, ldx_ex, stx_ex + }; + clock = 1000000; + irq_callback = Cpuint.cpu_3_irq_callback; + m6800_rx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_rx, false); + m6800_tx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_tx, false); + } + public override int ExecuteCycles(int cycles) + { + return m6801_execute(cycles); + } + public int m6801_execute(int cycles) + { + byte ireg; + pendingCycles = cycles; + CLEANUP_conters(); + INCREMENT_COUNTER(extra_cycles); + extra_cycles = 0; + do + { + int prevCycles = pendingCycles; + if ((wai_state & M6800_WAI) != 0) + { + EAT_CYCLES(); + } + else + { + PPC = PC; + //debugger_instruction_hook(Machine, PCD); + ireg = ReadOp(PC.LowWord); + PC.LowWord++; + m6803_insn[ireg](); + INCREMENT_COUNTER(cycles_6803[ireg]); + int delta = prevCycles - pendingCycles; + totalExecutedCycles += (ulong)delta; + } + } while (pendingCycles > 0); + INCREMENT_COUNTER(extra_cycles); + extra_cycles = 0; + return cycles - pendingCycles; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800.cs.meta new file mode 100644 index 00000000..4ef15f34 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b048d365a2726014e8b35b00934ba716 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800op.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800op.cs new file mode 100644 index 00000000..f53a0c52 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800op.cs @@ -0,0 +1,1889 @@ +using MAME.Core; + +namespace cpu.m6800 +{ + public partial class M6800 + { + protected void illegal() + { + + } + protected void trap() + { + //logerror("M6808: illegal opcode: address %04X, op %02X\n",PC,(int) M_RDOP_ARG(PC)&0xFF); + TAKE_TRAP(); + } + protected void nop() + { + } + protected void lsrd() + { + ushort t; + CLR_NZC(); + t = D.LowWord; + cc |= (byte)(t & 0x0001); + t >>= 1; + SET_Z16(t); + D.LowWord = t; + } + protected void asld() + { + int r; + ushort t; + t = D.LowWord; + r = t << 1; + CLR_NZVC(); + SET_FLAGS16((uint)t, (uint)t, (uint)r); + D.LowWord = (ushort)r; + } + protected void tap() + { + cc = D.HighByte; + ONE_MORE_INSN(); + CHECK_IRQ_LINES(); + } + protected void tpa() + { + D.HighByte = cc; + } + protected void inx() + { + ++X.LowWord; + CLR_Z(); + SET_Z16(X.LowWord); + } + protected void dex() + { + --X.LowWord; + CLR_Z(); + SET_Z16(X.LowWord); + } + protected void clv() + { + CLV(); + } + protected void sev() + { + SEV(); + } + protected void clc() + { + CLC(); + } + protected void sec() + { + SEC(); + } + protected void cli() + { + CLI(); + ONE_MORE_INSN(); + CHECK_IRQ_LINES(); + } + protected void sei() + { + SEI(); + ONE_MORE_INSN(); + CHECK_IRQ_LINES(); + } + protected void sba() + { + ushort t; + t = (ushort)(D.HighByte - D.LowByte); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, D.LowByte, t); + D.HighByte = (byte)t; + } + protected void cba() + { + ushort t; + t = (ushort)(D.HighByte - D.LowByte); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, D.LowByte, t); + } + protected void undoc1() + { + X.LowWord += ReadMemory((ushort)(S.LowWord + 1)); + } + protected void undoc2() + { + X.LowWord += ReadMemory((ushort)(S.LowWord + 1)); + } + protected void tab() + { + D.LowByte = D.HighByte; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void tba() + { + D.HighByte = D.LowByte; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void xgdx() + { + ushort t = X.LowWord; + X.LowWord = D.LowWord; + D.LowWord = t; + } + protected void daa() + { + byte msn, lsn; + ushort t, cf = 0; + msn = (byte)(D.HighByte & 0xf0); + lsn = (byte)(D.HighByte & 0x0f); + if (lsn > 0x09 || (cc & 0x20) != 0) + cf |= 0x06; + if (msn > 0x80 && lsn > 0x09) + cf |= 0x60; + if (msn > 0x90 || (cc & 0x01) != 0) + cf |= 0x60; + t = (ushort)(cf + D.HighByte); + CLR_NZV(); + SET_NZ8((byte)t); + SET_C8(t); + D.HighByte = (byte)t; + } + protected void slp() + { + wai_state |= M6800_SLP; + EAT_CYCLES(); + } + protected void aba() + { + ushort t; + t = (ushort)(D.HighByte + D.LowByte); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, D.LowByte, t); + SET_H(D.HighByte, D.LowByte, t); + D.HighByte = (byte)t; + } + protected void bra() + { + byte t; + t = IMMBYTE(); + PC.LowWord += (ushort)SIGNED(t); + if (t == 0xfe) + EAT_CYCLES(); + } + protected void brn() + { + byte t; + t = IMMBYTE(); + } + protected void bhi() + { + BRANCH((cc & 0x05) == 0); + } + protected void bls() + { + BRANCH((cc & 0x05) != 0); + } + protected void bcc() + { + BRANCH((cc & 0x01) == 0); + } + protected void bcs() + { + BRANCH((cc & 0x01) != 0); + } + protected void bne() + { + BRANCH((cc & 0x04) == 0); + } + protected void beq() + { + BRANCH((cc & 0x04) != 0); + } + protected void bvc() + { + BRANCH((cc & 0x02) == 0); + } + protected void bvs() + { + BRANCH((cc & 0x02) != 0); + } + protected void bpl() + { + BRANCH((cc & 0x08) == 0); + } + protected void bmi() + { + BRANCH((cc & 0x08) != 0); + } + protected void bge() + { + BRANCH(NXORV() == 0); + } + protected void blt() + { + BRANCH(NXORV() != 0); + } + protected void bgt() + { + BRANCH(!(NXORV() != 0 || (cc & 0x04) != 0)); + } + protected void ble() + { + BRANCH(NXORV() != 0 || (cc & 0x04) != 0); + } + protected void tsx() + { + X.LowWord = (ushort)(S.LowWord + 1); + } + protected void ins() + { + ++S.LowWord; + } + protected void pula() + { + D.HighByte = PULLBYTE(); + } + protected void pulb() + { + D.LowByte = PULLBYTE(); + } + protected void des() + { + --S.LowWord; + } + protected void txs() + { + S.LowWord = (ushort)(X.LowWord - 1); + } + protected void psha() + { + PUSHBYTE(D.HighByte); + } + protected void pshb() + { + PUSHBYTE(D.LowByte); + } + protected void pulx() + { + X = PULLWORD(); + } + protected void rts() + { + PC = PULLWORD(); + //CHANGE_PC(); + } + protected void abx() + { + X.LowWord += D.LowByte; + } + protected void rti() + { + cc = PULLBYTE(); + D.LowByte = PULLBYTE(); + D.HighByte = PULLBYTE(); + X = PULLWORD(); + PC = PULLWORD(); + //CHANGE_PC(); + CHECK_IRQ_LINES(); + } + protected void pshx() + { + PUSHWORD(X); + } + protected void mul() + { + ushort t; + t = (ushort)(D.HighByte * D.LowByte); + CLR_C(); + if ((t & 0x80) != 0) + SEC(); + D.LowWord = t; + } + protected void wai() + { + wai_state |= M6800_WAI; + PUSHWORD(PC); + PUSHWORD(X); + PUSHBYTE(D.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(cc); + CHECK_IRQ_LINES(); + if ((wai_state & M6800_WAI) != 0) + EAT_CYCLES(); + } + protected void swi() + { + PUSHWORD(PC); + PUSHWORD(X); + PUSHBYTE(D.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(cc); + SEI(); + PC.d = RM16(0xfffa); + //CHANGE_PC(); + } + protected void nega() + { + ushort r; + r = (ushort)(-D.HighByte); + CLR_NZVC(); + SET_FLAGS8(0, D.HighByte, r); + D.HighByte = (byte)r; + } + protected void coma() + { + D.HighByte = (byte)(~D.HighByte); + CLR_NZV(); + SET_NZ8(D.HighByte); + SEC(); + } + protected void lsra() + { + CLR_NZC(); + cc |= (byte)(D.HighByte & 0x01); + D.HighByte >>= 1; + SET_Z8(D.HighByte); + } + protected void rora() + { + byte r; + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(D.HighByte & 0x01); + r |= (byte)(D.HighByte >> 1); + SET_NZ8(r); + D.HighByte = r; + } + protected void asra() + { + CLR_NZC(); + cc |= (byte)(D.HighByte & 0x01); + D.HighByte >>= 1; + D.HighByte |= (byte)((D.HighByte & 0x40) << 1); + SET_NZ8(D.HighByte); + } + protected void asla() + { + ushort r; + r = (ushort)(D.HighByte << 1); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, D.HighByte, r); + D.HighByte = (byte)r; + } + protected void rola() + { + ushort t, r; + t = D.HighByte; + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8(t, t, r); + D.HighByte = (byte)r; + } + protected void deca() + { + --D.HighByte; + CLR_NZV(); + SET_FLAGS8D(D.HighByte); + } + protected void inca() + { + ++D.HighByte; + CLR_NZV(); + SET_FLAGS8I(D.HighByte); + } + protected void tsta() + { + CLR_NZVC(); + SET_NZ8(D.HighByte); + } + protected void clra() + { + D.HighByte = 0; + CLR_NZVC(); + SEZ(); + } + protected void negb() + { + ushort r; + r = (ushort)(-D.LowByte); + CLR_NZVC(); + SET_FLAGS8(0, D.LowByte, r); + D.LowByte = (byte)r; + } + protected void comb() + { + D.LowByte = (byte)(~D.LowByte); + CLR_NZV(); + SET_NZ8(D.LowByte); + SEC(); + } + protected void lsrb() + { + CLR_NZC(); + cc |= (byte)(D.LowByte & 0x01); + D.LowByte >>= 1; + SET_Z8(D.LowByte); + } + protected void rorb() + { + byte r; + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(D.LowByte & 0x01); + r |= (byte)(D.LowByte >> 1); + SET_NZ8(r); + D.LowByte = r; + } + protected void asrb() + { + CLR_NZC(); + cc |= (byte)(D.LowByte & 0x01); + D.LowByte >>= 1; + D.LowByte |= (byte)((D.LowByte & 0x40) << 1); + SET_NZ8(D.LowByte); + } + protected void aslb() + { + ushort r; + r = (ushort)(D.LowByte << 1); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, D.LowByte, r); + D.LowByte = (byte)r; + } + protected void rolb() + { + ushort t, r; + t = D.LowByte; + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8(t, t, r); + D.LowByte = (byte)r; + } + protected void decb() + { + --D.LowByte; + CLR_NZV(); + SET_FLAGS8D(D.LowByte); + } + protected void incb() + { + ++D.LowByte; + CLR_NZV(); + SET_FLAGS8I(D.LowByte); + } + protected void tstb() + { + CLR_NZVC(); + SET_NZ8(D.LowByte); + } + protected void clrb() + { + D.LowByte = 0; + CLR_NZVC(); + SEZ(); + } + protected void neg_ix() + { + ushort r, t; + t = (ushort)IDXBYTE(); + r = (ushort)(-t); + CLR_NZVC(); + SET_FLAGS8(0, t, r); + WriteMemory(EA.LowWord, (byte)r); + } + protected void aim_ix() + { + byte t, r; + t = IMMBYTE(); + r = IDXBYTE(); + r &= t; + CLR_NZV(); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void oim_ix() + { + byte t, r; + t = IMMBYTE(); + r = IDXBYTE(); + r |= t; + CLR_NZV(); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void com_ix() + { + byte t; + t = IDXBYTE(); + t = (byte)(~t); + CLR_NZV(); + SET_NZ8(t); + SEC(); + WriteMemory(EA.LowWord, t); + } + protected void lsr_ix() + { + byte t; + t = IDXBYTE(); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t >>= 1; + SET_Z8(t); + WriteMemory(EA.LowWord, t); + } + protected void eim_ix() + { + byte t, r; + t = IMMBYTE(); + r = IDXBYTE(); + r ^= t; + CLR_NZV(); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void ror_ix() + { + byte t, r; + t = IDXBYTE(); + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(t & 0x01); + r |= (byte)(t >> 1); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void asr_ix() + { + byte t; + t = IDXBYTE(); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t >>= 1; + t |= (byte)((t & 0x40) << 1); + SET_NZ8(t); + WriteMemory(EA.LowWord, t); + } + protected void asl_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8(t, t, r); + WriteMemory(EA.LowWord, (byte)r); + } + protected void rol_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8(t, t, r); + WriteMemory(EA.LowWord, (byte)r); + } + protected void dec_ix() + { + byte t; + t = IDXBYTE(); + --t; + CLR_NZV(); + SET_FLAGS8D(t); + WriteMemory(EA.LowWord, t); + } + protected void tim_ix() + { + byte t, r; + t = IMMBYTE(); + r = IDXBYTE(); + r &= t; + CLR_NZV(); + SET_NZ8(r); + } + protected void inc_ix() + { + byte t; + t = IDXBYTE(); + ++t; + CLR_NZV(); + SET_FLAGS8I(t); + WriteMemory(EA.LowWord, t); + } + protected void tst_ix() + { + byte t; + t = IDXBYTE(); + CLR_NZVC(); + SET_NZ8(t); + } + protected void jmp_ix() + { + INDEXED(); + PC.LowWord = EA.LowWord; + //CHANGE_PC(); + } + protected void clr_ix() + { + INDEXED(); + WriteMemory(EA.LowWord, 0); + CLR_NZVC(); + SEZ(); + } + protected void neg_ex() + { + ushort r, t; + t = EXTBYTE(); + r = (ushort)(-t); + CLR_NZVC(); + SET_FLAGS8(0, t, r); + WriteMemory(EA.LowWord, (byte)r); + } + protected void aim_di() + { + byte t, r; + t = IMMBYTE(); + r = DIRBYTE(); + r &= t; + CLR_NZV(); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void oim_di() + { + byte t, r; + t = IMMBYTE(); + r = DIRBYTE(); + r |= t; + CLR_NZV(); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void com_ex() + { + byte t; + t = EXTBYTE(); + t = (byte)(~t); + CLR_NZV(); + SET_NZ8(t); + SEC(); + WriteMemory(EA.LowWord, t); + } + protected void lsr_ex() + { + byte t; + t = EXTBYTE(); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t >>= 1; + SET_Z8(t); + WriteMemory(EA.LowWord, t); + } + protected void eim_di() + { + byte t, r; + t = IMMBYTE(); + r = DIRBYTE(); + r ^= t; + CLR_NZV(); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void ror_ex() + { + byte t, r; + t = EXTBYTE(); + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(t & 0x01); + r |= (byte)(t >> 1); + SET_NZ8(r); + WriteMemory(EA.LowWord, r); + } + protected void asr_ex() + { + byte t; + t = EXTBYTE(); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t >>= 1; + t |= (byte)((t & 0x40) << 1); + SET_NZ8(t); + WriteMemory(EA.LowWord, t); + } + protected void asl_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8(t, t, r); + WriteMemory(EA.LowWord, (byte)r); + } + protected void rol_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8(t, t, r); + WriteMemory(EA.LowWord, (byte)r); + } + protected void dec_ex() + { + byte t; + t = EXTBYTE(); + --t; + CLR_NZV(); + SET_FLAGS8D(t); + WriteMemory(EA.LowWord, (byte)t); + } + protected void tim_di() + { + byte t, r; + t = IMMBYTE(); + r = DIRBYTE(); + r &= t; + CLR_NZV(); + SET_NZ8(r); + } + protected void inc_ex() + { + byte t; + t = EXTBYTE(); + ++t; + CLR_NZV(); + SET_FLAGS8I(t); + WriteMemory(EA.LowWord, t); + } + protected void tst_ex() + { + byte t; + t = EXTBYTE(); + CLR_NZVC(); + SET_NZ8(t); + } + protected void jmp_ex() + { + EXTENDED(); + PC.LowWord = EA.LowWord; + //CHANGE_PC(); + } + protected void clr_ex() + { + EXTENDED(); + WriteMemory(EA.LowWord, 0); + CLR_NZVC(); + SEZ(); + } + protected void suba_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpa_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + } + protected void sbca_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void subd_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void anda_im() + { + byte t; + t = IMMBYTE(); + D.HighByte &= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void bita_im() + { + byte t, r; + t = IMMBYTE(); + r = (byte)(D.HighByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void lda_im() + { + D.HighByte = IMMBYTE(); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void sta_im() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + IMM8(); + WriteMemory(EA.LowWord, D.HighByte); + } + protected void eora_im() + { + byte t; + t = IMMBYTE(); + D.HighByte ^= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adca_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void ora_im() + { + byte t; + t = IMMBYTE(); + D.HighByte |= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adda_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpx_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZV(); + SET_NZ16((ushort)r); + SET_V16(d, b.d, r); + } + protected void cpx_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + } + protected void bsr() + { + byte t; + t = IMMBYTE(); + PUSHWORD(PC); + PC.LowWord += (ushort)SIGNED(t); + //CHANGE_PC(); + } + protected void lds_im() + { + S = IMMWORD(); + CLR_NZV(); + SET_NZ16(S.LowWord); + } + protected void sts_im() + { + CLR_NZV(); + SET_NZ16(S.LowWord); + IMM16(); + WM16(EA.LowWord, S); + } + protected void suba_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpa_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + } + protected void sbca_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void subd_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void anda_di() + { + byte t; + t = DIRBYTE(); + D.HighByte &= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void bita_di() + { + byte t, r; + t = DIRBYTE(); + r = (byte)(D.HighByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void lda_di() + { + D.HighByte = DIRBYTE(); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void sta_di() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + DIRECT(); + WriteMemory(EA.LowWord, D.HighByte); + } + protected void eora_di() + { + byte t; + t = DIRBYTE(); + D.HighByte ^= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adca_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void ora_di() + { + byte t; + t = DIRBYTE(); + D.HighByte |= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adda_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpx_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZV(); + SET_NZ16((ushort)r); + SET_V16(d, b.d, r); + } + protected void cpx_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + } + protected void jsr_di() + { + DIRECT(); + PUSHWORD(PC); + PC.LowWord = EA.LowWord; + //CHANGE_PC(); + } + protected void lds_di() + { + S = DIRWORD(); + CLR_NZV(); + SET_NZ16(S.LowWord); + } + protected void sts_di() + { + CLR_NZV(); + SET_NZ16(S.LowWord); + DIRECT(); + WM16(EA.LowWord, S); + } + protected void suba_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpa_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + } + protected void sbca_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.HighByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void subd_ix() + { + uint r, d; + Register b; + b = IDXWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void anda_ix() + { + byte t; + t = IDXBYTE(); + D.HighByte &= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void bita_ix() + { + byte t, r; + t = IDXBYTE(); + r = (byte)(D.HighByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void lda_ix() + { + D.HighByte = IDXBYTE(); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void sta_ix() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + INDEXED(); + WriteMemory(EA.LowWord, D.HighByte); + } + protected void eora_ix() + { + byte t; + t = IDXBYTE(); + D.HighByte ^= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adca_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.HighByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void ora_ix() + { + byte t; + t = IDXBYTE(); + D.HighByte |= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adda_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpx_ix() + { + uint r, d; + Register b; + b = IDXWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZV(); + SET_NZ16((ushort)r); + SET_V16(d, b.d, r); + } + protected void cpx_ix() + { + uint r, d; + Register b; + b = IDXWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + } + protected void jsr_ix() + { + INDEXED(); + PUSHWORD(PC); + PC.LowWord = EA.LowWord; + //CHANGE_PC(); + } + protected void lds_ix() + { + S = IDXWORD(); + CLR_NZV(); + SET_NZ16(S.LowWord); + } + protected void sts_ix() + { + CLR_NZV(); + SET_NZ16(S.LowWord); + INDEXED(); + WM16(EA.LowWord, S); + } + protected void suba_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpa_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + } + protected void sbca_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void subd_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void anda_ex() + { + byte t; + t = EXTBYTE(); + D.HighByte &= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void bita_ex() + { + byte t, r; + t = EXTBYTE(); + r = (byte)(D.HighByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void lda_ex() + { + D.HighByte = EXTBYTE(); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void sta_ex() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + EXTENDED(); + WriteMemory(EA.LowWord, D.HighByte); + } + protected void eora_ex() + { + byte t; + t = EXTBYTE(); + D.HighByte ^= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adca_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void ora_ex() + { + byte t; + t = EXTBYTE(); + D.HighByte |= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + protected void adda_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); SET_H(D.HighByte, t, r); + D.HighByte = (byte)r; + } + protected void cmpx_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZV(); + SET_NZ16((ushort)r); + SET_V16(d, b.d, r); + } + protected void cpx_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + } + protected void jsr_ex() + { + EXTENDED(); + PUSHWORD(PC); + PC.LowWord = EA.LowWord; + //CHANGE_PC(); + } + protected void lds_ex() + { + S = EXTWORD(); + CLR_NZV(); + SET_NZ16(S.LowWord); + } + protected void sts_ex() + { + CLR_NZV(); + SET_NZ16(S.LowWord); + EXTENDED(); + WM16(EA.LowWord, S); + } + protected void subb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void cmpb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + protected void sbcb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void addd_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void andb_im() + { + byte t; + t = IMMBYTE(); + D.LowByte &= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void bitb_im() + { + byte t, r; + t = IMMBYTE(); + r = (byte)(D.LowByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void ldb_im() + { + D.LowByte = IMMBYTE(); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void stb_im() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + IMM8(); + WriteMemory(EA.LowWord, D.LowByte); + } + protected void eorb_im() + { + byte t; + t = IMMBYTE(); + D.LowByte ^= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void adcb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void orb_im() + { + byte t; + t = IMMBYTE(); + D.LowByte |= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void addb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void ldd_im() + { + D = IMMWORD(); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + protected void std_im() + { + IMM16(); + CLR_NZV(); + SET_NZ16(D.LowWord); + WM16(EA.LowWord, D); + } + protected void ldx_im() + { + X = IMMWORD(); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + protected void stx_im() + { + CLR_NZV(); + SET_NZ16(X.LowWord); + IMM16(); + WM16(EA.LowWord, X); + } + protected void subb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void cmpb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + protected void sbcb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void addd_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void andb_di() + { + byte t; + t = DIRBYTE(); + D.LowByte &= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void bitb_di() + { + byte t, r; + t = DIRBYTE(); + r = (byte)(D.LowByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void ldb_di() + { + D.LowByte = DIRBYTE(); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void stb_di() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + DIRECT(); + WriteMemory(EA.LowWord, D.LowByte); + } + protected void eorb_di() + { + byte t; + t = DIRBYTE(); + D.LowByte ^= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void adcb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void orb_di() + { + byte t; + t = DIRBYTE(); + D.LowByte |= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void addb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void ldd_di() + { + D = DIRWORD(); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + protected void std_di() + { + DIRECT(); + CLR_NZV(); + SET_NZ16(D.LowWord); + WM16(EA.LowWord, D); + } + protected void ldx_di() + { + X = DIRWORD(); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + protected void stx_di() + { + CLR_NZV(); + SET_NZ16(X.LowWord); + DIRECT(); + WM16(EA.LowWord, X); + } + protected void subb_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void cmpb_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + protected void sbcb_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.LowByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void addd_ix() + { + uint r, d; + Register b; + b = IDXWORD(); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void andb_ix() + { + byte t; + t = IDXBYTE(); + D.LowByte &= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void bitb_ix() + { + byte t, r; + t = IDXBYTE(); + r = (byte)(D.LowByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void ldb_ix() + { + D.LowByte = IDXBYTE(); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void stb_ix() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + INDEXED(); + WriteMemory(EA.LowWord, D.LowByte); + } + protected void eorb_ix() + { + byte t; + t = IDXBYTE(); + D.LowByte ^= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void adcb_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.LowByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void orb_ix() + { + byte t; + t = IDXBYTE(); + D.LowByte |= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void addb_ix() + { + ushort t, r; + t = IDXBYTE(); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void ldd_ix() + { + D = IDXWORD(); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + protected void adcx_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(X.LowWord + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(X.LowWord, t, r); SET_H(X.LowWord, t, r); + X.LowWord = r; + } + protected void std_ix() + { + INDEXED(); + CLR_NZV(); + SET_NZ16(D.LowWord); + WM16(EA.LowWord, D); + } + protected void ldx_ix() + { + X = IDXWORD(); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + protected void stx_ix() + { + CLR_NZV(); + SET_NZ16(X.LowWord); + INDEXED(); + WM16(EA.LowWord, X); + } + protected void subb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void cmpb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + protected void sbcb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte - t - (cc & 0x01)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void addd_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + D.LowWord = (ushort)r; + } + protected void andb_ex() + { + byte t; + t = EXTBYTE(); + D.LowByte &= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void bitb_ex() + { + byte t, r; + t = EXTBYTE(); + r = (byte)(D.LowByte & t); + CLR_NZV(); + SET_NZ8(r); + } + protected void ldb_ex() + { + D.LowByte = EXTBYTE(); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void stb_ex() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + EXTENDED(); + WriteMemory(EA.LowWord, D.LowByte); + } + protected void eorb_ex() + { + byte t; + t = EXTBYTE(); + D.LowByte ^= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void adcb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte + t + (cc & 0x01)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void orb_ex() + { + byte t; + t = EXTBYTE(); + D.LowByte |= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + protected void addb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, t, r); + D.LowByte = (byte)r; + } + protected void ldd_ex() + { + D = EXTWORD(); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + protected void addx_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = X.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16(d, b.d, r); + X.LowWord = (ushort)r; + } + protected void std_ex() + { + EXTENDED(); + CLR_NZV(); + SET_NZ16(D.LowWord); + WM16(EA.LowWord, D); + } + protected void ldx_ex() + { + X = EXTWORD(); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + protected void stx_ex() + { + CLR_NZV(); + SET_NZ16(X.LowWord); + EXTENDED(); + WM16(EA.LowWord, X); + } + /*protected void CLV() + { + cc &= 0xfd; + } + protected void SEV() + { + + }*/ + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800op.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800op.cs.meta new file mode 100644 index 00000000..7ee81a8c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6800/M6800op.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ac480a98cd915a488d75cf520ceeb12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000.meta new file mode 100644 index 00000000..1c02498c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5363a2171a5a06e458069790876245da +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions.meta new file mode 100644 index 00000000..92b9cd15 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae3b5a67d5c131646a72ea967ddd303f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/BitArithemetic.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/BitArithemetic.cs new file mode 100644 index 00000000..bbbab669 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/BitArithemetic.cs @@ -0,0 +1,1062 @@ +using System; + +namespace cpu.m68000 +{ + partial class MC68000 + { + void AND0() // AND , Dn + { + int dstReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int srcMode = (op >> 3) & 0x07; + int srcReg = op & 0x07; + + V = false; + C = false; + + switch (size) + { + case 0: // Byte + D[dstReg].s8 &= ReadValueB(srcMode, srcReg); + pendingCycles -= (srcMode == 0) ? 4 : 4 + EACyclesBW[srcMode, srcReg]; + N = (D[dstReg].s8 & 0x80) != 0; + Z = (D[dstReg].s8 == 0); + return; + case 1: // Word + D[dstReg].s16 &= ReadValueW(srcMode, srcReg); + pendingCycles -= (srcMode == 0) ? 4 : 4 + EACyclesBW[srcMode, srcReg]; + N = (D[dstReg].s16 & 0x8000) != 0; + Z = (D[dstReg].s16 == 0); + return; + case 2: // Long + D[dstReg].s32 &= ReadValueL(srcMode, srcReg); + if (srcMode == 0 || (srcMode == 7 && srcReg == 4)) + { + pendingCycles -= 8 + EACyclesL[srcMode, srcReg]; + } + else + { + pendingCycles -= 6 + EACyclesL[srcMode, srcReg]; + } + N = (D[dstReg].s32 & 0x80000000) != 0; + Z = (D[dstReg].s32 == 0); + return; + } + } + + + void AND1() // AND Dn, + { + int srcReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int dstMode = (op >> 3) & 0x07; + int dstReg = op & 0x07; + + V = false; + C = false; + + switch (size) + { + case 0: // Byte + { + sbyte dest = PeekValueB(dstMode, dstReg); + sbyte value = (sbyte)(dest & D[srcReg].s8); + WriteValueB(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 4 : 8 + EACyclesBW[dstMode, dstReg]; + N = (value & 0x80) != 0; + Z = (value == 0); + return; + } + case 1: // Word + { + short dest = PeekValueW(dstMode, dstReg); + short value = (short)(dest & D[srcReg].s16); + WriteValueW(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 4 : 8 + EACyclesBW[dstMode, dstReg]; + N = (value & 0x8000) != 0; + Z = (value == 0); + return; + } + case 2: // Long + { + int dest = PeekValueL(dstMode, dstReg); + int value = dest & D[srcReg].s32; + WriteValueL(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 8 : 12 + EACyclesL[dstMode, dstReg]; + N = (value & 0x80000000) != 0; + Z = (value == 0); + return; + } + } + } + + + void ANDI() // ANDI #, + { + int size = (op >> 6) & 0x03; + int dstMode = (op >> 3) & 0x07; + int dstReg = op & 0x07; + + V = false; + C = false; + + switch (size) + { + case 0: // Byte + { + sbyte imm = (sbyte)ReadOpWord(PC); PC += 2; + sbyte arg = PeekValueB(dstMode, dstReg); + sbyte result = (sbyte)(imm & arg); + WriteValueB(dstMode, dstReg, result); + pendingCycles -= (dstMode == 0) ? 8 : 12 + EACyclesBW[dstMode, dstReg]; + N = (result & 0x80) != 0; + Z = (result == 0); + return; + } + case 1: // Word + { + short imm = ReadOpWord(PC); PC += 2; + short arg = PeekValueW(dstMode, dstReg); + short result = (short)(imm & arg); + WriteValueW(dstMode, dstReg, result); + pendingCycles -= (dstMode == 0) ? 8 : 12 + EACyclesBW[dstMode, dstReg]; + N = (result & 0x8000) != 0; + Z = (result == 0); + return; + } + case 2: // Long + { + int imm = ReadOpLong(PC); PC += 4; + int arg = PeekValueL(dstMode, dstReg); + int result = imm & arg; + WriteValueL(dstMode, dstReg, result); + pendingCycles -= (dstMode == 0) ? 14 : 20 + EACyclesL[dstMode, dstReg]; + N = (result & 0x80000000) != 0; + Z = (result == 0); + return; + } + } + } + + + void ANDI_CCR() //m68k_op_andi_16_toc , 0xffff, 0x023c, { 20} + { + short value; + value = ReadOpWord(PC); PC += 2; + CCR = (short)(CCR & value); + pendingCycles -= 20; + } + + + void EOR() // EOR Dn, + { + int srcReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int dstMode = (op >> 3) & 0x07; + int dstReg = op & 0x07; + + V = false; + C = false; + + switch (size) + { + case 0: // Byte + { + sbyte dest = PeekValueB(dstMode, dstReg); + sbyte value = (sbyte)(dest ^ D[srcReg].s8); + WriteValueB(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 4 : 8 + EACyclesBW[dstMode, dstReg]; + N = (value & 0x80) != 0; + Z = (value == 0); + return; + } + case 1: // Word + { + short dest = PeekValueW(dstMode, dstReg); + short value = (short)(dest ^ D[srcReg].s16); + WriteValueW(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 4 : 8 + EACyclesBW[dstMode, dstReg]; + N = (value & 0x8000) != 0; + Z = (value == 0); + return; + } + case 2: // Long + { + int dest = PeekValueL(dstMode, dstReg); + int value = dest ^ D[srcReg].s32; + WriteValueL(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 8 : 12 + EACyclesL[dstMode, dstReg]; + N = (value & 0x80000000) != 0; + Z = (value == 0); + return; + } + } + } + + + void EORI() + { + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + { + sbyte immed = (sbyte)ReadOpWord(PC); PC += 2; + sbyte value = (sbyte)(PeekValueB(mode, reg) ^ immed); + WriteValueB(mode, reg, value); + N = (value & 0x80) != 0; + Z = value == 0; + pendingCycles -= mode == 0 ? 8 : 12 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short immed = ReadOpWord(PC); PC += 2; + short value = (short)(PeekValueW(mode, reg) ^ immed); + WriteValueW(mode, reg, value); + N = (value & 0x8000) != 0; + Z = value == 0; + pendingCycles -= mode == 0 ? 8 : 12 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int immed = ReadOpLong(PC); PC += 4; + int value = PeekValueL(mode, reg) ^ immed; + WriteValueL(mode, reg, value); + N = (value & 0x80000000) != 0; + Z = value == 0; + pendingCycles -= mode == 0 ? 16 : 20 + EACyclesL[mode, reg]; + return; + } + } + } + + + void EORI_CCR()//m68k_op_eori_16_toc , 0xffff, 0x0a3c, { 20} + { + //m68ki_set_ccr(m68ki_get_ccr() ^ m68ki_read_imm_16()); + short value; + value = ReadOpWord(PC); PC += 2; + CCR = (short)(CCR ^ value); + pendingCycles -= 20; + } + + + void OR0() // OR , Dn + { + int dstReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int srcMode = (op >> 3) & 0x07; + int srcReg = op & 0x07; + + V = false; + C = false; + + switch (size) + { + case 0: // Byte + D[dstReg].s8 |= ReadValueB(srcMode, srcReg); + pendingCycles -= (srcMode == 0) ? 4 : 4 + EACyclesBW[srcMode, srcReg]; + N = (D[dstReg].s8 & 0x80) != 0; + Z = (D[dstReg].s8 == 0); + return; + case 1: // Word + D[dstReg].s16 |= ReadValueW(srcMode, srcReg); + pendingCycles -= (srcMode == 0) ? 4 : 4 + EACyclesBW[srcMode, srcReg]; + N = (D[dstReg].s16 & 0x8000) != 0; + Z = (D[dstReg].s16 == 0); + return; + case 2: // Long + D[dstReg].s32 |= ReadValueL(srcMode, srcReg); + if (srcMode == 0 || (srcMode == 7 && srcReg == 4)) + { + pendingCycles -= 8 + EACyclesL[srcMode, srcReg]; + } + else + { + pendingCycles -= 6 + EACyclesL[srcMode, srcReg]; + } + N = (D[dstReg].s32 & 0x80000000) != 0; + Z = (D[dstReg].s32 == 0); + return; + } + } + + + void OR1() // OR Dn, + { + int srcReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int dstMode = (op >> 3) & 0x07; + int dstReg = op & 0x07; + + V = false; + C = false; + + switch (size) + { + case 0: // Byte + { + sbyte dest = PeekValueB(dstMode, dstReg); + sbyte value = (sbyte)(dest | D[srcReg].s8); + WriteValueB(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 4 : 8 + EACyclesBW[dstMode, dstReg]; + N = (value & 0x80) != 0; + Z = (value == 0); + return; + } + case 1: // Word + { + short dest = PeekValueW(dstMode, dstReg); + short value = (short)(dest | D[srcReg].s16); + WriteValueW(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 4 : 8 + EACyclesBW[dstMode, dstReg]; + N = (value & 0x8000) != 0; + Z = (value == 0); + return; + } + case 2: // Long + { + int dest = PeekValueL(dstMode, dstReg); + int value = dest | D[srcReg].s32; + WriteValueL(dstMode, dstReg, value); + pendingCycles -= (dstMode == 0) ? 8 : 12 + EACyclesL[dstMode, dstReg]; + N = (value & 0x80000000) != 0; + Z = (value == 0); + return; + } + } + } + + + void ORI() + { + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + { + sbyte immed = (sbyte)ReadOpWord(PC); PC += 2; + sbyte value = (sbyte)(PeekValueB(mode, reg) | immed); + WriteValueB(mode, reg, value); + N = (value & 0x80) != 0; + Z = value == 0; + pendingCycles -= mode == 0 ? 8 : 12 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short immed = ReadOpWord(PC); PC += 2; + short value = (short)(PeekValueW(mode, reg) | immed); + WriteValueW(mode, reg, value); + N = (value & 0x8000) != 0; + Z = value == 0; + pendingCycles -= mode == 0 ? 8 : 12 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int immed = ReadOpLong(PC); PC += 4; + int value = PeekValueL(mode, reg) | immed; + WriteValueL(mode, reg, value); + N = (value & 0x80000000) != 0; + Z = value == 0; + pendingCycles -= mode == 0 ? 16 : 20 + EACyclesL[mode, reg]; + return; + } + } + } + + + void ORI_CCR()//m68k_op_ori_16_toc , 0xffff, 0x003c, { 20} + { + short value; + value = ReadOpWord(PC); PC += 2; + CCR = (short)(CCR | value); + pendingCycles -= 20; + } + + + void NOT() + { + int size = (op >> 6) & 0x03; + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + + V = false; + C = false; + + switch (size) + { + case 0: // Byte + { + sbyte value = PeekValueB(mode, reg); + value = (sbyte)~value; + WriteValueB(mode, reg, value); + pendingCycles -= (mode == 0) ? 4 : 8 + EACyclesBW[mode, reg]; + N = (value & 0x80) != 0; + Z = (value == 0); + return; + } + case 1: // Word + { + short value = PeekValueW(mode, reg); + value = (short)~value; + WriteValueW(mode, reg, value); + pendingCycles -= (mode == 0) ? 4 : 8 + EACyclesBW[mode, reg]; + N = (value & 0x8000) != 0; + Z = (value == 0); + return; + } + case 2: // Long + { + int value = PeekValueL(mode, reg); + value = ~value; + WriteValueL(mode, reg, value); + pendingCycles -= (mode == 0) ? 6 : 12 + EACyclesL[mode, reg];//8:12 + N = (value & 0x80000000) != 0; + Z = (value == 0); + return; + } + } + } + + + void LSLd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + C = X = (D[reg].u8 & 0x80) != 0; + D[reg].u8 <<= 1; + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].u8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + C = X = (D[reg].u16 & 0x8000) != 0; + D[reg].u16 <<= 1; + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].u16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + C = X = (D[reg].u32 & 0x80000000) != 0; + D[reg].u32 <<= 1; + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].u32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + + void LSLd0() + { + //m68k_op_lsl_16_ai , 0xfff8, 0xe3d0, { 12} + //m68k_op_lsl_16_pi , 0xfff8, 0xe3d8, { 12} + //m68k_op_lsl_16_pd , 0xfff8, 0xe3e0, { 14} + //m68k_op_lsl_16_di , 0xfff8, 0xe3e8, { 16} + //m68k_op_lsl_16_ix , 0xfff8, 0xe3f0, { 18} + //m68k_op_lsl_16_aw , 0xffff, 0xe3f8, { 16} + //m68k_op_lsl_16_al , 0xffff, 0xe3f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + int src; + ushort res; + src = PeekValueW(mode, reg); + res = (ushort)(src << 1); + WriteValueW(mode, reg, (short)res); + N = ((res & 0x8000) != 0); + Z = (res == 0); + X = C = ((res & 0x8000) != 0); + V = false; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + void LSRd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + C = X = (D[reg].u8 & 1) != 0; + D[reg].u8 >>= 1; + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].u8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + C = X = (D[reg].u16 & 1) != 0; + D[reg].u16 >>= 1; + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].u16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + C = X = (D[reg].u32 & 1) != 0; + D[reg].u32 >>= 1; + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].u32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + + void LSRd0() + { + //m68k_op_lsr_16_ai , 0xfff8, 0xe2d0, { 12} + //m68k_op_lsr_16_pi , 0xfff8, 0xe2d8, { 12} + //m68k_op_lsr_16_pd , 0xfff8, 0xe2e0, { 14} + //m68k_op_lsr_16_di , 0xfff8, 0xe2e8, { 16} + //m68k_op_lsr_16_ix , 0xfff8, 0xe2f0, { 18} + //m68k_op_lsr_16_aw , 0xffff, 0xe2f8, { 16} + //m68k_op_lsr_16_al , 0xffff, 0xe2f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + int src; + ushort res; + src = PeekValueW(mode, reg); + res = (ushort)(src >> 1); + WriteValueW(mode, reg, (short)res); + N = false; + Z = (res == 0); + //C = X = ((src & 0x10000) != 0); + C = X = ((src & 1) != 0); + V = false; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + void ASLd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + bool msb = D[reg].s8 < 0; + C = X = (D[reg].u8 & 0x80) != 0; + D[reg].s8 <<= 1; + V |= (D[reg].s8 < 0) != msb; + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].u8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + bool msb = D[reg].s16 < 0; + C = X = (D[reg].u16 & 0x8000) != 0; + D[reg].s16 <<= 1; + V |= (D[reg].s16 < 0) != msb; + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].u16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + bool msb = D[reg].s32 < 0; + C = X = (D[reg].u32 & 0x80000000) != 0; + D[reg].s32 <<= 1; + V |= (D[reg].s32 < 0) != msb; + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].u32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + + void ASLd0() + { + //m68k_op_asl_16_ai , 0xfff8, 0xe1d0, { 12} + //m68k_op_asl_16_pi , 0xfff8, 0xe1d8, { 12} + //m68k_op_asl_16_pd , 0xfff8, 0xe1e0, { 14} + //m68k_op_asl_16_di , 0xfff8, 0xe1e8, { 16} + //m68k_op_asl_16_ix , 0xfff8, 0xe1f0, { 18} + //m68k_op_asl_16_aw , 0xffff, 0xe1f8, { 16} + //m68k_op_asl_16_al , 0xffff, 0xe1f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + int src; + ushort res; + src = PeekValueW(mode, reg); + res = (ushort)(src << 1); + WriteValueW(mode, reg, (short)res); + N = ((res & 0x8000) != 0); + Z = (res == 0); + X = C = ((src & 0x8000) != 0); + src &= 0xc000; + V = !(src == 0 || src == 0xc000); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + void ASRd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + bool msb = D[reg].s8 < 0; + C = X = (D[reg].u8 & 1) != 0; + D[reg].s8 >>= 1; + V |= (D[reg].s8 < 0) != msb; + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].u8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + bool msb = D[reg].s16 < 0; + C = X = (D[reg].u16 & 1) != 0; + D[reg].s16 >>= 1; + V |= (D[reg].s16 < 0) != msb; + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].u16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + bool msb = D[reg].s32 < 0; + C = X = (D[reg].u32 & 1) != 0; + D[reg].s32 >>= 1; + V |= (D[reg].s32 < 0) != msb; + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].u32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + + void ASRd0() + { + //m68k_op_asr_16_ai , 0xfff8, 0xe0d0, { 12} + //m68k_op_asr_16_pi , 0xfff8, 0xe0d8, { 12} + //m68k_op_asr_16_pd , 0xfff8, 0xe0e0, { 14} + //m68k_op_asr_16_di , 0xfff8, 0xe0e8, { 16} + //m68k_op_asr_16_ix , 0xfff8, 0xe0f0, { 18} + //m68k_op_asr_16_aw , 0xffff, 0xe0f8, { 16} + //m68k_op_asr_16_al , 0xffff, 0xe0f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + int src; + ushort res; + src = PeekValueW(mode, reg); + res = (ushort)(src >> 1); + if ((src & 0x8000) != 0) + { + res |= 0x8000; + } + WriteValueW(mode, reg, (short)res); + N = ((res & 0x8000) != 0); + Z = (res == 0); + V = false; + C = X = ((src & 0x01) != 0); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + void ROLd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + C = (D[reg].u8 & 0x80) != 0; + D[reg].u8 = (byte)((D[reg].u8 << 1) | (D[reg].u8 >> 7)); + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].u8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + C = (D[reg].u16 & 0x8000) != 0; + D[reg].u16 = (ushort)((D[reg].u16 << 1) | (D[reg].u16 >> 15)); + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].u16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + C = (D[reg].u32 & 0x80000000) != 0; + D[reg].u32 = ((D[reg].u32 << 1) | (D[reg].u32 >> 31)); + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].u32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + + void ROLd0() + { + //m68k_op_rol_16_ai , 0xfff8, 0xe7d0, { 12} + //m68k_op_rol_16_pi , 0xfff8, 0xe7d8, { 12} + //m68k_op_rol_16_pd , 0xfff8, 0xe7e0, { 14} + //m68k_op_rol_16_di , 0xfff8, 0xe7e8, { 16} + //m68k_op_rol_16_ix , 0xfff8, 0xe7f0, { 18} + //m68k_op_rol_16_aw , 0xffff, 0xe7f8, { 16} + //m68k_op_rol_16_al , 0xffff, 0xe7f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + int src; + uint res; + src = PeekValueW(mode, reg); + res = (uint)(((src << 1) | (src >> 15)) & 0xffff); + WriteValueW(mode, reg, (short)res); + N = ((res & 0x8000) != 0); + Z = (res == 0); + C = ((res & 0x8000) != 0); + V = false; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + void RORd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + V = false; + C = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + C = (D[reg].u8 & 1) != 0; + D[reg].u8 = (byte)((D[reg].u8 >> 1) | (D[reg].u8 << 7)); + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].u8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + C = (D[reg].u16 & 1) != 0; + D[reg].u16 = (ushort)((D[reg].u16 >> 1) | (D[reg].u16 << 15)); + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].u16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + C = (D[reg].u32 & 1) != 0; + D[reg].u32 = ((D[reg].u32 >> 1) | (D[reg].u32 << 31)); + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].u32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + + void RORd0() + { + //m68k_op_ror_16_ai , 0xfff8, 0xe6d0, { 12} + //m68k_op_ror_16_pi , 0xfff8, 0xe6d8, { 12} + //m68k_op_ror_16_pd , 0xfff8, 0xe6e0, { 14} + //m68k_op_ror_16_di , 0xfff8, 0xe6e8, { 16} + //m68k_op_ror_16_ix , 0xfff8, 0xe6f0, { 18} + //m68k_op_ror_16_aw , 0xffff, 0xe6f8, { 16} + //m68k_op_ror_16_al , 0xffff, 0xe6f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + int src; + uint res; + src = PeekValueW(mode, reg); + res = (uint)(((src >> 1) | (src << 15)) & 0xffff); + WriteValueW(mode, reg, (short)res); + N = ((res & 0x8000) != 0); + Z = (res == 0); + C = ((res & 0x01) != 0); + V = false; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + void ROXLd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + C = X; + V = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + C = (D[reg].u8 & 0x80) != 0; + D[reg].u8 = (byte)((D[reg].u8 << 1) | (X ? 1 : 0)); + X = C; + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].s8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + C = (D[reg].u16 & 0x8000) != 0; + D[reg].u16 = (ushort)((D[reg].u16 << 1) | (X ? 1 : 0)); + X = C; + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].s16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + C = (D[reg].s32 & 0x80000000) != 0; + D[reg].s32 = ((D[reg].s32 << 1) | (X ? 1 : 0)); + X = C; + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].s32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + + void ROXLd0() + { + //m68k_op_roxl_16_ai , 0xfff8, 0xe5d0, { 12} + //m68k_op_roxl_16_pi , 0xfff8, 0xe5d8, { 12} + //m68k_op_roxl_16_pd , 0xfff8, 0xe5e0, { 14} + //m68k_op_roxl_16_di , 0xfff8, 0xe5e8, { 16} + //m68k_op_roxl_16_ix , 0xfff8, 0xe5f0, { 18} + //m68k_op_roxl_16_aw , 0xffff, 0xe5f8, { 16} + //m68k_op_roxl_16_al , 0xffff, 0xe5f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + ushort src; + uint src2; + uint res; + src = (ushort)PeekValueW(mode, reg); + src2 = (uint)(src | (X ? 0x10000 : 0)); + res = ((src2 << 1) | (src2 >> 16)); + C = X = (((res >> 8) & 0x100) != 0); + WriteValueW(mode, reg, (short)res); + N = ((res & 0x8000) != 0); + Z = (res == 0); + V = false; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + + void ROXRd() + { + int rot = (op >> 9) & 7; + int size = (op >> 6) & 3; + int m = (op >> 5) & 1; + int reg = op & 7; + + if (m == 0 && rot == 0) rot = 8; + else if (m == 1) rot = D[rot].s32 & 63; + + C = X; + V = false; + + switch (size) + { + case 0: // byte + for (int i = 0; i < rot; i++) + { + C = (D[reg].u8 & 1) != 0; + D[reg].u8 = (byte)((D[reg].u8 >> 1) | (X ? 0x80 : 0)); + X = C; + } + N = (D[reg].s8 & 0x80) != 0; + Z = D[reg].s8 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 1: // word + for (int i = 0; i < rot; i++) + { + C = (D[reg].u16 & 1) != 0; + D[reg].u16 = (ushort)((D[reg].u16 >> 1) | (X ? 0x8000 : 0)); + X = C; + } + N = (D[reg].s16 & 0x8000) != 0; + Z = D[reg].s16 == 0; + pendingCycles -= 6 + (rot * 2); + return; + case 2: // long + for (int i = 0; i < rot; i++) + { + C = (D[reg].s32 & 1) != 0; + D[reg].u32 = ((D[reg].u32 >> 1) | (X ? 0x80000000 : 0)); + X = C; + } + N = (D[reg].s32 & 0x80000000) != 0; + Z = D[reg].s32 == 0; + pendingCycles -= 8 + (rot * 2); + return; + } + } + + void ROXRd0() + { + //m68k_op_roxr_16_ai , 0xfff8, 0xe4d0, { 12} + //m68k_op_roxr_16_pi , 0xfff8, 0xe4d8, { 12} + //m68k_op_roxr_16_pd , 0xfff8, 0xe4e0, { 14} + //m68k_op_roxr_16_di , 0xfff8, 0xe4e8, { 16} + //m68k_op_roxr_16_ix , 0xfff8, 0xe4f0, { 18} + //m68k_op_roxr_16_aw , 0xffff, 0xe4f8, { 16} + //m68k_op_roxr_16_al , 0xffff, 0xe4f9, { 20} + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + ushort src; + uint src2; + uint res; + src = (ushort)PeekValueW(mode, reg); + src2 = ((uint)src | (uint)(X ? 0x10000 : 0)); + res = ((src2 >> 1) | (src2 << 16)); + C = X = ((res & 0x10000) != 0); + res = res & 0xffff; + WriteValueW(mode, reg, (short)res); + N = ((res & 0x8000) != 0); + Z = (res == 0); + V = false; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + + + void SWAP() + { + int reg = op & 7; + D[reg].u32 = (D[reg].u32 << 16) | (D[reg].u32 >> 16); + V = C = false; + Z = D[reg].u32 == 0; + N = (D[reg].s32 & 0x80000000) != 0; + pendingCycles -= 4; + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/BitArithemetic.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/BitArithemetic.cs.meta new file mode 100644 index 00000000..d3994343 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/BitArithemetic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d595cf6577109d144b95da9cb77cfdd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/DataMovement.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/DataMovement.cs new file mode 100644 index 00000000..27ade5bc --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/DataMovement.cs @@ -0,0 +1,560 @@ +using System; +using System.Text; + +namespace cpu.m68000 +{ + partial class MC68000 + { + void MOVE() + { + int size = ((op >> 12) & 0x03); + int dstMode = ((op >> 6) & 0x07); + int dstReg = ((op >> 9) & 0x07); + int srcMode = ((op >> 3) & 0x07); + int srcReg = (op & 0x07); + + int value = 0; + switch (size) + { + case 1: // Byte + value = ReadValueB(srcMode, srcReg); + WriteValueB(dstMode, dstReg, (sbyte)value); + pendingCycles -= MoveCyclesBW[srcMode + (srcMode == 7 ? srcReg : 0), dstMode + (dstMode == 7 ? dstReg : 0)]; + N = (value & 0x80) != 0; + break; + case 3: // Word + value = ReadValueW(srcMode, srcReg); + WriteValueW(dstMode, dstReg, (short)value); + pendingCycles -= MoveCyclesBW[srcMode + (srcMode == 7 ? srcReg : 0), dstMode + (dstMode == 7 ? dstReg : 0)]; + N = (value & 0x8000) != 0; + break; + case 2: // Long + value = ReadValueL(srcMode, srcReg); + WriteValueL(dstMode, dstReg, value); + pendingCycles -= MoveCyclesL[srcMode + (srcMode == 7 ? srcReg : 0), dstMode + (dstMode == 7 ? dstReg : 0)]; + N = (value & 0x80000000) != 0; + break; + } + + V = false; + C = false; + Z = (value == 0); + } + + + void MOVEA() + { + int size = ((op >> 12) & 0x03); + int dstReg = ((op >> 9) & 0x07); + int srcMode = ((op >> 3) & 0x07); + int srcReg = (op & 0x07); + + if (size == 3) // Word + { + A[dstReg].s32 = ReadValueW(srcMode, srcReg); + switch (srcMode) + { + case 0: pendingCycles -= 4; break; + case 1: pendingCycles -= 4; break; + case 2: pendingCycles -= 8; break; + case 3: pendingCycles -= 8; break; + case 4: pendingCycles -= 10; break; + case 5: pendingCycles -= 12; break; + case 6: pendingCycles -= 14; break; + case 7: + switch (srcReg) + { + case 0: pendingCycles -= 12; break; + case 1: pendingCycles -= 16; break; + case 2: pendingCycles -= 12; break; + case 3: pendingCycles -= 14; break; + case 4: pendingCycles -= 8; break; + default: throw new InvalidOperationException(); + } + break; + } + } + else + { // Long + A[dstReg].s32 = ReadValueL(srcMode, srcReg); + switch (srcMode) + { + case 0: pendingCycles -= 4; break; + case 1: pendingCycles -= 4; break; + case 2: pendingCycles -= 12; break; + case 3: pendingCycles -= 12; break; + case 4: pendingCycles -= 14; break; + case 5: pendingCycles -= 16; break; + case 6: pendingCycles -= 18; break; + case 7: + switch (srcReg) + { + case 0: pendingCycles -= 16; break; + case 1: pendingCycles -= 20; break; + case 2: pendingCycles -= 16; break; + case 3: pendingCycles -= 18; break; + case 4: pendingCycles -= 12; break; + default: throw new InvalidOperationException(); + } + break; + } + } + } + + + void MOVEP() + { + int dReg = ((op >> 9) & 0x07); + int dir = ((op >> 7) & 0x01); + int size = ((op >> 6) & 0x01); + int aReg = (op & 0x07); + if (dir == 0 && size == 0) + { + int ea; + ea = A[aReg].s32 + ReadOpWord(PC); PC += 2; + D[dReg].u32 = (D[dReg].u32 & 0xffff0000) | (ushort)(((byte)ReadByte(ea) << 8) + (byte)ReadByte(ea + 2)); + pendingCycles -= 16; + } + else if (dir == 0 && size == 1) + { + int ea; + ea = A[aReg].s32 + ReadOpWord(PC); PC += 2; + D[dReg].u32 = (uint)(((byte)ReadByte(ea) << 24) + ((byte)ReadByte(ea + 2) << 16) + ((byte)ReadByte(ea + 4) << 8) + (byte)ReadByte(ea + 6)); + pendingCycles -= 24; + } + else if (dir == 1 && size == 0) + { + uint src; + int ea; + ea = A[aReg].s32 + ReadOpWord(PC); PC += 2; + src = D[dReg].u32; + WriteByte(ea, (sbyte)((src >> 8) & 0xff)); + WriteByte(ea + 2, (sbyte)(src & 0xff)); + pendingCycles -= 16; + } + else if (dir == 1 && size == 1) + { + uint src; + int ea; + ea = A[aReg].s32 + ReadOpWord(PC); PC += 2; + src = D[dReg].u32; + WriteByte(ea, (sbyte)((src >> 24) & 0xff)); + WriteByte(ea + 2, (sbyte)((src >> 16) & 0xff)); + WriteByte(ea + 4, (sbyte)((src >> 8) & 0xff)); + WriteByte(ea + 6, (sbyte)(src & 0xff)); + pendingCycles -= 24; + } + } + + + void MOVEQ() + { + int value = (sbyte)op; // 8-bit data payload is sign-extended to 32-bits. + N = (value & 0x80) != 0; + Z = (value == 0); + V = false; + C = false; + D[(op >> 9) & 7].s32 = value; + pendingCycles -= 4; + } + + + static string DisassembleRegisterList0(ushort registers) + { + var str = new StringBuilder(); + int count = 0; + for (int i = 0; i < 8; i++) + { + if ((registers & 0x8000) != 0) + { + if (count > 0) str.Append(","); + str.Append("D" + i); + count++; + } + registers <<= 1; + } + for (int i = 0; i < 8; i++) + { + if ((registers & 0x8000) != 0) + { + if (count > 0) str.Append(","); + str.Append("A" + i); + count++; + } + registers <<= 1; + } + return str.ToString(); + } + + static string DisassembleRegisterList1(ushort registers) + { + var str = new StringBuilder(); + int count = 0; + for (int i = 0; i < 8; i++) + { + if ((registers & 1) != 0) + { + if (count > 0) str.Append(","); + str.Append("D" + i); + count++; + } + registers >>= 1; + } + for (int i = 0; i < 8; i++) + { + if ((registers & 1) != 0) + { + if (count > 0) str.Append(","); + str.Append("A" + i); + count++; + } + registers >>= 1; + } + return str.ToString(); + } + + void MOVEM0() + { + // Move register to memory + int size = (op >> 6) & 1; + int dstMode = (op >> 3) & 7; + int dstReg = (op >> 0) & 7; + + ushort registers = (ushort)ReadOpWord(PC); PC += 2; + int address = ReadAddress(dstMode, dstReg); + int regCount = 0; + + if (size == 0) + { + // word-assign + if (dstMode == 4) // decrement address + { + for (int i = 7; i >= 0; i--) + { + if ((registers & 1) == 1) + { + address -= 2; + WriteWord(address, A[i].s16); + regCount++; + } + registers >>= 1; + } + for (int i = 7; i >= 0; i--) + { + if ((registers & 1) == 1) + { + address -= 2; + WriteWord(address, D[i].s16); + regCount++; + } + registers >>= 1; + } + A[dstReg].s32 = address; + } + else + { // increment address + for (int i = 0; i <= 7; i++) + { + if ((registers & 1) == 1) + { + WriteWord(address, D[i].s16); + address += 2; + regCount++; + } + registers >>= 1; + } + for (int i = 0; i <= 7; i++) + { + if ((registers & 1) == 1) + { + WriteWord(address, A[i].s16); + address += 2; + regCount++; + } + registers >>= 1; + } + } + pendingCycles -= regCount * 4; + } + else + { + // long-assign + if (dstMode == 4) // decrement address + { + for (int i = 7; i >= 0; i--) + { + if ((registers & 1) == 1) + { + address -= 4; + WriteLong(address, A[i].s32); + regCount++; + } + registers >>= 1; + } + for (int i = 7; i >= 0; i--) + { + if ((registers & 1) == 1) + { + address -= 4; + WriteLong(address, D[i].s32); + regCount++; + } + registers >>= 1; + } + A[dstReg].s32 = address; + } + else + { // increment address + for (int i = 0; i <= 7; i++) + { + if ((registers & 1) == 1) + { + WriteLong(address, D[i].s32); + address += 4; + regCount++; + } + registers >>= 1; + } + for (int i = 0; i <= 7; i++) + { + if ((registers & 1) == 1) + { + WriteLong(address, A[i].s32); + address += 4; + regCount++; + } + registers >>= 1; + } + } + pendingCycles -= regCount * 8; + } + + switch (dstMode) + { + case 2: pendingCycles -= 8; break; + case 3: pendingCycles -= 8; break; + case 4: pendingCycles -= 8; break; + case 5: pendingCycles -= 12; break; + case 6: pendingCycles -= 14; break; + case 7: + switch (dstReg) + { + case 0: pendingCycles -= 12; break; + case 1: pendingCycles -= 16; break; + } + break; + } + } + + + void MOVEM1() + { + // Move memory to register + int size = (op >> 6) & 1; + int srcMode = (op >> 3) & 7; + int srcReg = (op >> 0) & 7; + + ushort registers = (ushort)ReadOpWord(PC); PC += 2; + int address = ReadAddress(srcMode, srcReg); + int regCount = 0; + + if (size == 0) + { + // word-assign + for (int i = 0; i < 8; i++) + { + if ((registers & 1) == 1) + { + if (srcMode == 7 && (srcReg == 2 || srcReg == 3)) + { + D[i].s32 = ReadPcrelWord(address); + } + else + { + D[i].s32 = ReadWord(address); + } + address += 2; + regCount++; + } + registers >>= 1; + } + for (int i = 0; i < 8; i++) + { + if ((registers & 1) == 1) + { + if (srcMode == 7 && (srcReg == 2 || srcReg == 3)) + { + A[i].s32 = ReadPcrelWord(address); + } + else + { + A[i].s32 = ReadWord(address); + } + address += 2; + regCount++; + } + registers >>= 1; + } + pendingCycles -= regCount * 4; + if (srcMode == 3) + A[srcReg].s32 = address; + } + else + { + // long-assign + for (int i = 0; i < 8; i++) + { + if ((registers & 1) == 1) + { + if (srcMode == 7 && (srcReg == 2 || srcReg == 3)) + { + D[i].s32 = ReadPcrelLong(address); + } + else + { + D[i].s32 = ReadLong(address); + } + address += 4; + regCount++; + } + registers >>= 1; + } + for (int i = 0; i < 8; i++) + { + if ((registers & 1) == 1) + { + if (srcMode == 7 && (srcReg == 2 || srcReg == 3)) + { + A[i].s32 = ReadPcrelLong(address); + } + else + { + A[i].s32 = ReadLong(address); + } + address += 4; + regCount++; + } + registers >>= 1; + } + pendingCycles -= regCount * 8; + if (srcMode == 3) + A[srcReg].s32 = address; + } + + switch (srcMode) + { + case 2: pendingCycles -= 12; break; + case 3: pendingCycles -= 12; break; + case 4: pendingCycles -= 12; break; + case 5: pendingCycles -= 16; break; + case 6: pendingCycles -= 18; break; + case 7: + switch (srcReg) + { + case 0: pendingCycles -= 16; break; + case 1: pendingCycles -= 20; break; + case 2: pendingCycles -= 16; break; + case 3: pendingCycles -= 18; break; + } + break; + } + } + + void LEA() + { + int mode = (op >> 3) & 7; + int sReg = (op >> 0) & 7; + int dReg = (op >> 9) & 7; + + A[dReg].u32 = (uint)ReadAddress(mode, sReg); + switch (mode) + { + case 2: pendingCycles -= 4; break; + case 5: pendingCycles -= 8; break; + case 6: pendingCycles -= 12; break; + case 7: + switch (sReg) + { + case 0: pendingCycles -= 8; break; + case 1: pendingCycles -= 12; break; + case 2: pendingCycles -= 8; break; + case 3: pendingCycles -= 12; break; + } + break; + } + } + + + void CLR() + { + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: WriteValueB(mode, reg, 0); pendingCycles -= mode == 0 ? 4 : 8 + EACyclesBW[mode, reg]; break; + case 1: + WriteValueW(mode, reg, 0); + pendingCycles -= mode == 0 ? 4 : 8 + EACyclesBW[mode, reg]; break; + case 2: WriteValueL(mode, reg, 0); pendingCycles -= mode == 0 ? 6 : 12 + EACyclesL[mode, reg]; break; + } + + N = V = C = false; + Z = true; + } + + + void EXT() + { + int size = (op >> 6) & 1; + int reg = op & 7; + + switch (size) + { + case 0: // ext.w + D[reg].s16 = D[reg].s8; + N = (D[reg].s16 & 0x8000) != 0; + Z = (D[reg].s16 == 0); + break; + case 1: // ext.l + D[reg].s32 = D[reg].s16; + N = (D[reg].s32 & 0x80000000) != 0; + Z = (D[reg].s32 == 0); + break; + } + + V = false; + C = false; + pendingCycles -= 4; + } + + + void PEA() + { + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + int ea = ReadAddress(mode, reg); + + A[7].s32 -= 4; + WriteLong(A[7].s32, ea); + + switch (mode) + { + case 2: pendingCycles -= 12; break; + case 5: pendingCycles -= 16; break; + case 6: pendingCycles -= 20; break; + case 7: + switch (reg) + { + case 0: pendingCycles -= 16; break; + case 1: pendingCycles -= 20; break; + case 2: pendingCycles -= 16; break; + case 3: pendingCycles -= 20; break; + } + break; + } + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/DataMovement.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/DataMovement.cs.meta new file mode 100644 index 00000000..ef013463 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/DataMovement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b9a46ea2abd2a04b88ef2ad2aa34650 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/IntegerMath.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/IntegerMath.cs new file mode 100644 index 00000000..f3b62ef4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/IntegerMath.cs @@ -0,0 +1,1478 @@ +using System; + +namespace cpu.m68000 +{ + partial class MC68000 + { + void ADD0() + { + int Dreg = (op >> 9) & 7; + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte value = ReadValueB(mode, reg); + int result = D[Dreg].s8 + value; + int uresult = D[Dreg].u8 + (byte)value; + X = C = (uresult & 0x100) != 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + N = (result & 0x80) != 0; + Z = (result & 0xff) == 0; + D[Dreg].s8 = (sbyte)result; + pendingCycles -= 4 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short value = ReadValueW(mode, reg); + int result = D[Dreg].s16 + value; + int uresult = D[Dreg].u16 + (ushort)value; + X = C = (uresult & 0x10000) != 0; + V = result > short.MaxValue || result < short.MinValue; + N = (result & 0x8000) != 0; + Z = (result & 0xffff) == 0; + D[Dreg].s16 = (short)result; + pendingCycles -= 4 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int value = ReadValueL(mode, reg); + long result = (long)D[Dreg].s32 + (long)value; + ulong uresult = (ulong)D[Dreg].u32 + ((ulong)(uint)value); + X = C = (uresult & 0x100000000) != 0; + V = result > int.MaxValue || result < int.MinValue; + N = (result & 0x80000000) != 0; + Z = (uint)result == 0; + D[Dreg].s32 = (int)result; + if (mode == 0 || mode == 1 || (mode == 7 && reg == 4)) + { + pendingCycles -= 8 + EACyclesL[mode, reg]; + } + else + { + pendingCycles -= 6 + EACyclesL[mode, reg]; + } + return; + } + } + } + + void ADD1() + { + int Dreg = (op >> 9) & 7; + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte value = PeekValueB(mode, reg); + int result = value + D[Dreg].s8; + int uresult = (byte)value + D[Dreg].u8; + X = C = (uresult & 0x100) != 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + N = (result & 0x80) != 0; + Z = (result & 0xff) == 0; + WriteValueB(mode, reg, (sbyte)result); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short value = PeekValueW(mode, reg); + int result = value + D[Dreg].s16; + int uresult = (ushort)value + D[Dreg].u16; + X = C = (uresult & 0x10000) != 0; + V = result > short.MaxValue || result < short.MinValue; + N = (result & 0x8000) != 0; + Z = (result & 0xffff) == 0; + WriteValueW(mode, reg, (short)result); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int value = PeekValueL(mode, reg); + long result = (long)value + (long)D[Dreg].s32; + ulong uresult = ((ulong)(uint)value) + (ulong)D[Dreg].u32; + X = C = (uresult & 0x100000000) != 0; + V = result > int.MaxValue || result < int.MinValue; + N = (result & 0x80000000) != 0; + Z = ((uint)result == 0); + WriteValueL(mode, reg, (int)result); + pendingCycles -= 12 + EACyclesL[mode, reg]; + return; + } + } + } + + + void ADDI() + { + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + int immed = (sbyte)ReadOpWord(PC); PC += 2; + sbyte value = PeekValueB(mode, reg); + int result = value + immed; + int uresult = (byte)value + (byte)immed; + X = C = (uresult & 0x100) != 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + N = (result & 0x80) != 0; + Z = (result & 0xff) == 0; + WriteValueB(mode, reg, (sbyte)result); + if (mode == 0) pendingCycles -= 8; + else pendingCycles -= 12 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + int immed = ReadOpWord(PC); PC += 2; + short value = PeekValueW(mode, reg); + int result = value + immed; + int uresult = (ushort)value + (ushort)immed; + X = C = (uresult & 0x10000) != 0; + V = result > short.MaxValue || result < short.MinValue; + N = (result & 0x8000) != 0; + Z = (result & 0xffff) == 0; + WriteValueW(mode, reg, (short)result); + if (mode == 0) pendingCycles -= 8; + else pendingCycles -= 12 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int immed = ReadOpLong(PC); PC += 4; + int value = PeekValueL(mode, reg); + long result = (long)value + (long)immed; + ulong uresult = ((ulong)(uint)value) + ((ulong)(uint)immed); + X = C = (uresult & 0x100000000) != 0; + V = result > int.MaxValue || result < int.MinValue; + N = (result & 0x80000000) != 0; + Z = ((uint)result == 0); + WriteValueL(mode, reg, (int)result); + if (mode == 0) + pendingCycles -= 16; + else + pendingCycles -= 20 + EACyclesL[mode, reg]; + return; + } + } + } + + + void ADDQ() + { + int data = (op >> 9) & 7; + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + data = data == 0 ? 8 : data; // range is 1-8; 0 represents 8 + + switch (size) + { + case 0: // byte + { + if (mode == 1) throw new Exception("ADDQ.B on address reg is invalid"); + sbyte value = PeekValueB(mode, reg); + int result = value + data; + int uresult = (byte)value + data; + N = (result & 0x80) != 0; + Z = result == 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + C = X = (uresult & 0x100) != 0; + WriteValueB(mode, reg, (sbyte)result); + if (mode == 0) pendingCycles -= 4; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + if (mode == 1) + { + int value = PeekValueL(mode, reg); + WriteValueL(mode, reg, value + data); + } + else + { + short value = PeekValueW(mode, reg); + int result = value + data; + int uresult = (ushort)value + data; + N = (result & 0x8000) != 0; + Z = result == 0; + V = result > short.MaxValue || result < short.MinValue; + C = X = (uresult & 0x10000) != 0; + WriteValueW(mode, reg, (short)result); + } + if (mode <= 1) + pendingCycles -= 4; + else + pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + default: // long + { + int value = PeekValueL(mode, reg); + long result = (long)value + (long)data; + ulong uresult = ((ulong)(uint)value) + ((ulong)(uint)data); + if (mode != 1) + { + N = (result & 0x80000000) != 0; + Z = (result == 0); + V = result > int.MaxValue || result < int.MinValue; + C = X = (uresult & 0x100000000) != 0; + } + WriteValueL(mode, reg, (int)result); + if (mode <= 1) + pendingCycles -= 8; + else + pendingCycles -= 12 + EACyclesL[mode, reg]; + return; + } + } + } + + + void ADDA() + { + int aReg = (op >> 9) & 7; + int size = (op >> 8) & 1; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + if (size == 0) // word + { + int value = ReadValueW(mode, reg); + A[aReg].s32 += value; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + else + { // long + int value = ReadValueL(mode, reg); + A[aReg].s32 += value; + if (mode == 0 || mode == 1 || (mode == 7 && reg == 4)) + pendingCycles -= 8 + EACyclesL[mode, reg]; + else + pendingCycles -= 6 + EACyclesL[mode, reg]; + } + } + + + void SUB0() + { + int dReg = (op >> 9) & 7; + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte a = D[dReg].s8; + sbyte b = ReadValueB(mode, reg); + int result = a - b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > sbyte.MaxValue || result < sbyte.MinValue; + N = (result & 0x80) != 0; + Z = result == 0; + D[dReg].s8 = (sbyte)result; + pendingCycles -= 4 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short a = D[dReg].s16; + short b = ReadValueW(mode, reg); + int result = a - b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > short.MaxValue || result < short.MinValue; + N = (result & 0x8000) != 0; + Z = result == 0; + D[dReg].s16 = (short)result; + pendingCycles -= 4 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int a = D[dReg].s32; + int b = ReadValueL(mode, reg); + long result = (long)a - (long)b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > int.MaxValue || result < int.MinValue; + N = (result & 0x80000000) != 0; + Z = result == 0; + D[dReg].s32 = (int)result; + if (mode == 0 || mode == 1 || (mode == 7 && reg == 4)) + { + pendingCycles -= 8 + EACyclesL[mode, reg]; + } + else + { + pendingCycles -= 6 + EACyclesL[mode, reg]; + } + return; + } + } + } + + void SUB1() + { + int dReg = (op >> 9) & 7; + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte a = PeekValueB(mode, reg); + sbyte b = D[dReg].s8; + int result = a - b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > sbyte.MaxValue || result < sbyte.MinValue; + N = (result & 0x80) != 0; + Z = result == 0; + WriteValueB(mode, reg, (sbyte)result); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short a = PeekValueW(mode, reg); + short b = D[dReg].s16; + int result = a - b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > short.MaxValue || result < short.MinValue; + N = (result & 0x8000) != 0; + Z = result == 0; + WriteValueW(mode, reg, (short)result); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int a = PeekValueL(mode, reg); + int b = D[dReg].s32; + long result = (long)a - (long)b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > int.MaxValue || result < int.MinValue; + N = (result & 0x80000000) != 0; + Z = ((uint)result == 0); + WriteValueL(mode, reg, (int)result); + pendingCycles -= 12 + EACyclesL[mode, reg]; + return; + } + } + } + + + void SUBI() + { + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte b = (sbyte)ReadOpWord(PC); PC += 2; + sbyte a = PeekValueB(mode, reg); + int result = a - b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > sbyte.MaxValue || result < sbyte.MinValue; + N = (result & 0x80) != 0; + Z = result == 0; + WriteValueB(mode, reg, (sbyte)result); + if (mode == 0) pendingCycles -= 8; + else pendingCycles -= 12 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short b = ReadOpWord(PC); PC += 2; + short a = PeekValueW(mode, reg); + int result = a - b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > short.MaxValue || result < short.MinValue; + N = (result & 0x8000) != 0; + Z = result == 0; + WriteValueW(mode, reg, (short)result); + if (mode == 0) pendingCycles -= 8; + else pendingCycles -= 12 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int b = ReadOpLong(PC); PC += 4; + int a = PeekValueL(mode, reg); + long result = (long)a - (long)b; + X = C = ((a < b) ^ ((a ^ b) >= 0) == false); + V = result > int.MaxValue || result < int.MinValue; + N = (result & 0x80000000) != 0; + Z = ((uint)result == 0); + WriteValueL(mode, reg, (int)result); + if (mode == 0) + pendingCycles -= 16; + else + pendingCycles -= 20 + EACyclesL[mode, reg]; + return; + } + } + } + + + void SUBQ() + { + int data = (op >> 9) & 7; + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + data = data == 0 ? 8 : data; // range is 1-8; 0 represents 8 + + switch (size) + { + case 0: // byte + { + if (mode == 1) throw new Exception("SUBQ.B on address reg is invalid"); + sbyte value = PeekValueB(mode, reg); + int result = value - data; + N = (result & 0x80) != 0; + Z = result == 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + C = X = ((value < data) ^ ((value ^ data) >= 0) == false); + WriteValueB(mode, reg, (sbyte)result); + if (mode == 0) pendingCycles -= 4; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + if (mode == 1) + { + int value = PeekValueL(mode, reg); + WriteValueL(mode, reg, value - data); + } + else + { + short value = PeekValueW(mode, reg); + int result = value - data; + N = (result & 0x8000) != 0; + Z = result == 0; + V = result > short.MaxValue || result < short.MinValue; + C = X = ((value < data) ^ ((value ^ data) >= 0) == false); + WriteValueW(mode, reg, (short)result); + } + if (mode == 0) + pendingCycles -= 4; + else if (mode == 1) + pendingCycles -= 8; + else + pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + default: // long + { + int value = PeekValueL(mode, reg); + long result = (long)value - (long)data; + if (mode != 1) + { + N = (result & 0x80000000) != 0; + Z = (result == 0); + V = result > int.MaxValue || result < int.MinValue; + C = X = ((value < data) ^ ((value ^ data) >= 0) == false); + } + WriteValueL(mode, reg, (int)result); + if (mode <= 1) pendingCycles -= 8; + else pendingCycles -= 12 + EACyclesL[mode, reg]; + return; + } + } + } + + + void SUBA() + { + int aReg = (op >> 9) & 7; + int size = (op >> 8) & 1; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + if (size == 0) // word + { + int value = ReadValueW(mode, reg); + A[aReg].s32 -= value; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + else + { // long + int value = ReadValueL(mode, reg); + A[aReg].s32 -= value; + if (mode == 0 || mode == 1 || (mode == 7 && reg == 4)) + pendingCycles -= 8 + EACyclesL[mode, reg]; + else + pendingCycles -= 6 + EACyclesL[mode, reg]; + } + } + + + void NEG() + { + int size = (op >> 6) & 0x03; + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + + if (mode == 1) throw new Exception("NEG on address reg is invalid"); + + switch (size) + { + case 0: // Byte + { + sbyte value = PeekValueB(mode, reg); + int result = 0 - value; + N = (result & 0x80) != 0; + Z = result == 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + C = X = ((0 < value) ^ ((0 ^ value) >= 0) == false); + WriteValueB(mode, reg, (sbyte)result); + if (mode == 0) pendingCycles -= 4; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 1: // Word + { + short value = PeekValueW(mode, reg); + int result = 0 - value; + N = (result & 0x8000) != 0; + Z = result == 0; + V = result > short.MaxValue || result < short.MinValue; + C = X = ((0 < value) ^ ((0 ^ value) >= 0) == false); + WriteValueW(mode, reg, (short)result); + if (mode == 0) pendingCycles -= 4; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 2: // Long + { + int value = PeekValueL(mode, reg); + long result = 0 - value; + N = (result & 0x80000000) != 0; + Z = result == 0; + V = result > int.MaxValue || result < int.MinValue; + C = X = ((0 < value) ^ ((0 ^ value) >= 0) == false); + WriteValueL(mode, reg, (int)result); + if (mode == 0) + pendingCycles -= 6; + else + pendingCycles -= 12 + EACyclesL[mode, reg]; + return; + } + } + } + + + void NBCD() + { + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + byte result = (byte)PeekValueB(mode, reg); + result = (byte)((0x9a - result - (X ? 1 : 0)) & 0xff); + if (result != 0x9a) + { + V = (((~result) & 0x80) != 0); + if ((result & 0x0f) == 0x0a) + { + result = (byte)((result & 0xf0) + 0x10); + } + V &= ((result & 0x80) != 0); + WriteValueB(mode, reg, (sbyte)result); + Z &= (result == 0); + C = true; + X = true; + } + else + { + V = false; + C = false; + X = false; + } + N = ((result & 0x80) != 0); + pendingCycles -= (mode == 0) ? 6 : 8 + EACyclesBW[mode, reg]; + } + + + void ILLEGAL() + { + TrapVector2(4); + pendingCycles -= 4; + } + + + void ILL() + { + TrapVector2(4); + } + + + void STOP() + { + if (S) + { + short new_sr = ReadOpWord(PC); PC += 2; + stopped = true; + SR = new_sr; + pendingCycles = 0; + } + else + { + TrapVector2(8); + } + pendingCycles -= 4; + } + + + void TRAPV() + { + if (!V) + { + pendingCycles -= 4; + } + else + { + TrapVector(7); + pendingCycles -= 4; + } + } + + + void CHK() + { + int dreg = (op >> 9) & 0x07; + int boundMode = (op >> 3) & 0x07; + int boundReg = op & 0x07; + short src, bound; + src = D[dreg].s16; + bound = ReadValueW(boundMode, boundReg); + Z = (src == 0); + V = false; + C = false; + if (src >= 0 && src <= bound) + { + pendingCycles -= 10 + EACyclesBW[boundMode, boundReg]; + } + else + { + N = (src < 0); + TrapVector(6); + pendingCycles -= 10 + EACyclesBW[boundMode, boundReg]; + } + } + + + void NEGX() + { + int size = (op >> 6) & 0x03; + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + + if (mode == 1) + { + throw new Exception("NEG on address reg is invalid"); + } + switch (size) + { + case 0: // Byte + { + sbyte value = PeekValueB(mode, reg); + int result = 0 - value - (X ? 1 : 0); + N = (result & 0x80) != 0; + Z &= (result == 0); + V = result > sbyte.MaxValue || result < sbyte.MinValue; + C = X = ((0 < value) ^ ((0 ^ value) >= 0) == false); + WriteValueB(mode, reg, (sbyte)result); + if (mode == 0) pendingCycles -= 4; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 1: // Word + { + short value = PeekValueW(mode, reg); + int result = 0 - value - (X ? 1 : 0); + N = (result & 0x8000) != 0; + Z &= (result == 0); + V = result > short.MaxValue || result < short.MinValue; + C = X = ((0 < value) ^ ((0 ^ value) >= 0) == false); + WriteValueW(mode, reg, (short)result); + if (mode == 0) pendingCycles -= 4; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 2: // Long + { + int value = PeekValueL(mode, reg); + long result = 0 - value - (X ? 1 : 0); + N = (result & 0x80000000) != 0; + Z &= (result == 0); + V = result > int.MaxValue || result < int.MinValue; + C = X = ((0 < value) ^ ((0 ^ value) >= 0) == false); + WriteValueL(mode, reg, (int)result); + if (mode == 0) pendingCycles -= 6; + else pendingCycles -= 12 + EACyclesL[mode, reg]; + return; + } + } + } + + + void SBCD0() + { + int dstReg = (op >> 9) & 0x07; + int srcReg = op & 0x07; + uint dst = D[dstReg].u32; + uint src = D[srcReg].u32; + uint res; + res = (uint)((dst & 0x0f) - (src & 0x0f) - (X ? 1 : 0)); + V = false; + if (res > 9) + { + res -= 6; + } + res += (dst & 0xf0) - (src & 0xf0); + if (res > 0x99) + { + res += 0xa0; + X = C = true; + N = true; + } + else + { + N = X = C = false; + } + res = res & 0xff; + Z &= (res == 0); + D[dstReg].u32 = (D[dstReg].u32 & 0xffffff00) | res; + pendingCycles -= 6; + } + + + void SBCD1() + { + int dstReg = (op >> 9) & 0x07; + int srcReg = op & 0x07; + uint src, dst, res; + if (srcReg == 7) + { + A[srcReg].u32 -= 2; + } + else + { + A[srcReg].u32--; + } + if (dstReg == 7) + { + A[dstReg].u32 -= 2; + } + else + { + A[dstReg].u32--; + } + src = (uint)ReadByte(A[srcReg].s32); + dst = (uint)ReadByte(A[dstReg].s32); + res = (uint)((dst & 0x0f) - (src & 0x0f) - (X ? 1 : 0)); + V = false; + if (res > 9) + { + res -= 6; + } + res += (dst & 0xf0) - (src & 0xf0); + if (res > 0x99) + { + res += 0xa0; + X = C = true; + N = true; + } + else + { + N = X = C = false; + } + res = res & 0xff; + Z &= (res == 0); + WriteByte(A[dstReg].s32, (sbyte)res); + pendingCycles -= 18; + } + + + void ABCD0() + { + int dstReg = (op >> 9) & 0x07; + int srcReg = op & 0x07; + uint src, dst, res; + src = D[srcReg].u32; + dst = D[dstReg].u32; + res = (uint)((src & 0x0f) + (dst & 0x0f) + (X ? 1 : 0)); + V = (((~res) & 0x80) != 0); + if (res > 9) + { + res += 6; + } + res += (src & 0xf0) + (dst & 0xf0); + X = C = (res > 0x99); + if (C) + { + res -= 0xa0; + } + V &= ((res & 0x80) != 0); + N = ((res & 0x80) != 0); + res = res & 0xff; + Z &= (res == 0); + D[dstReg].u32 = (((D[dstReg].u32) & 0xffffff00) | res); + pendingCycles -= 6; + } + + + void ABCD1() + { + int dstReg = (op >> 9) & 0x07; + int srcReg = op & 0x07; + uint src, dst, res; + if (srcReg == 7) + { + A[srcReg].u32 -= 2; + } + else + { + A[srcReg].u32--; + } + if (dstReg == 7) + { + A[dstReg].u32 -= 2; + } + else + { + A[dstReg].u32--; + } + src = (uint)ReadByte(A[srcReg].s32); + dst = (uint)ReadByte(A[dstReg].s32); + res = (uint)((src & 0x0f) + (dst & 0x0f) + (X ? 1 : 0)); + V = (((~res) & 0x80) != 0); + if (res > 9) + { + res += 6; + } + res += (src & 0xf0) + (dst & 0xf0); + X = C = (res > 0x99); + if (C) + { + res -= 0xa0; + } + V &= ((res & 0x80) != 0); + N = ((res & 0x80) != 0); + res = res & 0xff; + Z &= (res == 0); + WriteByte(A[dstReg].s32, (sbyte)res); + pendingCycles -= 18; + } + + + void EXGdd() + { + int reg_a = (op >> 9) & 0x07; + int reg_b = op & 0x07; + uint tmp; + tmp = D[reg_a].u32; + D[reg_a].u32 = D[reg_b].u32; + D[reg_b].u32 = tmp; + pendingCycles -= 6; + } + + + void EXGaa() + { + int reg_a = (op >> 9) & 0x07; + int reg_b = op & 0x07; + uint tmp; + tmp = A[reg_a].u32; + A[reg_a].u32 = A[reg_b].u32; + A[reg_b].u32 = tmp; + pendingCycles -= 6; + } + + + void EXGda() + { + int reg_a = (op >> 9) & 0x07; + int reg_b = op & 0x07; + uint tmp; + tmp = D[reg_a].u32; + D[reg_a].u32 = A[reg_b].u32; + A[reg_b].u32 = tmp; + pendingCycles -= 6; + } + + + void ADDX0() + { + int dstReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int srcReg = op & 0x07; + switch (size) + { + case 0: + { + uint src = D[srcReg].u32 & 0xff; + uint dst = D[dstReg].u32 & 0xff; + uint res; + res = (uint)(dst + src + (X ? 1 : 0)); + N = ((res & 0x80) != 0); + V = (((src ^ res & (dst ^ res)) & 0x80) != 0); + X = C = ((res & 0x100) != 0); + res = res & 0xff; + Z &= (res == 0); + D[dstReg].u32 = (D[dstReg].u32 & 0xffffff00) | res; + pendingCycles -= 4; + return; + } + case 1: + { + uint src = D[srcReg].u32 & 0xffff; + uint dst = D[dstReg].u32 & 0xffff; + uint res; + res = (uint)(dst + src + (X ? 1 : 0)); + N = ((res & 0x8000) != 0); + V = ((((src ^ res) & (dst ^ res)) & 0x8000) != 0); + X = C = ((res & 0x10000) != 0); + res = res & 0xffff; + Z &= (res == 0); + D[dstReg].u32 = (D[dstReg].u32 & 0xffff0000) | res; + pendingCycles -= 4; + return; + } + case 2: + { + uint src = D[srcReg].u32; + uint dst = D[dstReg].u32; + uint res; + res = (uint)(dst + src + (X ? 1 : 0)); + N = ((res & 0x80000000) != 0); + V = ((((src ^ res) & (dst ^ res)) & 0x80000000) != 0); + X = C = ((((src & dst) | (~res & (src | dst))) & 0x80000000) != 0); + Z &= (res == 0); + D[dstReg].u32 = res; + pendingCycles -= 8; + return; + } + } + } + + + void ADDX1() + { + int dstReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int srcReg = op & 0x07; + switch (size) + { + case 0: + { + if (srcReg == 7) + { + A[srcReg].u32 -= 2; + } + else + { + A[srcReg].u32--; + } + if (dstReg == 7) + { + A[dstReg].u32 -= 2; + } + else + { + A[dstReg].u32--; + } + uint src = (uint)ReadByte(A[srcReg].s32); + uint dst = (uint)ReadByte(A[dstReg].s32); + uint res; + res = (uint)(dst + src + (X ? 1 : 0)); + N = ((res & 0x80) != 0); + V = ((((src ^ res) & (dst ^ res)) & 0x80) != 0); + X = C = ((res & 0x100) != 0); + res = res & 0xff; + Z &= (res == 0); + WriteByte(A[dstReg].s32, (sbyte)res); + pendingCycles -= 18; + return; + } + case 1: + { + A[srcReg].u32 -= 2; + uint src = (uint)ReadWord(A[srcReg].s32); + A[dstReg].u32 -= 2; + uint dst = (uint)ReadWord(A[dstReg].s32); + uint res; + res = (uint)(dst + src + (X ? 1 : 0)); + N = ((res & 0x8000) != 0); + V = ((((src ^ res) & (dst ^ res)) & 0x8000) != 0); + X = C = ((res & 0x10000) != 0); + res = res & 0xffff; + Z &= (res == 0); + WriteWord(A[dstReg].s32, (short)res); + pendingCycles -= 18; + return; + } + case 2: + { + A[srcReg].u32 -= 4; + uint src = (uint)ReadLong(A[srcReg].s32); + A[dstReg].u32 -= 4; + uint dst = (uint)ReadWord(A[dstReg].s32); + uint res; + res = (uint)(dst + src + (X ? 1 : 0)); + N = ((res & 0x80000000) != 0); + V = (((((src ^ res) & (dst ^ res)) >> 24) & 0x80) != 0); + X = C = (((((src & dst) | (~res & (src | dst))) >> 23) & 0x100) != 0); + Z &= (res == 0); + WriteLong(A[dstReg].s32, (int)res); + pendingCycles -= 30; + return; + } + } + } + + + void SUBX0() + { + int dstReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int srcReg = op & 0x07; + switch (size) + { + case 0: + { + uint src = D[srcReg].u32 & 0xff; + uint dst = D[dstReg].u32 & 0xff; + uint res; + res = (uint)(dst - src - (X ? 1 : 0)); + N = ((res & 0x80) != 0); + X = C = ((res & 0x100) != 0); + V = ((((src ^ dst) & (res ^ dst)) & 0x80) != 0); + res = res & 0xff; + Z &= (res == 0); + D[dstReg].u32 = (D[dstReg].u32 & 0xffffff00) | res; + pendingCycles -= 4; + return; + } + case 1: + { + uint src = D[srcReg].u32 & 0xffff; + uint dst = D[dstReg].u32 & 0xffff; + uint res; + res = (uint)(dst - src - (X ? 1 : 0)); + N = ((res & 0x8000) != 0); + X = C = ((res & 0x10000) != 0); + V = ((((src ^ dst) & (res ^ dst)) & 0x8000) != 0); + res = res & 0xffff; + Z &= (res == 0); + D[dstReg].u32 = (D[dstReg].u32 & 0xffff0000) | res; + pendingCycles -= 4; + return; + } + case 2: + { + uint src = D[srcReg].u32; + uint dst = D[dstReg].u32; + uint res; + res = (uint)(dst - src - (X ? 1 : 0)); + N = ((res & 0x80000000) != 0); + X = C = (((((src & res) | (~dst & (src | res))) >> 23) & 0x100) != 0); + V = (((((src ^ dst) & (res ^ dst)) >> 24) & 0x80) != 0); + Z &= (res == 0); + D[dstReg].u32 = res; + pendingCycles -= 8; + return; + } + } + } + + + void SUBX1() + { + int dstReg = (op >> 9) & 0x07; + int size = (op >> 6) & 0x03; + int srcReg = op & 0x07; + switch (size) + { + case 0: + { + if (srcReg == 7) + { + A[srcReg].u32 -= 2; + } + else + { + A[srcReg].u32--; + } + if (dstReg == 7) + { + A[dstReg].u32 -= 2; + } + else + { + A[dstReg].u32--; + } + uint src = (uint)ReadByte(A[srcReg].s32); + uint dst = (uint)ReadByte(A[dstReg].s32); + uint res; + res = (uint)(dst - src - (X ? 1 : 0)); + N = ((res & 0x80) != 0); + X = C = ((res & 0x100) != 0); + V = ((((src ^ dst) & (res ^ dst)) & 0x80) != 0); + res = res & 0xff; + Z &= (res == 0); + WriteByte(A[dstReg].s32, (sbyte)res); + pendingCycles -= 18; + return; + } + case 1: + { + A[srcReg].u32 -= 2; + uint src = (uint)ReadWord(A[srcReg].s32); + A[dstReg].u32 -= 2; + uint dst = (uint)ReadWord(A[dstReg].s32); + uint res; + res = (uint)(dst - src - (X ? 1 : 0)); + N = ((res & 0x8000) != 0); + X = C = ((res & 0x10000) != 0); + V = ((((src ^ dst) & (res ^ dst)) & 0x8000) != 0); + res = res & 0xffff; + Z &= (res == 0); + WriteWord(A[dstReg].s32, (short)res); + pendingCycles -= 18; + return; + } + case 2: + { + A[srcReg].u32 -= 4; + uint src = (uint)ReadLong(A[srcReg].s32); + A[dstReg].u32 -= 4; + uint dst = (uint)ReadWord(A[dstReg].s32); + uint res; + res = (uint)(dst - src - (X ? 1 : 0)); + N = ((res & 0x80000000) != 0); + X = C = (((((src & res) | (~dst & (src | res))) >> 23) & 0x100) != 0); + V = (((((src ^ dst) & (res ^ dst)) >> 24) & 0x80) != 0); + Z &= (res == 0); + WriteLong(A[dstReg].s32, (int)res); + pendingCycles -= 30; + return; + } + } + } + + + void CMP() + { + int dReg = (op >> 9) & 7; + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte a = D[dReg].s8; + sbyte b = ReadValueB(mode, reg); + int result = a - b; + N = (result & 0x80) != 0; + Z = result == 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 4 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short a = D[dReg].s16; + short b = ReadValueW(mode, reg); + int result = a - b; + N = (result & 0x8000) != 0; + Z = result == 0; + V = result > short.MaxValue || result < short.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 4 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int a = D[dReg].s32; + int b = ReadValueL(mode, reg); + long result = (long)a - (long)b; + N = (result & 0x80000000) != 0; + Z = (uint)result == 0; + V = result > int.MaxValue || result < int.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 6 + EACyclesL[mode, reg]; + return; + } + } + } + + + void CMPA() + { + int aReg = (op >> 9) & 7; + int size = (op >> 8) & 1; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // word + { + int a = A[aReg].s32; + short b = ReadValueW(mode, reg); + long result = a - b; + N = (result & 0x80000000) != 0; + Z = result == 0; + V = result > int.MaxValue || result < int.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 6 + EACyclesBW[mode, reg]; + return; + } + case 1: // long + { + int a = A[aReg].s32; + int b = ReadValueL(mode, reg); + long result = a - b; + N = (result & 0x80000000) != 0; + Z = result == 0; + V = result > int.MaxValue || result < int.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 6 + EACyclesL[mode, reg]; + return; + } + } + } + + + void CMPM() + { + int axReg = (op >> 9) & 7; + int size = (op >> 6) & 3; + int ayReg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte a = ReadByte(A[axReg].s32); A[axReg].s32 += 1; // Does A7 stay word aligned??? + sbyte b = ReadByte(A[ayReg].s32); A[ayReg].s32 += 1; + int result = a - b; + N = (result & 0x80) != 0; + Z = (result & 0xff) == 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 12; + return; + } + case 1: // word + { + short a = ReadWord(A[axReg].s32); A[axReg].s32 += 2; + short b = ReadWord(A[ayReg].s32); A[ayReg].s32 += 2; + int result = a - b; + N = (result & 0x8000) != 0; + Z = (result & 0xffff) == 0; + V = result > short.MaxValue || result < short.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 12; + return; + } + case 2: // long + { + int a = ReadLong(A[axReg].s32); A[axReg].s32 += 4; + int b = ReadLong(A[ayReg].s32); A[ayReg].s32 += 4; + long result = a - b; + N = (result & 0x80000000) != 0; + Z = (uint)result == 0; + V = result > int.MaxValue || result < int.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + pendingCycles -= 20; + return; + } + } + } + + + void CMPI() + { + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + switch (size) + { + case 0: // byte + { + sbyte b = (sbyte)ReadOpWord(PC); PC += 2; + sbyte a = ReadValueB(mode, reg); + int result = a - b; + N = (result & 0x80) != 0; + Z = result == 0; + V = result > sbyte.MaxValue || result < sbyte.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + if (mode == 0) pendingCycles -= 8; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 1: // word + { + short b = ReadOpWord(PC); PC += 2; + short a = ReadValueW(mode, reg); + int result = a - b; + N = (result & 0x8000) != 0; + Z = result == 0; + V = result > short.MaxValue || result < short.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + if (mode == 0) pendingCycles -= 8; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + return; + } + case 2: // long + { + int b = ReadOpLong(PC); PC += 4; + int a = ReadValueL(mode, reg); + long result = a - b; + N = (result & 0x80000000) != 0; + Z = result == 0; + V = result > int.MaxValue || result < int.MinValue; + C = ((a < b) ^ ((a ^ b) >= 0) == false); + if (mode == 0) pendingCycles -= 14; + else pendingCycles -= 12 + EACyclesL[mode, reg]; + return; + } + } + } + + + void MULU() + { + int dreg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + uint result = (uint)(D[dreg].u16 * (ushort)ReadValueW(mode, reg)); + D[dreg].u32 = result; + + V = false; + C = false; + N = (result & 0x80000000) != 0; + Z = result == 0; + + pendingCycles -= 54 + EACyclesBW[mode, reg]; + } + + + void MULS() + { + int dreg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + int result = D[dreg].s16 * ReadValueW(mode, reg); + D[dreg].s32 = result; + + V = false; + C = false; + N = (result & 0x80000000) != 0; + Z = result == 0; + + pendingCycles -= 54 + EACyclesBW[mode, reg]; + } + + + void DIVU() + { + int dreg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + uint source = (ushort)ReadValueW(mode, reg); + uint dest = D[dreg].u32; + + if (source == 0) + { + TrapVector(5); + } + else + { + uint quotient = dest / source; + uint remainder = dest % source; + if (quotient < 0x10000) + { + Z = quotient == 0; + N = (quotient & 0x8000) != 0; + V = false; + C = false; + D[dreg].u32 = (quotient & 0xFFFF) | (remainder << 16); + } + else + { + V = true; + } + } + pendingCycles -= 140 + EACyclesBW[mode, reg]; + } + + + void DIVS() + { + int dreg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + int source = ReadValueW(mode, reg); + int dest = D[dreg].s32; + + if (source == 0) + { + TrapVector(5); + } + else + { + int quotient = dest / source; + int remainder = dest % source; + if (quotient == (short)quotient) + { + Z = quotient == 0; + N = (quotient & 0x8000) != 0; + V = false; + C = false; + D[dreg].s32 = (quotient & 0xFFFF) | (remainder << 16); + } + else + { + V = true; + } + } + pendingCycles -= 158 + EACyclesBW[mode, reg]; + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/IntegerMath.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/IntegerMath.cs.meta new file mode 100644 index 00000000..7e0f2068 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/IntegerMath.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f00bdfe992953ee40bfa6536dcda1148 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/ProgramFlow.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/ProgramFlow.cs new file mode 100644 index 00000000..1fce1578 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/ProgramFlow.cs @@ -0,0 +1,543 @@ +using System; + +namespace cpu.m68000 +{ + partial class MC68000 + { + bool TestCondition(int condition) + { + switch (condition) + { + case 0x00: return true; // True + case 0x01: return false; // False + case 0x02: return !C && !Z; // High (Unsigned) + case 0x03: return C || Z; // Less or Same (Unsigned) + case 0x04: return !C; // Carry Clear (High or Same) + case 0x05: return C; // Carry Set (Lower) + case 0x06: return !Z; // Not Equal + case 0x07: return Z; // Equal + case 0x08: return !V; // Overflow Clear + case 0x09: return V; // Overflow Set + case 0x0A: return !N; // Plus (Positive) + case 0x0B: return N; // Minus (Negative) + case 0x0C: return N && V || !N && !V; // Greater or Equal + case 0x0D: return N && !V || !N && V; // Less Than + case 0x0E: return N && V && !Z || !N && !V && !Z; // Greater Than + case 0x0F: return Z || N && !V || !N && V; // Less or Equal + default: + throw new Exception("Invalid condition " + condition); + } + } + + string DisassembleCondition(int condition) + { + switch (condition) + { + case 0x00: return "t"; // True + case 0x01: return "f"; // False + case 0x02: return "hi"; // High (Unsigned) + case 0x03: return "ls"; // Less or Same (Unsigned) + case 0x04: return "cc"; // Carry Clear (High or Same) + case 0x05: return "cs"; // Carry Set (Lower) + case 0x06: return "ne"; // Not Equal + case 0x07: return "eq"; // Equal + case 0x08: return "vc"; // Overflow Clear + case 0x09: return "vs"; // Overflow Set + case 0x0A: return "pl"; // Plus (Positive) + case 0x0B: return "mi"; // Minus (Negative) + case 0x0C: return "ge"; // Greater or Equal + case 0x0D: return "lt"; // Less Than + case 0x0E: return "gt"; // Greater Than + case 0x0F: return "le"; // Less or Equal + default: return "??"; // Invalid condition + } + } + + void Bcc() // Branch on condition + { + sbyte displacement8 = (sbyte)op; + int cond = (op >> 8) & 0x0F; + + if (TestCondition(cond) == true) + { + if (displacement8 != 0) + { + // use opcode-embedded displacement + PC += displacement8; + pendingCycles -= 10; + } + else + { + // use extension word displacement + PC += ReadOpWord(PC); + pendingCycles -= 10; + } + } + else + { // false + if (displacement8 != 0) + pendingCycles -= 8; + else + { + PC += 2; + pendingCycles -= 12; + } + } + } + + + void BRA() + { + sbyte displacement8 = (sbyte)op; + + if (displacement8 != 0) + PC += displacement8; + else + PC += ReadOpWord(PC); + if (PPC == PC) + { + pendingCycles = 0; + } + pendingCycles -= 10; + } + + + void BSR() + { + sbyte displacement8 = (sbyte)op; + + A[7].s32 -= 4; + if (displacement8 != 0) + { + // use embedded displacement + WriteLong(A[7].s32, PC); + PC += displacement8; + } + else + { + // use extension word displacement + WriteLong(A[7].s32, PC + 2); + PC += ReadOpWord(PC); + } + pendingCycles -= 18; + } + + + void DBcc() + { + if (TestCondition((op >> 8) & 0x0F) == true) + { + PC += 2; // condition met, break out of loop + pendingCycles -= 12; + } + else + { + int reg = op & 7; + D[reg].u16--; + + if (D[reg].u16 == 0xFFFF) + { + PC += 2; // counter underflowed, break out of loop + pendingCycles -= 14; + } + else + { + PC += ReadOpWord(PC); // condition false and counter not exhausted, so branch. + pendingCycles -= 10; + } + } + } + + + void RTS() + { + PC = ReadLong(A[7].s32); + A[7].s32 += 4; + pendingCycles -= 16; + } + + + void RTR() + { + short value = ReadWord(A[7].s32); + A[7].s32 += 2; + CCR = value; + PC = ReadLong(A[7].s32); + A[7].s32 += 4; + pendingCycles -= 20; + } + + void RESET() + { + if (S) + { + pendingCycles -= 132; + } + else + { + TrapVector2(8); + } + } + + void RTE() + { + short newSR = ReadWord(A[7].s32); + A[7].s32 += 2; + PC = ReadLong(A[7].s32); + A[7].s32 += 4; + SR = newSR; + pendingCycles -= 20; + } + + void TAS() + { + int mode = (op >> 3) & 0x07; + int reg = op & 0x07; + byte result; + //result = (byte)ReadValueB(mode, reg); + result = (byte)PeekValueB(mode, reg); + Z = (result == 0); + N = ((result & 0x80) != 0); + V = false; + C = false; + /*if (mode == 0) + { + //D[reg].u8 = (byte)(result | 0x80); + }*/ + WriteValueB(mode, reg, (sbyte)(result | 0x80)); + pendingCycles -= (mode == 0) ? 4 : 14 + EACyclesBW[mode, reg]; + } + + void TST() + { + int size = (op >> 6) & 3; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + int value; + switch (size) + { + case 0: value = ReadValueB(mode, reg); pendingCycles -= 4 + EACyclesBW[mode, reg]; N = (value & 0x80) != 0; break; + case 1: value = ReadValueW(mode, reg); pendingCycles -= 4 + EACyclesBW[mode, reg]; N = (value & 0x8000) != 0; break; + default: value = ReadValueL(mode, reg); pendingCycles -= 4 + EACyclesL[mode, reg]; N = (value & 0x80000000) != 0; break; + } + V = false; + C = false; + Z = (value == 0); + } + + void BTSTi() + { + int bit = ReadOpWord(PC); PC += 2; + int mode = (op >> 3) & 7; + int reg = op & 7; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + pendingCycles -= 10; + } + else + { + bit &= 7; + int mask = 1 << bit; + Z = (ReadValueB(mode, reg) & mask) == 0; + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + } + + void BTSTr() + { + int dReg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = op & 7; + int bit = D[dReg].s32; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + pendingCycles -= 6; + } + else + { + bit &= 7; + int mask = 1 << bit; + Z = (ReadValueB(mode, reg) & mask) == 0; + pendingCycles -= 4 + EACyclesBW[mode, reg]; + } + } + + void BCHGi() + { + int bit = ReadOpWord(PC); PC += 2; + int mode = (op >> 3) & 7; + int reg = op & 7; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + D[reg].s32 ^= mask; + pendingCycles -= 12; + } + else + { + bit &= 7; + int mask = 1 << bit; + sbyte value = PeekValueB(mode, reg); + Z = (value & mask) == 0; + value ^= (sbyte)mask; + WriteValueB(mode, reg, value); + pendingCycles -= 12 + EACyclesBW[mode, reg]; + } + } + + + void BCHGr() + { + int dReg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = op & 7; + int bit = D[dReg].s32; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + D[reg].s32 ^= mask; + pendingCycles -= 8; + } + else + { + bit &= 7; + int mask = 1 << bit; + sbyte value = PeekValueB(mode, reg); + Z = (value & mask) == 0; + value ^= (sbyte)mask; + WriteValueB(mode, reg, value); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + } + + void BCLRi() + { + int bit = ReadOpWord(PC); PC += 2; + int mode = (op >> 3) & 7; + int reg = op & 7; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + D[reg].s32 &= ~mask; + pendingCycles -= 14; + } + else + { + bit &= 7; + int mask = 1 << bit; + sbyte value = PeekValueB(mode, reg); + Z = (value & mask) == 0; + value &= (sbyte)~mask; + WriteValueB(mode, reg, value); + pendingCycles -= 12 + EACyclesBW[mode, reg]; + } + } + + void BCLRr() + { + int dReg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = op & 7; + int bit = D[dReg].s32; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + D[reg].s32 &= ~mask; + pendingCycles -= 10; + } + else + { + bit &= 7; + int mask = 1 << bit; + sbyte value = PeekValueB(mode, reg); + Z = (value & mask) == 0; + value &= (sbyte)~mask; + WriteValueB(mode, reg, value); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + } + + + void BSETi() + { + int bit = ReadOpWord(PC); PC += 2; + int mode = (op >> 3) & 7; + int reg = op & 7; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + D[reg].s32 |= mask; + pendingCycles -= 12; + } + else + { + bit &= 7; + int mask = 1 << bit; + sbyte value = PeekValueB(mode, reg); + Z = (value & mask) == 0; + value |= (sbyte)mask; + WriteValueB(mode, reg, value); + pendingCycles -= 12 + EACyclesBW[mode, reg]; + } + } + + + void BSETr() + { + int dReg = (op >> 9) & 7; + int mode = (op >> 3) & 7; + int reg = op & 7; + int bit = D[dReg].s32; + + if (mode == 0) + { + bit &= 31; + int mask = 1 << bit; + Z = (D[reg].s32 & mask) == 0; + D[reg].s32 |= mask; + pendingCycles -= 8; + } + else + { + bit &= 7; + int mask = 1 << bit; + sbyte value = PeekValueB(mode, reg); + Z = (value & mask) == 0; + value |= (sbyte)mask; + WriteValueB(mode, reg, value); + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + } + + + void JMP() + { + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + PC = ReadAddress(mode, reg); + if (PPC == PC) + { + pendingCycles = 0; + } + switch (mode) + { + case 2: pendingCycles -= 8; break; + case 5: pendingCycles -= 10; break; + case 6: pendingCycles -= 14; break; + case 7: + switch (reg) + { + case 0: pendingCycles -= 10; break; + case 1: pendingCycles -= 12; break; + case 2: pendingCycles -= 10; break; + case 3: pendingCycles -= 14; break; + } + break; + } + } + + + void JSR() + { + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + int addr = ReadAddress(mode, reg); + + A[7].s32 -= 4; + WriteLong(A[7].s32, PC); + PC = addr; + + switch (mode) + { + case 2: pendingCycles -= 16; break; + case 5: pendingCycles -= 18; break; + case 6: pendingCycles -= 22; break; + case 7: + switch (reg) + { + case 0: pendingCycles -= 18; break; + case 1: pendingCycles -= 20; break; + case 2: pendingCycles -= 18; break; + case 3: pendingCycles -= 22; break; + } + break; + } + } + + + void LINK() + { + int reg = op & 7; + A[7].s32 -= 4; + short offset = ReadOpWord(PC); PC += 2; + WriteLong(A[7].s32, A[reg].s32); + A[reg].s32 = A[7].s32; + A[7].s32 += offset; + pendingCycles -= 16; + } + + + void UNLK() + { + int reg = op & 7; + A[7].s32 = A[reg].s32; + A[reg].s32 = ReadLong(A[7].s32); + A[7].s32 += 4; + pendingCycles -= 12; + } + + + void NOP() + { + pendingCycles -= 4; + } + + + void Scc() // Set on condition + { + int cond = (op >> 8) & 0x0F; + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + if (TestCondition(cond) == true) + { + WriteValueB(mode, reg, -1); + if (mode == 0) pendingCycles -= 6; + else pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + else + { + WriteValueB(mode, reg, 0); + if (mode == 0) + pendingCycles -= 4; + else + pendingCycles -= 8 + EACyclesBW[mode, reg]; + } + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/ProgramFlow.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/ProgramFlow.cs.meta new file mode 100644 index 00000000..b32af6ee --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/ProgramFlow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2095e1daba88c5b4b935aaa55d3ed2e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/Supervisor.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/Supervisor.cs new file mode 100644 index 00000000..9c174418 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/Supervisor.cs @@ -0,0 +1,150 @@ +using System; + +namespace cpu.m68000 +{ + partial class MC68000 + { + unsafe void MOVEtSR() + { + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + if (S == false) + { + //throw new Exception("Write to SR when not in supervisor mode. supposed to trap or something..."); + TrapVector2(8); + } + else + { + SR = ReadValueW(mode, reg); + } + //pendingCycles -= 12 + EACyclesBW[mode, reg]; + fixed (int* EACyclesBW_mode = &EACyclesBW[mode,0]) + { + pendingCycles -= 12 + EACyclesBW_mode[reg]; + } + } + + //void MOVEtSR() + //{ + // int mode = (op >> 3) & 7; + // int reg = (op >> 0) & 7; + // if (S == false) + // { + // //throw new Exception("Write to SR when not in supervisor mode. supposed to trap or something..."); + // TrapVector2(8); + // } + // else + // { + // SR = ReadValueW(mode, reg); + // } + // pendingCycles -= 12 + EACyclesBW[mode, reg]; + //} + + + void MOVEfSR() + { + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + WriteValueW(mode, reg, (short)SR); + pendingCycles -= (mode == 0) ? 6 : 8 + EACyclesBW[mode, reg]; + } + + + void MOVEUSP() + { + int dir = (op >> 3) & 1; + int reg = op & 7; + if (S == false) + { + //throw new Exception("MOVE to USP when not supervisor. needs to trap"); + TrapVector2(8); + } + else + { + if (dir == 0) + { + usp = A[reg].s32; + } + else + { + A[reg].s32 = usp; + } + } + pendingCycles -= 4; + } + + + void ANDI_SR() + { + if (S == false) + throw new Exception("trap!"); + SR &= ReadOpWord(PC); PC += 2; + pendingCycles -= 20; + } + + + void EORI_SR() + { + if (S == false) + throw new Exception("trap!"); + SR ^= ReadOpWord(PC); PC += 2; + pendingCycles -= 20; + } + + + void ORI_SR() + { + if (S == false) + throw new Exception("trap!"); + SR |= ReadOpWord(PC); PC += 2; + pendingCycles -= 20; + } + + + void MOVECCR() + { + int mode = (op >> 3) & 7; + int reg = (op >> 0) & 7; + + /*ushort sr = (ushort)(SR & 0xFF00); + sr |= (byte)ReadValueB(mode, reg); + SR = (short)sr;*/ + short value = ReadValueW(mode, reg); + CCR = value; + pendingCycles -= 12 + EACyclesBW[mode, reg]; + } + + + void TRAP() + { + int vector = 32 + (op & 0x0F); + TrapVector(vector); + pendingCycles -= 4; + } + + + void TrapVector(int vector) + { + short sr = (short)SR; // capture current SR. + S = true; // switch to supervisor mode, if not already in it. + A[7].s32 -= 4; // Push PC on stack + WriteLong(A[7].s32, PC); + A[7].s32 -= 2; // Push SR on stack + WriteWord(A[7].s32, sr); + PC = ReadLong(vector * 4); // Jump to vector + pendingCycles -= CyclesException[vector]; + } + + void TrapVector2(int vector) + { + short sr = (short)SR; // capture current SR. + S = true; // switch to supervisor mode, if not already in it. + A[7].s32 -= 4; // Push PPC on stack + WriteLong(A[7].s32, PPC); + A[7].s32 -= 2; // Push SR on stack + WriteWord(A[7].s32, sr); + PC = ReadLong(vector * 4); // Jump to vector + pendingCycles -= CyclesException[vector]; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/Supervisor.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/Supervisor.cs.meta new file mode 100644 index 00000000..9a67badf --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Instructions/Supervisor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8ae0dd765643d44da568a00571a176e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/MC68000.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/MC68000.cs new file mode 100644 index 00000000..e7b98af1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/MC68000.cs @@ -0,0 +1,439 @@ +using MAME.Core; +using System; +using System.Globalization; +using System.IO; +using System.Runtime.InteropServices; + +namespace cpu.m68000 +{ + public sealed partial class MC68000 : cpuexec_data + { + public static MC68000 m1; + // Machine State + public Register[] D = new Register[8]; + public Register[] A = new Register[8]; + public int PC, PPC; + private ulong totalExecutedCycles; + private int pendingCycles; + public override ulong TotalExecutedCycles + { + get + { + return totalExecutedCycles; + } + set + { + totalExecutedCycles = value; + } + } + public override int PendingCycles + { + get + { + return pendingCycles; + } + set + { + pendingCycles = value; + } + } + + // Status Registers + public int int_cycles; + public int InterruptMaskLevel; + bool s, m; + public int usp, ssp; + public bool stopped; + + /// Machine/Interrupt mode + public bool M { get { return m; } set { m = value; } } // TODO probably have some switch logic maybe + + public void SetS(bool b1) + { + s = b1; + } + public void m68k_set_irq(int interrupt) + { + Interrupt = interrupt; + m68ki_check_interrupts(); + } + + /// Supervisor/User mode + public bool S + { + get + { + return s; + } + set + { + if (value == s) + return; + if (value == true) // entering supervisor mode + { + //EmuLogger.Log("&^&^&^&^& ENTER SUPERVISOR MODE"); + usp = A[7].s32; + A[7].s32 = ssp; + s = true; + } + else + { // exiting supervisor mode + //EmuLogger.Log("&^&^&^&^& LEAVE SUPERVISOR MODE"); + ssp = A[7].s32; + A[7].s32 = usp; + s = false; + } + } + } + + /// Extend Flag + public bool X; + /// Negative Flag + public bool N; + /// Zero Flag + public bool Z; + /// Overflow Flag + public bool V; + /// Carry Flag + public bool C; + + + + /// Status Register + public short SR + { + get + { + short value = 0; + if (C) value |= 0x0001; + if (V) value |= 0x0002; + if (Z) value |= 0x0004; + if (N) value |= 0x0008; + if (X) value |= 0x0010; + if (M) value |= 0x1000; + if (S) value |= 0x2000; + value |= (short)((InterruptMaskLevel & 7) << 8); + return value; + } + set + { + C = (value & 0x0001) != 0; + V = (value & 0x0002) != 0; + Z = (value & 0x0004) != 0; + N = (value & 0x0008) != 0; + X = (value & 0x0010) != 0; + M = (value & 0x1000) != 0; + S = (value & 0x2000) != 0; + InterruptMaskLevel = (value >> 8) & 7; + //m68ki_check_interrupts(); + } + } + public short CCR + { + get + { + short value = 0; + if (C) value |= 0x0001; + if (V) value |= 0x0002; + if (Z) value |= 0x0004; + if (N) value |= 0x0008; + if (X) value |= 0x0010; + return value; + } + set + { + C = (value & 0x0001) != 0; + V = (value & 0x0002) != 0; + Z = (value & 0x0004) != 0; + N = (value & 0x0008) != 0; + X = (value & 0x0010) != 0; + } + } + public int Interrupt;// { get; set; } + + // Memory Access + public Func ReadOpByte, ReadByte; + public Func ReadOpWord, ReadPcrelWord, ReadWord; + public Func ReadOpLong, ReadPcrelLong, ReadLong; + + public Action WriteByte; + public Action WriteWord; + public Action WriteLong; + + + public MC68000() + { + //倒是已经废弃 + //BuildOpcodeTable(); + } + + + public override void Reset() + { + Pulse_Reset(); + } + public override void set_irq_line(int irqline, LineState state) + { + if (irqline == (int)LineState.INPUT_LINE_NMI) + irqline = 7; + switch (state) + { + case LineState.CLEAR_LINE: + m68k_set_irq(0); + break; + case LineState.ASSERT_LINE: + m68k_set_irq(irqline); + break; + default: + m68k_set_irq(irqline); + break; + } + } + public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) + { + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + public void Pulse_Reset() + { + stopped = false; + pendingCycles = 0; + S = true; + M = false; + InterruptMaskLevel = 7; + Interrupt = 0; + A[7].s32 = ReadOpLong(0); + PC = ReadOpLong(4); + } + + //public Action[] Opcodes = new Action[0x10000]; + public ushort op; + + public void Step() + { + //EmuLogger.Log(Disassemble(PC)); + + op = (ushort)ReadOpWord(PC); PC += 2; + //Opcodes[op](); + DoOpCode(op); + } + + public override int ExecuteCycles(int cycles) + { + if (!stopped) + { + pendingCycles = cycles; + int ran; + pendingCycles -= int_cycles; + int_cycles = 0; + do + { + int prevCycles = pendingCycles; + PPC = PC; + op = (ushort)ReadOpWord(PC); PC += 2; + //Opcodes[op](); + DoOpCode(op); + m68ki_check_interrupts(); + int delta = prevCycles - pendingCycles; + totalExecutedCycles += (ulong)delta; + } + while (pendingCycles > 0); + pendingCycles -= int_cycles; + int_cycles = 0; + ran = cycles - pendingCycles; + return ran; + } + pendingCycles = 0; + int_cycles = 0; + return cycles; + } + public void m68ki_check_interrupts() + { + if (Interrupt > 0 && (Interrupt > InterruptMaskLevel || Interrupt > 7)) + { + stopped = false; + //int vector = Cpuint.cpu_irq_callback(cpunum, Interrupt); + short sr = (short)SR; // capture current SR. + S = true; // switch to supervisor mode, if not already in it. + A[7].s32 -= 4; // Push PC on stack + WriteLong(A[7].s32, PC); + A[7].s32 -= 2; // Push SR on stack + WriteWord(A[7].s32, sr); + PC = ReadLong((24 + Interrupt) * 4); // Jump to interrupt vector + InterruptMaskLevel = Interrupt; // Set interrupt mask to level currently being entered + Interrupt = 0; // "ack" interrupt. Note: this is wrong. + int_cycles += 0x2c; + } + } + + //public string State() + //{ + // string a = Disassemble(PC).ToString().PadRight(64); + // //string a = string.Format("{0:X6}: {1:X4}", PC, ReadWord(PC)).PadRight(64); + // string b = string.Format("D0:{0:X8} D1:{1:X8} D2:{2:X8} D3:{3:X8} D4:{4:X8} D5:{5:X8} D6:{6:X8} D7:{7:X8} ", D[0].u32, D[1].u32, D[2].u32, D[3].u32, D[4].u32, D[5].u32, D[6].u32, D[7].u32); + // string c = string.Format("A0:{0:X8} A1:{1:X8} A2:{2:X8} A3:{3:X8} A4:{4:X8} A5:{5:X8} A6:{6:X8} A7:{7:X8} ", A[0].u32, A[1].u32, A[2].u32, A[3].u32, A[4].u32, A[5].u32, A[6].u32, A[7].u32); + // string d = string.Format("SR:{0:X4} Pending {1}", SR, pendingCycles); + // return a + b + c + d; + //} + + public void SaveStateBinary(BinaryWriter writer) + { + int i; + for (i = 0; i < 0x08; i++) + { + writer.Write(MC68000.m1.D[i].u32); + } + for (i = 0; i < 0x08; i++) + { + writer.Write(MC68000.m1.A[i].u32); + } + writer.Write(MC68000.m1.PPC); + writer.Write(MC68000.m1.PC); + writer.Write(MC68000.m1.S); + writer.Write(MC68000.m1.M); + writer.Write(MC68000.m1.X); + writer.Write(MC68000.m1.N); + writer.Write(MC68000.m1.Z); + writer.Write(MC68000.m1.V); + writer.Write(MC68000.m1.C); + writer.Write(MC68000.m1.InterruptMaskLevel); + writer.Write(MC68000.m1.Interrupt); + writer.Write(MC68000.m1.int_cycles); + writer.Write(MC68000.m1.usp); + writer.Write(MC68000.m1.ssp); + writer.Write(MC68000.m1.stopped); + writer.Write(MC68000.m1.TotalExecutedCycles); + writer.Write(MC68000.m1.PendingCycles); + } + public void LoadStateBinary(BinaryReader reader) + { + int i; + for (i = 0; i < 0x08; i++) + { + MC68000.m1.D[i].u32 = reader.ReadUInt32(); + } + for (i = 0; i < 0x08; i++) + { + MC68000.m1.A[i].u32 = reader.ReadUInt32(); + } + MC68000.m1.PPC = reader.ReadInt32(); + MC68000.m1.PC = reader.ReadInt32(); + MC68000.m1.SetS(reader.ReadBoolean()); + MC68000.m1.M = reader.ReadBoolean(); + MC68000.m1.X = reader.ReadBoolean(); + MC68000.m1.N = reader.ReadBoolean(); + MC68000.m1.Z = reader.ReadBoolean(); + MC68000.m1.V = reader.ReadBoolean(); + MC68000.m1.C = reader.ReadBoolean(); + MC68000.m1.InterruptMaskLevel = reader.ReadInt32(); + MC68000.m1.Interrupt = reader.ReadInt32(); + MC68000.m1.int_cycles = reader.ReadInt32(); + MC68000.m1.usp = reader.ReadInt32(); + MC68000.m1.ssp = reader.ReadInt32(); + MC68000.m1.stopped = reader.ReadBoolean(); + MC68000.m1.TotalExecutedCycles = reader.ReadUInt64(); + MC68000.m1.PendingCycles = reader.ReadInt32(); + } + public void SaveStateText(TextWriter writer, string id) + { + writer.WriteLine("[{0}]", id); + writer.WriteLine("D0 {0:X8}", D[0].s32); + writer.WriteLine("D1 {0:X8}", D[1].s32); + writer.WriteLine("D2 {0:X8}", D[2].s32); + writer.WriteLine("D3 {0:X8}", D[3].s32); + writer.WriteLine("D4 {0:X8}", D[4].s32); + writer.WriteLine("D5 {0:X8}", D[5].s32); + writer.WriteLine("D6 {0:X8}", D[6].s32); + writer.WriteLine("D7 {0:X8}", D[7].s32); + writer.WriteLine(); + + writer.WriteLine("A0 {0:X8}", A[0].s32); + writer.WriteLine("A1 {0:X8}", A[1].s32); + writer.WriteLine("A2 {0:X8}", A[2].s32); + writer.WriteLine("A3 {0:X8}", A[3].s32); + writer.WriteLine("A4 {0:X8}", A[4].s32); + writer.WriteLine("A5 {0:X8}", A[5].s32); + writer.WriteLine("A6 {0:X8}", A[6].s32); + writer.WriteLine("A7 {0:X8}", A[7].s32); + writer.WriteLine(); + + writer.WriteLine("PC {0:X6}", PC); + writer.WriteLine("InterruptMaskLevel {0}", InterruptMaskLevel); + writer.WriteLine("USP {0:X8}", usp); + writer.WriteLine("SSP {0:X8}", ssp); + writer.WriteLine("S {0}", s); + writer.WriteLine("M {0}", m); + writer.WriteLine(); + + writer.WriteLine("TotalExecutedCycles {0}", totalExecutedCycles); + writer.WriteLine("PendingCycles {0}", pendingCycles); + + writer.WriteLine("[/{0}]", id); + } + + public void LoadStateText(TextReader reader, string id) + { + while (true) + { + string[] args = reader.ReadLine().Split(' '); + if (args[0].Trim() == "") continue; + if (args[0] == "[/" + id + "]") break; + else if (args[0] == "D0") D[0].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "D1") D[1].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "D2") D[2].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "D3") D[3].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "D4") D[4].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "D5") D[5].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "D6") D[6].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "D7") D[7].s32 = int.Parse(args[1], NumberStyles.HexNumber); + + else if (args[0] == "A0") A[0].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "A1") A[1].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "A2") A[2].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "A3") A[3].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "A4") A[4].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "A5") A[5].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "A6") A[6].s32 = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "A7") A[7].s32 = int.Parse(args[1], NumberStyles.HexNumber); + + else if (args[0] == "PC") PC = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "InterruptMaskLevel") InterruptMaskLevel = int.Parse(args[1]); + else if (args[0] == "USP") usp = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "SSP") ssp = int.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "S") s = bool.Parse(args[1]); + else if (args[0] == "M") m = bool.Parse(args[1]); + + else if (args[0] == "TotalExecutedCycles") totalExecutedCycles = ulong.Parse(args[1]); + else if (args[0] == "PendingCycles") pendingCycles = int.Parse(args[1]); + + else + { + //EmuLogger.Log("Skipping unrecognized identifier " + args[0]); + } + } + } + } + + [StructLayout(LayoutKind.Explicit)] + public struct Register + { + [FieldOffset(0)] + public uint u32; + [FieldOffset(0)] + public int s32; + + [FieldOffset(0)] + public ushort u16; + [FieldOffset(0)] + public short s16; + + [FieldOffset(0)] + public byte u8; + [FieldOffset(0)] + public sbyte s8; + + public override string ToString() + { + return String.Format("{0:X8}", u32); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/MC68000.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/MC68000.cs.meta new file mode 100644 index 00000000..42fb5a08 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/MC68000.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cde299f017f5c6c4d83cb4a8e4cfe543 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Memory.cs new file mode 100644 index 00000000..969e1dc9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Memory.cs @@ -0,0 +1,524 @@ +using System; + +namespace cpu.m68000 +{ + partial class MC68000 + { + sbyte ReadValueB(int mode, int reg) + { + sbyte value; + switch (mode) + { + case 0: // Dn + return D[reg].s8; + case 1: // An + return A[reg].s8; + case 2: // (An) + return ReadByte(A[reg].s32); + case 3: // (An)+ + value = ReadByte(A[reg].s32); + A[reg].s32 += reg == 7 ? 2 : 1; + return value; + case 4: // -(An) + A[reg].s32 -= reg == 7 ? 2 : 1; + return ReadByte(A[reg].s32); + case 5: // (d16,An) + value = ReadByte((A[reg].s32 + ReadOpWord(PC))); PC += 2; + return value; + case 6: // (d8,An,Xn) + return ReadByte(A[reg].s32 + GetIndex()); + case 7: + switch (reg) + { + case 0: // (imm).W + value = ReadByte(ReadOpWord(PC)); PC += 2; + return value; + case 1: // (imm).L + value = ReadByte(ReadOpLong(PC)); PC += 4; + return value; + case 2: // (d16,PC) + value = ReadOpByte(PC + ReadOpWord(PC)); PC += 2; + return value; + case 3: // (d8,PC,Xn) + int pc = PC; + value = ReadOpByte((pc + GetIndex())); + return value; + case 4: // immediate + value = (sbyte)ReadOpWord(PC); PC += 2; + return value; + default: + throw new Exception("Invalid addressing mode!"); + } + } + throw new Exception("Invalid addressing mode!"); + } + + short ReadValueW(int mode, int reg) + { + short value; + switch (mode) + { + case 0: // Dn + return D[reg].s16; + case 1: // An + return A[reg].s16; + case 2: // (An) + return ReadWord(A[reg].s32); + case 3: // (An)+ + value = ReadWord(A[reg].s32); + A[reg].s32 += 2; + return value; + case 4: // -(An) + A[reg].s32 -= 2; + return ReadWord(A[reg].s32); + case 5: // (d16,An) + value = ReadWord((A[reg].s32 + ReadOpWord(PC))); PC += 2; + return value; + case 6: // (d8,An,Xn) + return ReadWord(A[reg].s32 + GetIndex()); + case 7: + switch (reg) + { + case 0: // (imm).W + value = ReadWord(ReadOpWord(PC)); PC += 2; + return value; + case 1: // (imm).L + value = ReadWord(ReadOpLong(PC)); PC += 4; + return value; + case 2: // (d16,PC) + value = ReadOpWord(PC + ReadOpWord(PC)); PC += 2; + return value; + case 3: // (d8,PC,Xn) + int pc = PC; + value = ReadOpWord((pc + GetIndex())); + return value; + case 4: // immediate + value = ReadOpWord(PC); PC += 2; + return value; + default: + throw new Exception("Invalid addressing mode!"); + } + } + throw new Exception("Invalid addressing mode!"); + } + + int ReadValueL(int mode, int reg) + { + int value; + switch (mode) + { + case 0: // Dn + return D[reg].s32; + case 1: // An + return A[reg].s32; + case 2: // (An) + return ReadLong(A[reg].s32); + case 3: // (An)+ + value = ReadLong(A[reg].s32); + A[reg].s32 += 4; + return value; + case 4: // -(An) + A[reg].s32 -= 4; + return ReadLong(A[reg].s32); + case 5: // (d16,An) + value = ReadLong((A[reg].s32 + ReadOpWord(PC))); PC += 2; + return value; + case 6: // (d8,An,Xn) + return ReadLong(A[reg].s32 + GetIndex()); + case 7: + switch (reg) + { + case 0: // (imm).W + value = ReadLong(ReadOpWord(PC)); PC += 2; + return value; + case 1: // (imm).L + value = ReadLong(ReadOpLong(PC)); PC += 4; + return value; + case 2: // (d16,PC) + value = ReadOpLong(PC + ReadOpWord(PC)); PC += 2; + return value; + case 3: // (d8,PC,Xn) + int pc = PC; + value = ReadOpLong((pc + GetIndex())); + return value; + case 4: // immediate + value = ReadOpLong(PC); PC += 4; + return value; + default: + throw new Exception("Invalid addressing mode!"); + } + } + throw new Exception("Invalid addressing mode!"); + } + + sbyte PeekValueB(int mode, int reg) + { + sbyte value; + switch (mode) + { + case 0: // Dn + return D[reg].s8; + case 1: // An + return A[reg].s8; + case 2: // (An) + return ReadByte(A[reg].s32); + case 3: // (An)+ + value = ReadByte(A[reg].s32); + return value; + case 4: // -(An) + value = ReadByte(A[reg].s32 - (reg == 7 ? 2 : 1)); + return value; + case 5: // (d16,An) + value = ReadByte((A[reg].s32 + ReadOpWord(PC))); + return value; + case 6: // (d8,An,Xn) + return ReadByte(A[reg].s32 + PeekIndex()); + case 7: + switch (reg) + { + case 0: // (imm).W + value = ReadByte(ReadOpWord(PC)); + return value; + case 1: // (imm).L + value = ReadByte(ReadOpLong(PC)); + return value; + case 2: // (d16,PC) + value = ReadByte(PC + ReadOpWord(PC)); + return value; + case 3: // (d8,PC,Xn) + value = ReadByte((PC + PeekIndex())); + return value; + case 4: // immediate + return (sbyte)ReadOpWord(PC); + default: + throw new Exception("Invalid addressing mode!"); + } + } + throw new Exception("Invalid addressing mode!"); + } + + short PeekValueW(int mode, int reg) + { + short value; + switch (mode) + { + case 0: // Dn + return D[reg].s16; + case 1: // An + return A[reg].s16; + case 2: // (An) + return ReadWord(A[reg].s32); + case 3: // (An)+ + value = ReadWord(A[reg].s32); + return value; + case 4: // -(An) + value = ReadWord(A[reg].s32 - 2); + return value; + case 5: // (d16,An) + value = ReadWord((A[reg].s32 + ReadOpWord(PC))); + return value; + case 6: // (d8,An,Xn) + return ReadWord(A[reg].s32 + PeekIndex()); + case 7: + switch (reg) + { + case 0: // (imm).W + value = ReadWord(ReadOpWord(PC)); + return value; + case 1: // (imm).L + value = ReadWord(ReadOpLong(PC)); + return value; + case 2: // (d16,PC) + value = ReadWord(PC + ReadOpWord(PC)); + return value; + case 3: // (d8,PC,Xn) + value = ReadWord((PC + PeekIndex())); + return value; + case 4: // immediate + return ReadOpWord(PC); + default: + throw new Exception("Invalid addressing mode!"); + } + } + throw new Exception("Invalid addressing mode!"); + } + + int PeekValueL(int mode, int reg) + { + int value; + switch (mode) + { + case 0: // Dn + return D[reg].s32; + case 1: // An + return A[reg].s32; + case 2: // (An) + return ReadLong(A[reg].s32); + case 3: // (An)+ + value = ReadLong(A[reg].s32); + return value; + case 4: // -(An) + value = ReadLong(A[reg].s32 - 4); + return value; + case 5: // (d16,An) + value = ReadLong((A[reg].s32 + ReadOpWord(PC))); + return value; + case 6: // (d8,An,Xn) + return ReadLong(A[reg].s32 + PeekIndex()); + case 7: + switch (reg) + { + case 0: // (imm).W + value = ReadLong(ReadOpWord(PC)); + return value; + case 1: // (imm).L + value = ReadLong(ReadOpLong(PC)); + return value; + case 2: // (d16,PC) + value = ReadLong(PC + ReadOpWord(PC)); + return value; + case 3: // (d8,PC,Xn) + value = ReadLong((PC + PeekIndex())); + return value; + case 4: // immediate + return ReadOpLong(PC); + default: + throw new Exception("Invalid addressing mode!"); + } + } + throw new Exception("Invalid addressing mode!"); + } + + int ReadAddress(int mode, int reg) + { + int addr; + switch (mode) + { + case 0: throw new Exception("Invalid addressing mode!"); // Dn + case 1: throw new Exception("Invalid addressing mode!"); // An + case 2: return A[reg].s32; // (An) + case 3: return A[reg].s32; // (An)+ + case 4: return A[reg].s32; // -(An) + case 5: addr = A[reg].s32 + ReadOpWord(PC); PC += 2; return addr; // (d16,An) + case 6: return A[reg].s32 + GetIndex(); // (d8,An,Xn) + case 7: + switch (reg) + { + case 0: addr = ReadOpWord(PC); PC += 2; return addr; // (imm).w + case 1: addr = ReadOpLong(PC); PC += 4; return addr; // (imm).l + case 2: addr = PC; addr += ReadOpWord(PC); PC += 2; return addr; // (d16,PC) + case 3: addr = PC; addr += GetIndex(); return addr; // (d8,PC,Xn) + case 4: throw new Exception("Invalid addressing mode!"); // immediate + } + break; + } + throw new Exception("Invalid addressing mode!"); + } + + + void WriteValueB(int mode, int reg, sbyte value) + { + switch (mode) + { + case 0x00: // Dn + D[reg].s8 = value; + return; + case 0x01: // An + A[reg].s32 = value; + return; + case 0x02: // (An) + WriteByte(A[reg].s32, value); + return; + case 0x03: // (An)+ + WriteByte(A[reg].s32, value); + A[reg].s32 += reg == 7 ? 2 : 1; + return; + case 0x04: // -(An) + A[reg].s32 -= reg == 7 ? 2 : 1; + WriteByte(A[reg].s32, value); + return; + case 0x05: // (d16,An) + WriteByte(A[reg].s32 + ReadOpWord(PC), value); PC += 2; + return; + case 0x06: // (d8,An,Xn) + WriteByte(A[reg].s32 + GetIndex(), value); + return; + case 0x07: + switch (reg) + { + case 0x00: // (imm).W + WriteByte(ReadOpWord(PC), value); PC += 2; + return; + case 0x01: // (imm).L + WriteByte(ReadOpLong(PC), value); PC += 4; + return; + case 0x02: // (d16,PC) + WriteByte(PC + ReadOpWord(PC), value); PC += 2; + return; + case 0x03: // (d8,PC,Xn) + int pc = PC; + WriteByte(pc + PeekIndex(), value); + PC += 2; + return; + default: throw new Exception("Invalid addressing mode!"); + } + } + } + + void WriteValueW(int mode, int reg, short value) + { + switch (mode) + { + case 0x00: // Dn + D[reg].s16 = value; + return; + case 0x01: // An + A[reg].s32 = value; + return; + case 0x02: // (An) + WriteWord(A[reg].s32, value); + return; + case 0x03: // (An)+ + WriteWord(A[reg].s32, value); + A[reg].s32 += 2; + return; + case 0x04: // -(An) + A[reg].s32 -= 2; + WriteWord(A[reg].s32, value); + return; + case 0x05: // (d16,An) + WriteWord(A[reg].s32 + ReadOpWord(PC), value); PC += 2; + return; + case 0x06: // (d8,An,Xn) + WriteWord(A[reg].s32 + GetIndex(), value); + return; + case 0x07: + switch (reg) + { + case 0x00: // (imm).W + WriteWord(ReadOpWord(PC), value); PC += 2; + return; + case 0x01: // (imm).L + WriteWord(ReadOpLong(PC), value); PC += 4; + return; + case 0x02: // (d16,PC) + WriteWord(PC + ReadOpWord(PC), value); PC += 2; + return; + case 0x03: // (d8,PC,Xn) + int pc = PC; + WriteWord(pc + PeekIndex(), value); + PC += 2; + return; + default: throw new Exception("Invalid addressing mode!"); + } + } + } + + void WriteValueL(int mode, int reg, int value) + { + switch (mode) + { + case 0x00: // Dn + D[reg].s32 = value; + return; + case 0x01: // An + A[reg].s32 = value; + return; + case 0x02: // (An) + WriteLong(A[reg].s32, value); + return; + case 0x03: // (An)+ + WriteLong(A[reg].s32, value); + A[reg].s32 += 4; + return; + case 0x04: // -(An) + A[reg].s32 -= 4; + WriteLong(A[reg].s32, value); + return; + case 0x05: // (d16,An) + WriteLong(A[reg].s32 + ReadOpWord(PC), value); PC += 2; + return; + case 0x06: // (d8,An,Xn) + WriteLong(A[reg].s32 + GetIndex(), value); + return; + case 0x07: + switch (reg) + { + case 0x00: // (imm).W + WriteLong(ReadOpWord(PC), value); PC += 2; + return; + case 0x01: // (imm).L + WriteLong(ReadOpLong(PC), value); PC += 4; + return; + case 0x02: // (d16,PC) + WriteLong(PC + ReadOpWord(PC), value); PC += 2; + return; + case 0x03: // (d8,PC,Xn) + int pc = PC; + WriteLong(pc + PeekIndex(), value); + PC += 2; + return; + default: throw new Exception("Invalid addressing mode!"); + } + } + } + + int GetIndex() + { + //EmuLogger.Log("IN INDEX PORTION - NOT VERIFIED!!!"); + // TODO kid chameleon triggers this in startup sequence + + short extension = ReadOpWord(PC); PC += 2; + + int da = (extension >> 15) & 0x1; + int reg = (extension >> 12) & 0x7; + int size = (extension >> 11) & 0x1; + int scale = (extension >> 9) & 0x3; + sbyte displacement = (sbyte)extension; + + int indexReg; + switch (scale) + { + case 0: indexReg = 1; break; + case 1: indexReg = 2; break; + case 2: indexReg = 4; break; + default: indexReg = 8; break; + } + if (da == 0) + indexReg *= size == 0 ? D[reg].s16 : D[reg].s32; + else + indexReg *= size == 0 ? A[reg].s16 : A[reg].s32; + + return displacement + indexReg; + } + + int PeekIndex() + { + //EmuLogger.Log("IN INDEX PORTION - NOT VERIFIED!!!"); + + short extension = ReadOpWord(PC); + + int da = (extension >> 15) & 0x1; + int reg = (extension >> 12) & 0x7; + int size = (extension >> 11) & 0x1; + int scale = (extension >> 9) & 0x3; + sbyte displacement = (sbyte)extension; + + int indexReg; + switch (scale) + { + case 0: indexReg = 1; break; + case 1: indexReg = 2; break; + case 2: indexReg = 4; break; + default: indexReg = 8; break; + } + if (da == 0) + indexReg *= size == 0 ? D[reg].s16 : D[reg].s32; + else + indexReg *= size == 0 ? A[reg].s16 : A[reg].s32; + + return displacement + indexReg; + } + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Memory.cs.meta new file mode 100644 index 00000000..fb5cda5c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ca60a438b9bb004189843e1d4dad73c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Do.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Do.cs new file mode 100644 index 00000000..81ba1202 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Do.cs @@ -0,0 +1,126 @@ +namespace cpu.m68000 +{ + partial class MC68000 + { + + /// + /// 重写的68000指令调度 + /// + /// + void DoOpCode(ushort op) + { + MC68000Code opType = MC68000CodeArr[op]; + switch (opType) + { + case MC68000Code.ORI: ORI(); return; + case MC68000Code.ILL: ILL(); return; + case MC68000Code.ORI_CCR: ORI_CCR(); return; + case MC68000Code.ORI_SR: ORI_SR(); return; + case MC68000Code.BTSTr: BTSTr(); return; + case MC68000Code.MOVEP: MOVEP(); return; + case MC68000Code.BCHGr: BCHGr(); return; + case MC68000Code.BCLRr: BCLRr(); return; + case MC68000Code.BSETr: BSETr(); return; + case MC68000Code.ANDI: ANDI(); return; + case MC68000Code.ANDI_CCR: ANDI_CCR(); return; + case MC68000Code.ANDI_SR: ANDI_SR(); return; + case MC68000Code.SUBI: SUBI(); return; + case MC68000Code.ADDI: ADDI(); return; + case MC68000Code.BTSTi: BTSTi(); return; + case MC68000Code.BCHGi: BCHGi(); return; + case MC68000Code.BCLRi: BCLRi(); return; + case MC68000Code.BSETi: BSETi(); return; + case MC68000Code.EORI: EORI(); return; + case MC68000Code.EORI_CCR: EORI_CCR(); return; + case MC68000Code.EORI_SR: EORI_SR(); return; + case MC68000Code.CMPI: CMPI(); return; + case MC68000Code.MOVE: MOVE(); return; + case MC68000Code.MOVEA: MOVEA(); return; + case MC68000Code.NEGX: NEGX(); return; + case MC68000Code.MOVEfSR: MOVEfSR(); return; + case MC68000Code.CHK: CHK(); return; + case MC68000Code.LEA: LEA(); return; + case MC68000Code.CLR: CLR(); return; + case MC68000Code.NEG: NEG(); return; + case MC68000Code.MOVECCR: MOVECCR(); return; + case MC68000Code.NOT: NOT(); return; + case MC68000Code.MOVEtSR: MOVEtSR(); return; + case MC68000Code.NBCD: NBCD(); return; + case MC68000Code.SWAP: SWAP(); return; + case MC68000Code.PEA: PEA(); return; + case MC68000Code.EXT: EXT(); return; + case MC68000Code.MOVEM0: MOVEM0(); return; + case MC68000Code.TST: TST(); return; + case MC68000Code.TAS: TAS(); return; + case MC68000Code.ILLEGAL: ILLEGAL(); return; + case MC68000Code.MOVEM1: MOVEM1(); return; + case MC68000Code.TRAP: TRAP(); return; + case MC68000Code.LINK: LINK(); return; + case MC68000Code.UNLK: UNLK(); return; + case MC68000Code.MOVEUSP: MOVEUSP(); return; + case MC68000Code.RESET: RESET(); return; + case MC68000Code.NOP: NOP(); return; + case MC68000Code.STOP: STOP(); return; + case MC68000Code.RTE: RTE(); return; + case MC68000Code.RTS: RTS(); return; + case MC68000Code.TRAPV: TRAPV(); return; + case MC68000Code.RTR: RTR(); return; + case MC68000Code.JSR: JSR(); return; + case MC68000Code.JMP: JMP(); return; + case MC68000Code.ADDQ: ADDQ(); return; + case MC68000Code.Scc: Scc(); return; + case MC68000Code.DBcc: DBcc(); return; + case MC68000Code.SUBQ: SUBQ(); return; + case MC68000Code.BRA: BRA(); return; + case MC68000Code.BSR: BSR(); return; + case MC68000Code.Bcc: Bcc(); return; + case MC68000Code.MOVEQ: MOVEQ(); return; + case MC68000Code.OR0: OR0(); return; + case MC68000Code.DIVU: DIVU(); return; + case MC68000Code.SBCD0: SBCD0(); return; + case MC68000Code.SBCD1: SBCD1(); return; + case MC68000Code.OR1: OR1(); return; + case MC68000Code.DIVS: DIVS(); return; + case MC68000Code.SUB0: SUB0(); return; + case MC68000Code.SUBA: SUBA(); return; + case MC68000Code.SUBX0: SUBX0(); return; + case MC68000Code.SUBX1: SUBX1(); return; + case MC68000Code.SUB1: SUB1(); return; + case MC68000Code.CMP: CMP(); return; + case MC68000Code.CMPA: CMPA(); return; + case MC68000Code.EOR: EOR(); return; + case MC68000Code.CMPM: CMPM(); return; + case MC68000Code.AND0: AND0(); return; + case MC68000Code.MULU: MULU(); return; + case MC68000Code.ABCD0: ABCD0(); return; + case MC68000Code.ABCD1: ABCD1(); return; + case MC68000Code.AND1: AND1(); return; + case MC68000Code.EXGdd: EXGdd(); return; + case MC68000Code.EXGaa: EXGaa(); return; + case MC68000Code.EXGda: EXGda(); return; + case MC68000Code.MULS: MULS(); return; + case MC68000Code.ADD0: ADD0(); return; + case MC68000Code.ADDA: ADDA(); return; + case MC68000Code.ADDX0: ADDX0(); return; + case MC68000Code.ADDX1: ADDX1(); return; + case MC68000Code.ADD1: ADD1(); return; + case MC68000Code.ASRd: ASRd(); return; + case MC68000Code.LSRd: LSRd(); return; + case MC68000Code.ROXRd: ROXRd(); return; + case MC68000Code.RORd: RORd(); return; + case MC68000Code.ASRd0: ASRd0(); return; + case MC68000Code.ASLd: ASLd(); return; + case MC68000Code.LSLd: LSLd(); return; + case MC68000Code.ROXLd: ROXLd(); return; + case MC68000Code.ROLd: ROLd(); return; + case MC68000Code.ASLd0: ASLd0(); return; + case MC68000Code.LSRd0: LSRd0(); return; + case MC68000Code.LSLd0: LSLd0(); return; + case MC68000Code.ROXRd0: ROXRd0(); return; + case MC68000Code.ROXLd0: ROXLd0(); return; + case MC68000Code.RORd0: RORd0(); return; + case MC68000Code.ROLd0: ROLd0(); return; + } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Do.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Do.cs.meta new file mode 100644 index 00000000..4d7d9add --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Do.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6be477f2e8966cf4c8eb308e23568bbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Enum.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Enum.cs new file mode 100644 index 00000000..54b8ca21 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Enum.cs @@ -0,0 +1,19 @@ +using System.Runtime.InteropServices; + +namespace cpu.m68000 +{ + partial class MC68000 + { + /// + /// 自定义68000指令集枚举 + /// + public enum MC68000Code : byte + { + ORI, ILL, ORI_CCR, ORI_SR, BTSTr, MOVEP, BCHGr, BCLRr, BSETr, ANDI, ANDI_CCR, ANDI_SR, SUBI, ADDI, BTSTi, BCHGi, BCLRi, BSETi, EORI, EORI_CCR, EORI_SR, CMPI, MOVE, MOVEA, NEGX, MOVEfSR, CHK, LEA, CLR, NEG, MOVECCR, NOT, MOVEtSR, NBCD, SWAP, PEA, EXT, MOVEM0, TST, TAS, ILLEGAL, MOVEM1, TRAP, LINK, UNLK, MOVEUSP, RESET, NOP, STOP, RTE, RTS, TRAPV, RTR, JSR, JMP, ADDQ, Scc, DBcc, SUBQ, BRA, BSR, Bcc, MOVEQ, OR0, DIVU, SBCD0, SBCD1, OR1, DIVS, SUB0, SUBA, SUBX0, SUBX1, SUB1, CMP, CMPA, EOR, CMPM, AND0, MULU, ABCD0, ABCD1, AND1, EXGdd, EXGaa, EXGda, MULS, ADD0, ADDA, ADDX0, ADDX1, ADD1, ASRd, LSRd, ROXRd, RORd, ASRd0, ASLd, LSLd, ROXLd, ROLd, ASLd0, LSRd0, LSLd0, ROXRd0, ROXLd0, RORd0, ROLd0 + } + + static readonly MC68000Code[] MC68000CodeArr = new MC68000Code[] + { MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ORI_CCR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ORI_SR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI_CCR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI_SR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ANDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.SUBI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ADDI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.BTSTi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.BCHGi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.BCLRi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.BSETi,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI_CCR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI_SR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.EORI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.CMPI,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.BTSTr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.BCHGr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.BCLRr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.MOVEP,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.BSETr,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.MOVEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.MOVE,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.NEGX,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.MOVEfSR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.CLR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.NEG,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.MOVECCR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.NOT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.MOVEtSR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.NBCD,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SWAP,MC68000Code.SWAP,MC68000Code.SWAP,MC68000Code.SWAP,MC68000Code.SWAP,MC68000Code.SWAP,MC68000Code.SWAP,MC68000Code.SWAP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.PEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.EXT,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.MOVEM0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.TST,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.TAS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILLEGAL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.MOVEM1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.TRAP,MC68000Code.LINK,MC68000Code.LINK,MC68000Code.LINK,MC68000Code.LINK,MC68000Code.LINK,MC68000Code.LINK,MC68000Code.LINK,MC68000Code.LINK,MC68000Code.UNLK,MC68000Code.UNLK,MC68000Code.UNLK,MC68000Code.UNLK,MC68000Code.UNLK,MC68000Code.UNLK,MC68000Code.UNLK,MC68000Code.UNLK,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.MOVEUSP,MC68000Code.RESET,MC68000Code.NOP,MC68000Code.STOP,MC68000Code.RTE,MC68000Code.ILL,MC68000Code.RTS,MC68000Code.TRAPV,MC68000Code.RTR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.JSR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.JMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.CHK,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.LEA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ADDQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.SUBQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.DBcc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.Scc,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BRA,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.BSR,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.Bcc,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.MOVEQ,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.OR0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.DIVU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD0,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.SBCD1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.OR1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.DIVS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.SUB0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX0,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUBX1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.SUB1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.SUBA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.CMP,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.CMPM,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.EOR,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.CMPA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.AND0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.MULU,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD0,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.ABCD1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGdd,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.EXGaa,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.EXGda,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.AND1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.MULS,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ADD0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX0,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADDX1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ADD1,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ADDA,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ASRd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ASLd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.LSRd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.LSLd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ROXRd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ROXLd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.RORd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ROLd0,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.ASRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.LSRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.ROXRd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.RORd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.ASLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.LSLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROXLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ROLd,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL,MC68000Code.ILL}; + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Enum.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Enum.cs.meta new file mode 100644 index 00000000..34406fc0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/OpcodeTable.OpCode.Enum.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb52db132edb72746a600471b199d49b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Tables.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Tables.cs new file mode 100644 index 00000000..eb82a8a6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Tables.cs @@ -0,0 +1,70 @@ +namespace cpu.m68000 +{ + partial class MC68000 + { + static readonly int[,] MoveCyclesBW = new int[12, 9] + { + { 4, 4, 8, 8, 8, 12, 14, 12, 16 }, + { 4, 4, 8, 8, 8, 12, 14, 12, 16 }, + { 8, 8, 12, 12, 12, 16, 18, 16, 20 }, + { 8, 8, 12, 12, 12, 16, 18, 16, 20 }, + { 10, 10, 14, 14, 14, 18, 20, 18, 22 }, + { 12, 12, 16, 16, 16, 20, 22, 20, 24 }, + { 14, 14, 18, 18, 18, 22, 24, 22, 26 }, + { 12, 12, 16, 16, 16, 20, 22, 20, 24 }, + { 16, 16, 20, 20, 20, 24, 26, 24, 28 }, + { 12, 12, 16, 16, 16, 20, 22, 20, 24 }, + { 14, 14, 18, 18, 18, 22, 24, 22, 26 }, + { 8, 8, 12, 12, 12, 16, 18, 16, 20 } + }; + + static readonly int[,] MoveCyclesL = new int[12, 9] + { + { 4, 4, 12, 12, 12, 16, 18, 16, 20 }, + { 4, 4, 12, 12, 12, 16, 18, 16, 20 }, + { 12, 12, 20, 20, 20, 24, 26, 24, 28 }, + { 12, 12, 20, 20, 20, 24, 26, 24, 28 }, + { 14, 14, 22, 22, 22, 26, 28, 26, 30 }, + { 16, 16, 24, 24, 24, 28, 30, 28, 32 }, + { 18, 18, 26, 26, 26, 30, 32, 30, 34 }, + { 16, 16, 24, 24, 24, 28, 30, 28, 32 }, + { 20, 20, 28, 28, 28, 32, 34, 32, 36 }, + { 16, 16, 24, 24, 24, 28, 30, 28, 32 }, + { 18, 18, 26, 26, 26, 30, 32, 30, 34 }, + { 12, 12, 20, 20, 20, 24, 26, 24, 28 } + }; + + static readonly int[,] EACyclesBW = new int[8, 8] + { + { 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0 }, + { 4, 4, 4, 4, 4, 4, 4, 4 }, + { 4, 4, 4, 4, 4, 4, 4, 4 }, + { 6, 6, 6, 6, 6, 6, 6, 6 }, + { 8, 8, 8, 8, 8, 8, 8, 8 }, + { 10, 10, 10, 10, 10, 10, 10, 10 }, + { 8, 12, 8, 10, 4, 99, 99, 99 } + }; + + static readonly int[,] EACyclesL = new int[8, 8] + { + { 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0 }, + { 8, 8, 8, 8, 8, 8, 8, 8 }, + { 8, 8, 8, 8, 8, 8, 8, 8 }, + { 10, 10, 10, 10, 10, 10, 10, 10 }, + { 12, 12, 12, 12, 12, 12, 12, 12 }, + { 14, 14, 14, 14, 14, 14, 14, 14 }, + { 12, 16, 12, 14, 8, 99, 99, 99 } + }; + static readonly int[] CyclesException = new int[0x30] + { + 0x04, 0x04, 0x32, 0x32, 0x22, 0x26, 0x28, 0x22, + 0x22, 0x22, 0x04, 0x04, 0x04, 0x04, 0x04, 0x2C, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 + }; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Tables.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Tables.cs.meta new file mode 100644 index 00000000..3b4ae6b4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m68000/Tables.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd115883ec0396d42abef36787464a37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805.meta new file mode 100644 index 00000000..e37452ce --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1cec51d80caf2184681dc0898d9dec38 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805.cs new file mode 100644 index 00000000..a8808992 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805.cs @@ -0,0 +1,910 @@ +using MAME.Core; +using System; +using System.IO; + +namespace cpu.m6805 +{ + public partial class M6805 : cpuexec_data + { + public static M6805 m1; + public Register ea, pc, s; + public int subtype; + public ushort sp_mask; + public ushort sp_low; + public byte a, x, cc; + public ushort pending_interrupts; + public delegate int irq_delegate(int i); + public irq_delegate irq_callback; + public int[] irq_state; + public int nmi_state; + public byte CFLAG = 0x01, ZFLAG = 0x02, NFLAG = 0x04, IFLAG = 0x08, HFLAG = 0x10; + public int SUBTYPE_M6805 = 0, SUBTYPE_M68705 = 1, SUBTYPE_HD63705 = 2; + public byte[] flags8i = new byte[256] /* increment */ + { + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04 + }; + public byte[] flags8d = new byte[256] /* decrement */ + { + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04 + }; + public byte[] cycles1 = new byte[] + { + /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + /*0*/ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + /*1*/ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /*2*/ 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + /*3*/ 6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 6, 0, 6, 6, 0, + /*4*/ 4, 0, 0, 4, 4, 0, 4, 4, 4, 4, 4, 0, 4, 4, 0, 4, + /*5*/ 4, 0, 0, 4, 4, 0, 4, 4, 4, 4, 4, 0, 4, 4, 0, 4, + /*6*/ 7, 0, 0, 7, 7, 0, 7, 7, 7, 7, 7, 0, 7, 7, 0, 7, + /*7*/ 6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 0, 6, 6, 0, 6, + /*8*/ 9, 6, 0,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*9*/ 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, + /*A*/ 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 8, 2, 0, + /*B*/ 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 3, 7, 4, 5, + /*C*/ 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 4, 8, 5, 6, + /*D*/ 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 5, 9, 6, 7, + /*E*/ 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 4, 8, 5, 6, + /*F*/ 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 3, 7, 4, 5 + }; + private ulong totalExecutedCycles; + private int pendingCycles; + public override ulong TotalExecutedCycles + { + get + { + return totalExecutedCycles; + } + set + { + totalExecutedCycles = value; + } + } + public override int PendingCycles + { + get + { + return pendingCycles; + } + set + { + pendingCycles = value; + } + } + public Func ReadOp, ReadOpArg; + public Func ReadMemory; + public Action WriteMemory; + + public M6805() + { + irq_state = new int[9]; + m6805_init(Cpuint.cpu_3_irq_callback); + } + public override void Reset() + { + m6805_reset(); + } + private void SP_INC() + { + if (++s.LowWord > sp_mask) + { + s.LowWord = sp_low; + } + } + private void SP_DEC() + { + if (--s.LowWord < sp_low) + { + s.LowWord = sp_mask; + } + } + private ushort SP_ADJUST(ushort a) + { + return (ushort)(((a) & sp_mask) | sp_low); + } + private void IMMBYTE(ref byte b) + { + b = ReadOpArg(pc.LowWord++); + } + private void IMMWORD(ref Register w) + { + w.d = 0; + w.HighByte = ReadOpArg(pc.LowWord); + w.LowByte = ReadOpArg((ushort)(pc.LowWord + 1)); + pc.LowWord += 2; + } + private void PUSHBYTE(ref byte b) + { + wr_s_handler_b(ref b); + } + private void PUSHWORD(ref Register w) + { + wr_s_handler_w(ref w); + } + private void PULLBYTE(ref byte b) + { + rd_s_handler_b(ref b); + } + private void PULLWORD(ref Register w) + { + rd_s_handler_w(ref w); + } + private void CLR_NZ() + { + cc &= (byte)~(NFLAG | ZFLAG); + } + private void CLR_HNZC() + { + cc &= (byte)~(HFLAG | NFLAG | ZFLAG | CFLAG); + } + private void CLR_Z() + { + cc &= (byte)~(ZFLAG); + } + private void CLR_NZC() + { + cc &= (byte)~(NFLAG | ZFLAG | CFLAG); + } + private void CLR_ZC() + { + cc &= (byte)~(ZFLAG | CFLAG); + } + private void SET_Z(byte b) + { + if (b == 0) + { + SEZ(); + } + } + private void SET_Z8(byte b) + { + SET_Z((byte)b); + } + private void SET_N8(byte b) + { + cc |= (byte)((b & 0x80) >> 5); + } + private void SET_H(byte a, byte b, byte r) + { + cc |= (byte)((a ^ b ^ r) & 0x10); + } + private void SET_C8(ushort b) + { + cc |= (byte)((b & 0x100) >> 8); + } + private void SET_FLAGS8I(byte b) + { + cc |= flags8i[b & 0xff]; + } + private void SET_FLAGS8D(byte b) + { + cc |= flags8d[b & 0xff]; + } + private void SET_NZ8(byte b) + { + SET_N8(b); + SET_Z(b); + } + private void SET_FLAGS8(byte a, byte b, ushort r) + { + SET_N8((byte)r); + SET_Z8((byte)r); + SET_C8(r); + } + private short SIGNED(byte b) + { + return (short)((b & 0x80) != 0 ? b | 0xff00 : b); + } + private void DIRECT() + { + ea.d = 0; + IMMBYTE(ref ea.LowByte); + } + private void IMM8() + { + ea.LowWord = pc.LowWord++; + } + private void EXTENDED() + { + IMMWORD(ref ea); + } + private void INDEXED() + { + ea.LowWord = x; + } + private void INDEXED1() + { + ea.d = 0; + IMMBYTE(ref ea.LowByte); + ea.LowWord += x; + } + private void INDEXED2() + { + IMMWORD(ref ea); + ea.LowWord += x; + } + private void SEC() + { + cc |= CFLAG; + } + private void CLC() + { + cc &= (byte)~CFLAG; + } + private void SEZ() + { + cc |= ZFLAG; + } + private void CLZ() + { + cc &= (byte)~ZFLAG; + } + private void SEN() + { + cc |= NFLAG; + } + private void CLN() + { + cc &= (byte)~NFLAG; + } + private void SEH() + { + cc |= HFLAG; + } + private void CLH() + { + cc &= (byte)~HFLAG; + } + private void SEI() + { + cc |= IFLAG; + } + private void CLI() + { + cc &= (byte)~IFLAG; + } + private void DIRBYTE(ref byte b) + { + DIRECT(); + b = ReadMemory((ushort)ea.d); + } + private void EXTBYTE(ref byte b) + { + EXTENDED(); + b = ReadMemory((ushort)ea.d); + } + private void IDXBYTE(ref byte b) + { + INDEXED(); + b = ReadMemory((ushort)ea.d); + } + private void IDX1BYTE(ref byte b) + { + INDEXED1(); + b = ReadMemory((ushort)ea.d); + } + private void IDX2BYTE(ref byte b) + { + INDEXED2(); + b = ReadMemory((ushort)ea.d); + } + private void BRANCH(bool f) + { + byte t = 0; + IMMBYTE(ref t); + if (f) + { + pc.LowWord += (ushort)SIGNED(t); + //change_pc(PC); + if (t == 0xfe) + { + if (pendingCycles > 0) + { + pendingCycles = 0; + } + } + } + } + private void CLEAR_PAIR(ref Register p) + { + p.d = 0; + } + private void rd_s_handler_b(ref byte b) + { + SP_INC(); + b = ReadMemory(s.LowWord); + } + private void rd_s_handler_w(ref Register p) + { + CLEAR_PAIR(ref p); + SP_INC(); + p.HighByte = ReadMemory(s.LowWord); + SP_INC(); + p.LowByte = ReadMemory(s.LowWord); + } + private void wr_s_handler_b(ref byte b) + { + WriteMemory(s.LowWord, b); + SP_DEC(); + } + private void wr_s_handler_w(ref Register p) + { + WriteMemory(s.LowWord, p.LowByte); + SP_DEC(); + WriteMemory(s.LowWord, p.HighByte); + SP_DEC(); + } + protected void RM16(uint Addr, ref Register p) + { + CLEAR_PAIR(ref p); + p.HighByte = ReadMemory((ushort)Addr); + ++Addr; + p.LowByte = ReadMemory((ushort)Addr); + } + private void m68705_Interrupt() + { + if ((pending_interrupts & ((1 << 0) | 0x03)) != 0) + { + if ((cc & IFLAG) == 0) + { + PUSHWORD(ref pc); + PUSHBYTE(ref x); + PUSHBYTE(ref a); + PUSHBYTE(ref cc); + SEI(); + if (irq_callback != null) + { + irq_callback(0); + } + if ((pending_interrupts & (1 << 0)) != 0) + { + pending_interrupts &= unchecked((ushort)(~(1 << 0))); + RM16(0xfffa, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x01)) != 0) + { + pending_interrupts &= unchecked((ushort)(~(1 << 0x01))); + RM16(0xfff8, ref pc); + //change_pc(PC); + } + } + pendingCycles -= 11; + } + } + private void Interrupt() + { + if ((pending_interrupts & (1 << 0x08)) != 0) + { + PUSHWORD(ref pc); + PUSHBYTE(ref x); + PUSHBYTE(ref a); + PUSHBYTE(ref cc); + SEI(); + if (irq_callback != null) + { + irq_callback(0); + } + RM16(0x1ffc, ref pc); + //change_pc(PC); + pending_interrupts &= unchecked((ushort)(~(1 << 0x08))); + pendingCycles -= 11; + } + else if ((pending_interrupts & ((1 << 0) | 0x1ff)) != 0) + { + if ((cc & IFLAG) == 0) + { + { + PUSHWORD(ref pc); + PUSHBYTE(ref x); + PUSHBYTE(ref a); + PUSHBYTE(ref cc); + SEI(); + if (irq_callback != null) + { + irq_callback(0); + } + if (subtype == SUBTYPE_HD63705) + { + if ((pending_interrupts & (1 << 0x00)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x00)); + RM16(0x1ff8, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x01)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x01)); + RM16(0x1fec, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x07)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x07)); + RM16(0x1fea, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x02)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x02)); + RM16(0x1ff6, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x03)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x03)); + RM16(0x1ff4, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x04)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x04)); + RM16(0x1ff2, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x05)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x05)); + RM16(0x1ff0, ref pc); + //change_pc(PC); + } + else if ((pending_interrupts & (1 << 0x06)) != 0) + { + pending_interrupts &= unchecked((ushort)~(1 << 0x06)); + RM16(0x1fee, ref pc); + //change_pc(PC); + } + } + else + { + RM16(0xffff - 5, ref pc); + //change_pc(PC); + } + + } // CC & IFLAG + pending_interrupts &= unchecked((ushort)~(1 << 0)); + } + pendingCycles -= 11; + } + } + private void m6805_init(irq_delegate irqcallback) + { + irq_callback = irqcallback; + } + protected void m6805_reset() + { + /*int (*save_irqcallback)(int) = m6805.irq_callback; + memset(&m6805, 0, sizeof(m6805)); + m6805.irq_callback = save_irqcallback;*/ + int i; + ea.d = 0; + pc.d = 0; + s.d = 0; + a = 0; + x = 0; + cc = 0; + pending_interrupts = 0; + for (i = 0; i < 9; i++) + { + irq_state[i] = 0; + } + nmi_state = 0; + subtype = SUBTYPE_M6805; + sp_mask = 0x07f; + sp_low = 0x060; + s.LowWord = sp_mask; + SEI(); + RM16(0xfffe, ref pc); + } + public override void set_irq_line(int irqline, LineState state) + { + if (irq_state[0] == (int)state) + { + return; + } + irq_state[0] = (int)state; + if (state != (int)LineState.CLEAR_LINE) + { + pending_interrupts |= 1 << 0; + } + } + public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) + { + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + public override int ExecuteCycles(int cycles) + { + return m6805_execute(cycles); + } + public int m6805_execute(int cycles) + { + byte ireg; + pendingCycles = cycles; + do + { + int prevCycles = pendingCycles; + if (pending_interrupts != 0) + { + if (subtype == SUBTYPE_M68705) + { + m68705_Interrupt(); + } + else + { + Interrupt(); + } + } + ireg = ReadOp(pc.LowWord++); + switch (ireg) + { + case 0x00: brset(0x01); break; + case 0x01: brclr(0x01); break; + case 0x02: brset(0x02); break; + case 0x03: brclr(0x02); break; + case 0x04: brset(0x04); break; + case 0x05: brclr(0x04); break; + case 0x06: brset(0x08); break; + case 0x07: brclr(0x08); break; + case 0x08: brset(0x10); break; + case 0x09: brclr(0x10); break; + case 0x0A: brset(0x20); break; + case 0x0B: brclr(0x20); break; + case 0x0C: brset(0x40); break; + case 0x0D: brclr(0x40); break; + case 0x0E: brset(0x80); break; + case 0x0F: brclr(0x80); break; + case 0x10: bset(0x01); break; + case 0x11: bclr(0x01); break; + case 0x12: bset(0x02); break; + case 0x13: bclr(0x02); break; + case 0x14: bset(0x04); break; + case 0x15: bclr(0x04); break; + case 0x16: bset(0x08); break; + case 0x17: bclr(0x08); break; + case 0x18: bset(0x10); break; + case 0x19: bclr(0x10); break; + case 0x1a: bset(0x20); break; + case 0x1b: bclr(0x20); break; + case 0x1c: bset(0x40); break; + case 0x1d: bclr(0x40); break; + case 0x1e: bset(0x80); break; + case 0x1f: bclr(0x80); break; + case 0x20: bra(); break; + case 0x21: brn(); break; + case 0x22: bhi(); break; + case 0x23: bls(); break; + case 0x24: bcc(); break; + case 0x25: bcs(); break; + case 0x26: bne(); break; + case 0x27: beq(); break; + case 0x28: bhcc(); break; + case 0x29: bhcs(); break; + case 0x2a: bpl(); break; + case 0x2b: bmi(); break; + case 0x2c: bmc(); break; + case 0x2d: bms(); break; + case 0x2e: bil(); break; + case 0x2f: bih(); break; + case 0x30: neg_di(); break; + case 0x31: illegal(); break; + case 0x32: illegal(); break; + case 0x33: com_di(); break; + case 0x34: lsr_di(); break; + case 0x35: illegal(); break; + case 0x36: ror_di(); break; + case 0x37: asr_di(); break; + case 0x38: lsl_di(); break; + case 0x39: rol_di(); break; + case 0x3a: dec_di(); break; + case 0x3b: illegal(); break; + case 0x3c: inc_di(); break; + case 0x3d: tst_di(); break; + case 0x3e: illegal(); break; + case 0x3f: clr_di(); break; + case 0x40: nega(); break; + case 0x41: illegal(); break; + case 0x42: illegal(); break; + case 0x43: coma(); break; + case 0x44: lsra(); break; + case 0x45: illegal(); break; + case 0x46: rora(); break; + case 0x47: asra(); break; + case 0x48: lsla(); break; + case 0x49: rola(); break; + case 0x4a: deca(); break; + case 0x4b: illegal(); break; + case 0x4c: inca(); break; + case 0x4d: tsta(); break; + case 0x4e: illegal(); break; + case 0x4f: clra(); break; + case 0x50: negx(); break; + case 0x51: illegal(); break; + case 0x52: illegal(); break; + case 0x53: comx(); break; + case 0x54: lsrx(); break; + case 0x55: illegal(); break; + case 0x56: rorx(); break; + case 0x57: asrx(); break; + case 0x58: aslx(); break; + case 0x59: rolx(); break; + case 0x5a: decx(); break; + case 0x5b: illegal(); break; + case 0x5c: incx(); break; + case 0x5d: tstx(); break; + case 0x5e: illegal(); break; + case 0x5f: clrx(); break; + case 0x60: neg_ix1(); break; + case 0x61: illegal(); break; + case 0x62: illegal(); break; + case 0x63: com_ix1(); break; + case 0x64: lsr_ix1(); break; + case 0x65: illegal(); break; + case 0x66: ror_ix1(); break; + case 0x67: asr_ix1(); break; + case 0x68: lsl_ix1(); break; + case 0x69: rol_ix1(); break; + case 0x6a: dec_ix1(); break; + case 0x6b: illegal(); break; + case 0x6c: inc_ix1(); break; + case 0x6d: tst_ix1(); break; + case 0x6e: illegal(); break; + case 0x6f: clr_ix1(); break; + case 0x70: neg_ix(); break; + case 0x71: illegal(); break; + case 0x72: illegal(); break; + case 0x73: com_ix(); break; + case 0x74: lsr_ix(); break; + case 0x75: illegal(); break; + case 0x76: ror_ix(); break; + case 0x77: asr_ix(); break; + case 0x78: lsl_ix(); break; + case 0x79: rol_ix(); break; + case 0x7a: dec_ix(); break; + case 0x7b: illegal(); break; + case 0x7c: inc_ix(); break; + case 0x7d: tst_ix(); break; + case 0x7e: illegal(); break; + case 0x7f: clr_ix(); break; + case 0x80: rti(); break; + case 0x81: rts(); break; + case 0x82: illegal(); break; + case 0x83: swi(); break; + case 0x84: illegal(); break; + case 0x85: illegal(); break; + case 0x86: illegal(); break; + case 0x87: illegal(); break; + case 0x88: illegal(); break; + case 0x89: illegal(); break; + case 0x8a: illegal(); break; + case 0x8b: illegal(); break; + case 0x8c: illegal(); break; + case 0x8d: illegal(); break; + case 0x8e: illegal(); break; + case 0x8f: illegal(); break; + case 0x90: illegal(); break; + case 0x91: illegal(); break; + case 0x92: illegal(); break; + case 0x93: illegal(); break; + case 0x94: illegal(); break; + case 0x95: illegal(); break; + case 0x96: illegal(); break; + case 0x97: tax(); break; + case 0x98: CLC(); break; + case 0x99: SEC(); break; + case 0x9a: CLI(); break; + case 0x9b: SEI(); break; + case 0x9c: rsp(); break; + case 0x9d: nop(); break; + case 0x9e: illegal(); break; + case 0x9f: txa(); break; + case 0xa0: suba_im(); break; + case 0xa1: cmpa_im(); break; + case 0xa2: sbca_im(); break; + case 0xa3: cpx_im(); break; + case 0xa4: anda_im(); break; + case 0xa5: bita_im(); break; + case 0xa6: lda_im(); break; + case 0xa7: illegal(); break; + case 0xa8: eora_im(); break; + case 0xa9: adca_im(); break; + case 0xaa: ora_im(); break; + case 0xab: adda_im(); break; + case 0xac: illegal(); break; + case 0xad: bsr(); break; + case 0xae: ldx_im(); break; + case 0xaf: illegal(); break; + case 0xb0: suba_di(); break; + case 0xb1: cmpa_di(); break; + case 0xb2: sbca_di(); break; + case 0xb3: cpx_di(); break; + case 0xb4: anda_di(); break; + case 0xb5: bita_di(); break; + case 0xb6: lda_di(); break; + case 0xb7: sta_di(); break; + case 0xb8: eora_di(); break; + case 0xb9: adca_di(); break; + case 0xba: ora_di(); break; + case 0xbb: adda_di(); break; + case 0xbc: jmp_di(); break; + case 0xbd: jsr_di(); break; + case 0xbe: ldx_di(); break; + case 0xbf: stx_di(); break; + case 0xc0: suba_ex(); break; + case 0xc1: cmpa_ex(); break; + case 0xc2: sbca_ex(); break; + case 0xc3: cpx_ex(); break; + case 0xc4: anda_ex(); break; + case 0xc5: bita_ex(); break; + case 0xc6: lda_ex(); break; + case 0xc7: sta_ex(); break; + case 0xc8: eora_ex(); break; + case 0xc9: adca_ex(); break; + case 0xca: ora_ex(); break; + case 0xcb: adda_ex(); break; + case 0xcc: jmp_ex(); break; + case 0xcd: jsr_ex(); break; + case 0xce: ldx_ex(); break; + case 0xcf: stx_ex(); break; + case 0xd0: suba_ix2(); break; + case 0xd1: cmpa_ix2(); break; + case 0xd2: sbca_ix2(); break; + case 0xd3: cpx_ix2(); break; + case 0xd4: anda_ix2(); break; + case 0xd5: bita_ix2(); break; + case 0xd6: lda_ix2(); break; + case 0xd7: sta_ix2(); break; + case 0xd8: eora_ix2(); break; + case 0xd9: adca_ix2(); break; + case 0xda: ora_ix2(); break; + case 0xdb: adda_ix2(); break; + case 0xdc: jmp_ix2(); break; + case 0xdd: jsr_ix2(); break; + case 0xde: ldx_ix2(); break; + case 0xdf: stx_ix2(); break; + case 0xe0: suba_ix1(); break; + case 0xe1: cmpa_ix1(); break; + case 0xe2: sbca_ix1(); break; + case 0xe3: cpx_ix1(); break; + case 0xe4: anda_ix1(); break; + case 0xe5: bita_ix1(); break; + case 0xe6: lda_ix1(); break; + case 0xe7: sta_ix1(); break; + case 0xe8: eora_ix1(); break; + case 0xe9: adca_ix1(); break; + case 0xea: ora_ix1(); break; + case 0xeb: adda_ix1(); break; + case 0xec: jmp_ix1(); break; + case 0xed: jsr_ix1(); break; + case 0xee: ldx_ix1(); break; + case 0xef: stx_ix1(); break; + case 0xf0: suba_ix(); break; + case 0xf1: cmpa_ix(); break; + case 0xf2: sbca_ix(); break; + case 0xf3: cpx_ix(); break; + case 0xf4: anda_ix(); break; + case 0xf5: bita_ix(); break; + case 0xf6: lda_ix(); break; + case 0xf7: sta_ix(); break; + case 0xf8: eora_ix(); break; + case 0xf9: adca_ix(); break; + case 0xfa: ora_ix(); break; + case 0xfb: adda_ix(); break; + case 0xfc: jmp_ix(); break; + case 0xfd: jsr_ix(); break; + case 0xfe: ldx_ix(); break; + case 0xff: stx_ix(); break; + } + pendingCycles -= cycles1[ireg]; + int delta = prevCycles - pendingCycles; + totalExecutedCycles += (ulong)delta; + } + while (pendingCycles > 0); + return cycles - pendingCycles; + } + public void SaveStateBinary(BinaryWriter writer) + { + int i; + writer.Write(ea.LowWord); + writer.Write(pc.LowWord); + writer.Write(s.LowWord); + writer.Write(subtype); + writer.Write(a); + writer.Write(x); + writer.Write(cc); + writer.Write(pending_interrupts); + for (i = 0; i < 9; i++) + { + writer.Write(irq_state[i]); + } + writer.Write(nmi_state); + writer.Write(TotalExecutedCycles); + writer.Write(PendingCycles); + } + public void LoadStateBinary(BinaryReader reader) + { + int i; + ea.LowWord = reader.ReadUInt16(); + pc.LowWord = reader.ReadUInt16(); + s.LowWord = reader.ReadUInt16(); + subtype = reader.ReadInt32(); + a = reader.ReadByte(); + x = reader.ReadByte(); + cc = reader.ReadByte(); + pending_interrupts = reader.ReadUInt16(); + for (i = 0; i < 9; i++) + { + irq_state[i] = reader.ReadInt32(); + } + nmi_state = reader.ReadInt32(); + TotalExecutedCycles = reader.ReadUInt64(); + PendingCycles = reader.ReadInt32(); + } + } + public class M68705 : M6805 + { + public M68705() + { + m68705_init(Cpuint.cpu_3_irq_callback); + } + private void m68705_init(irq_delegate irqcallback) + { + irq_callback = irqcallback; + } + public override void Reset() + { + m68705_reset(); + } + private void m68705_reset() + { + m6805_reset(); + subtype = SUBTYPE_M68705; + RM16(0xfffe, ref pc); + } + public override void set_irq_line(int irqline, LineState state) + { + m68705_set_irq_line(irqline, state); + } + private void m68705_set_irq_line(int irqline, LineState state) + { + if (irq_state[irqline] == (int)state) + { + return; + } + irq_state[irqline] = (int)state; + if (state != (int)LineState.CLEAR_LINE) + { + pending_interrupts |= (ushort)(1 << irqline); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805.cs.meta new file mode 100644 index 00000000..057cf3e4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 84fc920b98828f14c8f326b4f1520eb0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805op.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805op.cs new file mode 100644 index 00000000..f22af0d7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805op.cs @@ -0,0 +1,1896 @@ +using MAME.Core; + +namespace cpu.m6805 +{ + public partial class M6805 + { + protected void illegal() + { + + } + + + /* $00/$02/$04/$06/$08/$0A/$0C/$0E BRSET direct,relative ---- */ + protected void brset(byte bit) + { + byte t = 0, r = 0; + DIRBYTE(ref r); + IMMBYTE(ref t); + CLC(); + if ((r & bit) != 0) + { + SEC(); + pc.LowWord += (ushort)SIGNED(t); + if (t == 0xfd) + { + /* speed up busy loops */ + if (pendingCycles > 0) + pendingCycles = 0; + } + } + } + + /* $01/$03/$05/$07/$09/$0B/$0D/$0F BRCLR direct,relative ---- */ + protected void brclr(byte bit) + { + byte t = 0, r = 0; + DIRBYTE(ref r); + IMMBYTE(ref t); + SEC(); + if ((r & bit) == 0) + { + CLC(); + pc.LowWord += (ushort)SIGNED(t); + if (t == 0xfd) + { + /* speed up busy loops */ + if (pendingCycles > 0) + pendingCycles = 0; + } + } + } + + /* $10/$12/$14/$16/$18/$1A/$1C/$1E BSET direct ---- */ + protected void bset(byte bit) + { + byte t = 0, r; + DIRBYTE(ref t); + r = (byte)(t | bit); + WriteMemory((ushort)ea.d, r); + } + + /* $11/$13/$15/$17/$19/$1B/$1D/$1F BCLR direct ---- */ + protected void bclr(byte bit) + { + byte t = 0, r; + DIRBYTE(ref t); + r = (byte)(t & (~bit)); + WriteMemory((ushort)ea.d, r); + } + + /* $20 BRA relative ---- */ + protected void bra() + { + byte t = 0; + IMMBYTE(ref t); + pc.LowWord += (ushort)SIGNED(t); + if (t == 0xfe) + { + /* speed up busy loops */ + if (pendingCycles > 0) + pendingCycles = 0; + } + } + + /* $21 BRN relative ---- */ + protected void brn() + { + byte t = 0; + IMMBYTE(ref t); + } + + /* $22 BHI relative ---- */ + protected void bhi() + { + BRANCH((cc & (CFLAG | ZFLAG)) == 0); + } + + /* $23 BLS relative ---- */ + protected void bls() + { + BRANCH((cc & (CFLAG | ZFLAG)) != 0); + } + + /* $24 BCC relative ---- */ + protected void bcc() + { + BRANCH((cc & CFLAG) == 0); + } + + /* $25 BCS relative ---- */ + protected void bcs() + { + BRANCH((cc & CFLAG) != 0); + } + + /* $26 BNE relative ---- */ + protected void bne() + { + BRANCH((cc & ZFLAG) == 0); + } + + /* $27 BEQ relative ---- */ + protected void beq() + { + BRANCH((cc & ZFLAG) != 0); + } + + /* $28 BHCC relative ---- */ + protected void bhcc() + { + BRANCH((cc & HFLAG) == 0); + } + + /* $29 BHCS relative ---- */ + protected void bhcs() + { + BRANCH((cc & HFLAG) != 0); + } + + /* $2a BPL relative ---- */ + protected void bpl() + { + BRANCH((cc & NFLAG) == 0); + } + + /* $2b BMI relative ---- */ + protected void bmi() + { + BRANCH((cc & NFLAG) != 0); + } + + /* $2c BMC relative ---- */ + protected void bmc() + { + BRANCH((cc & IFLAG) == 0); + } + + /* $2d BMS relative ---- */ + protected void bms() + { + BRANCH((cc & IFLAG) != 0); + } + + /* $2e BIL relative ---- */ + protected void bil() + { + if (subtype == SUBTYPE_HD63705) + { + BRANCH(nmi_state != (int)LineState.CLEAR_LINE); + } + else + { + BRANCH(irq_state[0] != (int)LineState.CLEAR_LINE); + } + } + + /* $2f BIH relative ---- */ + protected void bih() + { + if (subtype == SUBTYPE_HD63705) + { + BRANCH(nmi_state == (int)LineState.CLEAR_LINE); + } + else + { + BRANCH(irq_state[0] == (int)LineState.CLEAR_LINE); + } + } + + /* $30 NEG direct -*** */ + protected void neg_di() + { + byte t = 0; + ushort r; + DIRBYTE(ref t); r = (ushort)-t; + CLR_NZC(); SET_FLAGS8(0, t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $31 ILLEGAL */ + + /* $32 ILLEGAL */ + + /* $33 COM direct -**1 */ + protected void com_di() + { + byte t = 0; + DIRBYTE(ref t); t = (byte)~t; + CLR_NZ(); SET_NZ8(t); SEC(); + WriteMemory((ushort)ea.d, t); + } + + /* $34 LSR direct -0** */ + protected void lsr_di() + { + byte t = 0; + DIRBYTE(ref t); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t >>= 1; + SET_Z8(t); + WriteMemory((ushort)ea.d, t); + } + + /* $35 ILLEGAL */ + + /* $36 ROR direct -*** */ + protected void ror_di() + { + byte t = 0, r; + DIRBYTE(ref t); + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(t & 0x01); + r |= (byte)(t >> 1); + SET_NZ8(r); + WriteMemory((ushort)ea.d, r); + } + + /* $37 ASR direct ?*** */ + protected void asr_di() + { + byte t = 0; + DIRBYTE(ref t); + CLR_NZC(); cc |= (byte)(t & 0x01); + t >>= 1; t |= (byte)((t & 0x40) << 1); + SET_NZ8(t); + WriteMemory((ushort)ea.d, t); + } + + /* $38 LSL direct ?*** */ + protected void lsl_di() + { + byte t = 0; + ushort r; + DIRBYTE(ref t); + r = (ushort)(t << 1); + CLR_NZC(); + SET_FLAGS8(t, t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $39 ROL direct -*** */ + protected void rol_di() + { + byte b = 0; + ushort t = 0, r; + DIRBYTE(ref b); + t = (ushort)b; + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZC(); + SET_FLAGS8((byte)t, (byte)t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $3a DEC direct -**- */ + protected void dec_di() + { + byte t = 0; + DIRBYTE(ref t); + --t; + CLR_NZ(); SET_FLAGS8D(t); + WriteMemory((ushort)ea.d, t); + } + + /* $3b ILLEGAL */ + + /* $3c INC direct -**- */ + protected void inc_di() + { + byte t = 0; + DIRBYTE(ref t); + ++t; + CLR_NZ(); SET_FLAGS8I(t); + WriteMemory((ushort)ea.d, t); + } + + /* $3d TST direct -**- */ + protected void tst_di() + { + byte t = 0; + DIRBYTE(ref t); + CLR_NZ(); SET_NZ8(t); + } + + /* $3e ILLEGAL */ + + /* $3f CLR direct -0100 */ + protected void clr_di() + { + DIRECT(); + CLR_NZC(); SEZ(); + WriteMemory((ushort)ea.d, 0); + } + + /* $40 NEGA inherent ?*** */ + protected void nega() + { + ushort r; + r = (ushort)-a; + CLR_NZC(); SET_FLAGS8(0, a, r); + a = (byte)r; + } + + /* $41 ILLEGAL */ + + /* $42 ILLEGAL */ + + /* $43 COMA inherent -**1 */ + protected void coma() + { + a = (byte)~a; + CLR_NZ(); + SET_NZ8(a); + SEC(); + } + + /* $44 LSRA inherent -0** */ + protected void lsra() + { + CLR_NZC(); + cc |= (byte)(a & 0x01); + a >>= 1; + SET_Z8(a); + } + + /* $45 ILLEGAL */ + + /* $46 RORA inherent -*** */ + protected void rora() + { + byte r; + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(a & 0x01); + r |= (byte)(a >> 1); + SET_NZ8(r); + a = r; + } + + /* $47 ASRA inherent ?*** */ + protected void asra() + { + CLR_NZC(); + cc |= (byte)(a & 0x01); + a = (byte)((a & 0x80) | (a >> 1)); + SET_NZ8(a); + } + + /* $48 LSLA inherent ?*** */ + protected void lsla() + { + ushort r; + r = (ushort)(a << 1); + CLR_NZC(); + SET_FLAGS8(a, a, r); + a = (byte)r; + } + + /* $49 ROLA inherent -*** */ + protected void rola() + { + ushort t, r; + t = a; + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZC(); + SET_FLAGS8((byte)t, (byte)t, r); + a = (byte)r; + } + + /* $4a DECA inherent -**- */ + protected void deca() + { + --a; + CLR_NZ(); + SET_FLAGS8D(a); + } + + /* $4b ILLEGAL */ + + /* $4c INCA inherent -**- */ + protected void inca() + { + ++a; + CLR_NZ(); + SET_FLAGS8I(a); + } + + /* $4d TSTA inherent -**- */ + protected void tsta() + { + CLR_NZ(); + SET_NZ8(a); + } + + /* $4e ILLEGAL */ + + /* $4f CLRA inherent -010 */ + protected void clra() + { + a = 0; + CLR_NZ(); + SEZ(); + } + + /* $50 NEGX inherent ?*** */ + protected void negx() + { + ushort r; + r = (ushort)-x; + CLR_NZC(); + SET_FLAGS8(0, x, r); + x = (byte)r; + } + + /* $51 ILLEGAL */ + + /* $52 ILLEGAL */ + + /* $53 COMX inherent -**1 */ + protected void comx() + { + x = (byte)~x; + CLR_NZ(); + SET_NZ8(x); + SEC(); + } + + /* $54 LSRX inherent -0** */ + protected void lsrx() + { + CLR_NZC(); + cc |= (byte)(x & 0x01); + x >>= 1; + SET_Z8(x); + } + + /* $55 ILLEGAL */ + + /* $56 RORX inherent -*** */ + protected void rorx() + { + byte r; + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(x & 0x01); + r |= (byte)(x >> 1); + SET_NZ8(r); + x = r; + } + + /* $57 ASRX inherent ?*** */ + protected void asrx() + { + CLR_NZC(); + cc |= (byte)(x & 0x01); + x = (byte)((x & 0x80) | (x >> 1)); + SET_NZ8(x); + } + + /* $58 ASLX inherent ?*** */ + protected void aslx() + { + ushort r; + r = (ushort)(x << 1); + CLR_NZC(); + SET_FLAGS8(x, x, r); + x = (byte)r; + } + + /* $59 ROLX inherent -*** */ + protected void rolx() + { + ushort t, r; + t = x; + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZC(); + SET_FLAGS8((byte)t, (byte)t, r); + x = (byte)r; + } + + /* $5a DECX inherent -**- */ + protected void decx() + { + --x; + CLR_NZ(); + SET_FLAGS8D(x); + } + + /* $5b ILLEGAL */ + + /* $5c INCX inherent -**- */ + protected void incx() + { + ++x; + CLR_NZ(); + SET_FLAGS8I(x); + } + + /* $5d TSTX inherent -**- */ + protected void tstx() + { + CLR_NZ(); + SET_NZ8(x); + } + + /* $5e ILLEGAL */ + + /* $5f CLRX inherent -010 */ + protected void clrx() + { + x = 0; + CLR_NZC(); + SEZ(); + } + + /* $60 NEG indexed, 1 byte offset -*** */ + protected void neg_ix1() + { + byte t = 0; + ushort r; + IDX1BYTE(ref t); r = (ushort)(-t); + CLR_NZC(); SET_FLAGS8(0, t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $61 ILLEGAL */ + + /* $62 ILLEGAL */ + + /* $63 COM indexed, 1 byte offset -**1 */ + protected void com_ix1() + { + byte t = 0; + IDX1BYTE(ref t); t = (byte)~t; + CLR_NZ(); SET_NZ8(t); SEC(); + WriteMemory((ushort)ea.d, t); + } + + /* $64 LSR indexed, 1 byte offset -0** */ + protected void lsr_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t >>= 1; + SET_Z8(t); + WriteMemory((ushort)ea.d, t); + } + + /* $65 ILLEGAL */ + + /* $66 ROR indexed, 1 byte offset -*** */ + protected void ror_ix1() + { + byte t = 0, r; + IDX1BYTE(ref t); + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(t & 0x01); + r |= (byte)(t >> 1); + SET_NZ8(r); + WriteMemory((ushort)ea.d, r); + } + + /* $67 ASR indexed, 1 byte offset ?*** */ + protected void asr_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + CLR_NZC(); cc |= (byte)(t & 0x01); + t >>= 1; t |= (byte)((t & 0x40) << 1); + SET_NZ8(t); + WriteMemory((ushort)ea.d, t); + } + + /* $68 LSL indexed, 1 byte offset ?*** */ + protected void lsl_ix1() + { + byte t = 0; + ushort r; + IDX1BYTE(ref t); + r = (ushort)(t << 1); + CLR_NZC(); + SET_FLAGS8(t, t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $69 ROL indexed, 1 byte offset -*** */ + protected void rol_ix1() + { + byte b = 0; + ushort t, r; + IDX1BYTE(ref b); + t = (ushort)b; + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZC(); + SET_FLAGS8((byte)t, (byte)t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $6a DEC indexed, 1 byte offset -**- */ + protected void dec_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + --t; + CLR_NZ(); SET_FLAGS8D(t); + WriteMemory((ushort)ea.d, t); + } + + /* $6b ILLEGAL */ + + /* $6c INC indexed, 1 byte offset -**- */ + protected void inc_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + ++t; + CLR_NZ(); SET_FLAGS8I(t); + WriteMemory((ushort)ea.d, t); + } + + /* $6d TST indexed, 1 byte offset -**- */ + protected void tst_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + CLR_NZ(); SET_NZ8(t); + } + + /* $6e ILLEGAL */ + + /* $6f CLR indexed, 1 byte offset -0100 */ + protected void clr_ix1() + { + INDEXED1(); + CLR_NZC(); SEZ(); + WriteMemory((ushort)ea.d, 0); + } + + /* $70 NEG indexed -*** */ + protected void neg_ix() + { + byte t = 0; + ushort r; + IDXBYTE(ref t); r = (ushort)-t; + CLR_NZC(); SET_FLAGS8(0, t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $71 ILLEGAL */ + + /* $72 ILLEGAL */ + + /* $73 COM indexed -**1 */ + protected void com_ix() + { + byte t = 0; + IDXBYTE(ref t); t = (byte)~t; + CLR_NZ(); SET_NZ8(t); SEC(); + WriteMemory((ushort)ea.d, t); + } + + /* $74 LSR indexed -0** */ + protected void lsr_ix() + { + byte t = 0; + IDXBYTE(ref t); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t >>= 1; + SET_Z8(t); + WriteMemory((ushort)ea.d, t); + } + + /* $75 ILLEGAL */ + + /* $76 ROR indexed -*** */ + protected void ror_ix() + { + byte t = 0, r; + IDXBYTE(ref t); + r = (byte)((cc & 0x01) << 7); + CLR_NZC(); + cc |= (byte)(t & 0x01); + r |= (byte)(t >> 1); + SET_NZ8(r); + WriteMemory((ushort)ea.d, r); + } + + /* $77 ASR indexed ?*** */ + protected void asr_ix() + { + byte t = 0; + IDXBYTE(ref t); + CLR_NZC(); + cc |= (byte)(t & 0x01); + t = (byte)((t & 0x80) | (t >> 1)); + SET_NZ8(t); + WriteMemory((ushort)ea.d, t); + } + + /* $78 LSL indexed ?*** */ + protected void lsl_ix() + { + byte t = 0; + ushort r; + IDXBYTE(ref t); r = (ushort)(t << 1); + CLR_NZC(); SET_FLAGS8(t, t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $79 ROL indexed -*** */ + protected void rol_ix() + { + byte b = 0; + ushort t = 0, r; + IDXBYTE(ref b); + t = (ushort)b; + r = (ushort)(cc & 0x01); + r |= (ushort)(t << 1); + CLR_NZC(); + SET_FLAGS8((byte)t, (byte)t, r); + WriteMemory((ushort)ea.d, (byte)r); + } + + /* $7a DEC indexed -**- */ + protected void dec_ix() + { + byte t = 0; + IDXBYTE(ref t); + --t; + CLR_NZ(); SET_FLAGS8D(t); + WriteMemory((ushort)ea.d, t); + } + + /* $7b ILLEGAL */ + + /* $7c INC indexed -**- */ + protected void inc_ix() + { + byte t = 0; + IDXBYTE(ref t); + ++t; + CLR_NZ(); SET_FLAGS8I(t); + WriteMemory((ushort)ea.d, t); + } + + /* $7d TST indexed -**- */ + protected void tst_ix() + { + byte t = 0; + IDXBYTE(ref t); + CLR_NZ(); SET_NZ8(t); + } + + /* $7e ILLEGAL */ + + /* $7f CLR indexed -0100 */ + protected void clr_ix() + { + INDEXED(); + CLR_NZC(); SEZ(); + WriteMemory((ushort)ea.d, 0); + } + + /* $80 RTI inherent #### */ + protected void rti() + { + PULLBYTE(ref cc); + PULLBYTE(ref a); + PULLBYTE(ref x); + PULLWORD(ref pc); + //change_pc(PC); + } + + /* $81 RTS inherent ---- */ + protected void rts() + { + PULLWORD(ref pc); + //change_pc(PC); + } + + /* $82 ILLEGAL */ + + /* $83 SWI absolute indirect ---- */ + protected void swi() + { + PUSHWORD(ref pc); + PUSHBYTE(ref x); + PUSHBYTE(ref a); + PUSHBYTE(ref cc); + SEI(); + if (subtype == SUBTYPE_HD63705) + { + RM16(0x1ffa, ref pc); + } + else + { + RM16(0xfffc, ref pc); + } + //change_pc(PC); + } + + /* $84 ILLEGAL */ + + /* $85 ILLEGAL */ + + /* $86 ILLEGAL */ + + /* $87 ILLEGAL */ + + /* $88 ILLEGAL */ + + /* $89 ILLEGAL */ + + /* $8A ILLEGAL */ + + /* $8B ILLEGAL */ + + /* $8C ILLEGAL */ + + /* $8D ILLEGAL */ + + /* $8E ILLEGAL */ + + /* $8F ILLEGAL */ + + /* $90 ILLEGAL */ + + /* $91 ILLEGAL */ + + /* $92 ILLEGAL */ + + /* $93 ILLEGAL */ + + /* $94 ILLEGAL */ + + /* $95 ILLEGAL */ + + /* $96 ILLEGAL */ + + /* $97 TAX inherent ---- */ + protected void tax() + { + x = a; + } + + /* $98 CLC */ + + /* $99 SEC */ + + /* $9A CLI */ + + /* $9B SEI */ + + /* $9C RSP inherent ---- */ + protected void rsp() + { + s.LowWord = (byte)sp_mask; + } + + /* $9D NOP inherent ---- */ + protected void nop() + { + } + + /* $9E ILLEGAL */ + + /* $9F TXA inherent ---- */ + protected void txa() + { + a = x; + } + + /* $a0 SUBA immediate ?*** */ + protected void suba_im() + { + byte b = 0; + ushort t, r; + IMMBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $a1 CMPA immediate ?*** */ + protected void cmpa_im() + { + byte b = 0; + ushort t, r; + IMMBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + } + + /* $a2 SBCA immediate ?*** */ + protected void sbca_im() + { + byte b = 0; + ushort t, r; + IMMBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t - (cc & 0x01)); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $a3 CPX immediate -*** */ + protected void cpx_im() + { + byte b = 0; + ushort t, r; + IMMBYTE(ref b); + t = (ushort)b; + r = (ushort)(x - t); + CLR_NZC(); + SET_FLAGS8(x, (byte)t, r); + } + + /* $a4 ANDA immediate -**- */ + protected void anda_im() + { + byte t = 0; + IMMBYTE(ref t); + a &= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $a5 BITA immediate -**- */ + protected void bita_im() + { + byte t = 0, r; + IMMBYTE(ref t); + r = (byte)(a & t); + CLR_NZ(); + SET_NZ8(r); + } + + /* $a6 LDA immediate -**- */ + protected void lda_im() + { + IMMBYTE(ref a); + CLR_NZ(); + SET_NZ8(a); + } + + /* $a7 ILLEGAL */ + + /* $a8 EORA immediate -**- */ + protected void eora_im() + { + byte t = 0; + IMMBYTE(ref t); + a ^= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $a9 ADCA immediate **** */ + protected void adca_im() + { + byte b = 0; + ushort t, r; + IMMBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t + (cc & 0x01)); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $aa ORA immediate -**- */ + protected void ora_im() + { + byte t = 0; + IMMBYTE(ref t); + a |= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $ab ADDA immediate **** */ + protected void adda_im() + { + byte b = 0; + ushort t, r; + IMMBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $ac ILLEGAL */ + + /* $ad BSR ---- */ + protected void bsr() + { + byte t = 0; + IMMBYTE(ref t); + PUSHWORD(ref pc); + pc.LowWord += (ushort)SIGNED(t); + } + + /* $ae LDX immediate -**- */ + protected void ldx_im() + { + IMMBYTE(ref x); + CLR_NZ(); + SET_NZ8(x); + } + + /* $af ILLEGAL */ + + /* $b0 SUBA direct ?*** */ + protected void suba_di() + { + byte b = 0; + ushort t, r; + DIRBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $b1 CMPA direct ?*** */ + protected void cmpa_di() + { + byte b = 0; + ushort t, r; + DIRBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + } + + /* $b2 SBCA direct ?*** */ + protected void sbca_di() + { + byte b = 0; + ushort t, r; + DIRBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t - (cc & 0x01)); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $b3 CPX direct -*** */ + protected void cpx_di() + { + byte b = 0; + ushort t, r; + DIRBYTE(ref b); + t = (ushort)b; + r = (ushort)(x - t); + CLR_NZC(); + SET_FLAGS8(x, (byte)t, r); + } + + /* $b4 ANDA direct -**- */ + protected void anda_di() + { + byte t = 0; + DIRBYTE(ref t); + a &= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $b5 BITA direct -**- */ + protected void bita_di() + { + byte t = 0, r; + DIRBYTE(ref t); + r = (byte)(a & t); + CLR_NZ(); + SET_NZ8(r); + } + + /* $b6 LDA direct -**- */ + protected void lda_di() + { + DIRBYTE(ref a); + CLR_NZ(); + SET_NZ8(a); + } + + /* $b7 STA direct -**- */ + protected void sta_di() + { + CLR_NZ(); + SET_NZ8(a); + DIRECT(); + WriteMemory((ushort)ea.d, a); + } + + /* $b8 EORA direct -**- */ + protected void eora_di() + { + byte t = 0; + DIRBYTE(ref t); + a ^= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $b9 ADCA direct **** */ + protected void adca_di() + { + byte b = 0; + ushort t, r; + DIRBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t + (cc & 0x01)); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $ba ORA direct -**- */ + protected void ora_di() + { + byte t = 0; + DIRBYTE(ref t); + a |= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $bb ADDA direct **** */ + protected void adda_di() + { + byte b = 0; + ushort t, r; + DIRBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $bc JMP direct -*** */ + protected void jmp_di() + { + DIRECT(); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $bd JSR direct ---- */ + protected void jsr_di() + { + DIRECT(); + PUSHWORD(ref pc); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $be LDX direct -**- */ + protected void ldx_di() + { + DIRBYTE(ref x); + CLR_NZ(); + SET_NZ8(x); + } + + /* $bf STX direct -**- */ + protected void stx_di() + { + CLR_NZ(); + SET_NZ8(x); + DIRECT(); + WriteMemory((ushort)ea.d, x); + } + + /* $c0 SUBA extended ?*** */ + protected void suba_ex() + { + byte b = 0; + ushort t, r; + EXTBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $c1 CMPA extended ?*** */ + protected void cmpa_ex() + { + byte b = 0; + ushort t, r; + EXTBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + } + + /* $c2 SBCA extended ?*** */ + protected void sbca_ex() + { + byte b = 0; + ushort t, r; + EXTBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t - (cc & 0x01)); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $c3 CPX extended -*** */ + protected void cpx_ex() + { + byte b = 0; + ushort t, r; + EXTBYTE(ref b); + t = (ushort)b; + r = (ushort)(x - t); + CLR_NZC(); + SET_FLAGS8(x, (byte)t, r); + } + + /* $c4 ANDA extended -**- */ + protected void anda_ex() + { + byte t = 0; + EXTBYTE(ref t); + a &= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $c5 BITA extended -**- */ + protected void bita_ex() + { + byte t = 0, r; + EXTBYTE(ref t); + r = (byte)(a & t); + CLR_NZ(); + SET_NZ8(r); + } + + /* $c6 LDA extended -**- */ + protected void lda_ex() + { + EXTBYTE(ref a); + CLR_NZ(); + SET_NZ8(a); + } + + /* $c7 STA extended -**- */ + protected void sta_ex() + { + CLR_NZ(); + SET_NZ8(a); + EXTENDED(); + WriteMemory((ushort)ea.d, a); + } + + /* $c8 EORA extended -**- */ + protected void eora_ex() + { + byte t = 0; + EXTBYTE(ref t); + a ^= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $c9 ADCA extended **** */ + protected void adca_ex() + { + byte b = 0; + ushort t, r; + EXTBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t + (cc & 0x01)); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $ca ORA extended -**- */ + protected void ora_ex() + { + byte t = 0; + EXTBYTE(ref t); + a |= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $cb ADDA extended **** */ + protected void adda_ex() + { + byte b = 0; + ushort t, r; + EXTBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $cc JMP extended -*** */ + protected void jmp_ex() + { + EXTENDED(); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $cd JSR extended ---- */ + protected void jsr_ex() + { + EXTENDED(); + PUSHWORD(ref pc); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $ce LDX extended -**- */ + protected void ldx_ex() + { + EXTBYTE(ref x); + CLR_NZ(); + SET_NZ8(x); + } + + /* $cf STX extended -**- */ + protected void stx_ex() + { + CLR_NZ(); + SET_NZ8(x); + EXTENDED(); + WriteMemory((ushort)ea.d, x); + } + + /* $d0 SUBA indexed, 2 byte offset ?*** */ + protected void suba_ix2() + { + byte b = 0; + ushort t, r; + IDX2BYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $d1 CMPA indexed, 2 byte offset ?*** */ + protected void cmpa_ix2() + { + byte b = 0; + ushort t, r; + IDX2BYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + } + + /* $d2 SBCA indexed, 2 byte offset ?*** */ + protected void sbca_ix2() + { + byte b = 0; + ushort t, r; + IDX2BYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t - (cc & 0x01)); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $d3 CPX indexed, 2 byte offset -*** */ + protected void cpx_ix2() + { + byte b = 0; + ushort t, r; + IDX2BYTE(ref b); + t = (ushort)b; + r = (ushort)(x - t); + CLR_NZC(); + SET_FLAGS8(x, (byte)t, r); + } + + /* $d4 ANDA indexed, 2 byte offset -**- */ + protected void anda_ix2() + { + byte t = 0; + IDX2BYTE(ref t); + a &= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $d5 BITA indexed, 2 byte offset -**- */ + protected void bita_ix2() + { + byte t = 0, r; + IDX2BYTE(ref t); + r = (byte)(a & t); + CLR_NZ(); + SET_NZ8(r); + } + + /* $d6 LDA indexed, 2 byte offset -**- */ + protected void lda_ix2() + { + IDX2BYTE(ref a); + CLR_NZ(); + SET_NZ8(a); + } + + /* $d7 STA indexed, 2 byte offset -**- */ + protected void sta_ix2() + { + CLR_NZ(); + SET_NZ8(a); + INDEXED2(); + WriteMemory((ushort)ea.d, a); + } + + /* $d8 EORA indexed, 2 byte offset -**- */ + protected void eora_ix2() + { + byte t = 0; + IDX2BYTE(ref t); + a ^= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $d9 ADCA indexed, 2 byte offset **** */ + protected void adca_ix2() + { + byte b = 0; + ushort t, r; + IDX2BYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t + (cc & 0x01)); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $da ORA indexed, 2 byte offset -**- */ + protected void ora_ix2() + { + byte t = 0; + IDX2BYTE(ref t); + a |= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $db ADDA indexed, 2 byte offset **** */ + protected void adda_ix2() + { + byte b = 0; + ushort t, r; + IDX2BYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $dc JMP indexed, 2 byte offset -*** */ + protected void jmp_ix2() + { + INDEXED2(); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $dd JSR indexed, 2 byte offset ---- */ + protected void jsr_ix2() + { + INDEXED2(); + PUSHWORD(ref pc); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $de LDX indexed, 2 byte offset -**- */ + protected void ldx_ix2() + { + IDX2BYTE(ref x); + CLR_NZ(); + SET_NZ8(x); + } + + /* $df STX indexed, 2 byte offset -**- */ + protected void stx_ix2() + { + CLR_NZ(); + SET_NZ8(x); + INDEXED2(); + WriteMemory((ushort)ea.d, x); + } + + /* $e0 SUBA indexed, 1 byte offset ?*** */ + protected void suba_ix1() + { + byte b = 0; + ushort t, r; + IDX1BYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $e1 CMPA indexed, 1 byte offset ?*** */ + protected void cmpa_ix1() + { + byte b = 0; + ushort t, r; + IDX1BYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + } + + /* $e2 SBCA indexed, 1 byte offset ?*** */ + protected void sbca_ix1() + { + byte b = 0; + ushort t, r; + IDX1BYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t - (cc & 0x01)); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $e3 CPX indexed, 1 byte offset -*** */ + protected void cpx_ix1() + { + byte b = 0; + ushort t, r; + IDX1BYTE(ref b); + t = (ushort)b; + r = (ushort)(x - t); + CLR_NZC(); + SET_FLAGS8(x, (byte)t, r); + } + + /* $e4 ANDA indexed, 1 byte offset -**- */ + protected void anda_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + a &= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $e5 BITA indexed, 1 byte offset -**- */ + protected void bita_ix1() + { + byte t = 0, r; + IDX1BYTE(ref t); + r = (byte)(a & t); + CLR_NZ(); + SET_NZ8(r); + } + + /* $e6 LDA indexed, 1 byte offset -**- */ + protected void lda_ix1() + { + IDX1BYTE(ref a); + CLR_NZ(); + SET_NZ8(a); + } + + /* $e7 STA indexed, 1 byte offset -**- */ + protected void sta_ix1() + { + CLR_NZ(); + SET_NZ8(a); + INDEXED1(); + WriteMemory((ushort)ea.d, a); + } + + /* $e8 EORA indexed, 1 byte offset -**- */ + protected void eora_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + a ^= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $e9 ADCA indexed, 1 byte offset **** */ + protected void adca_ix1() + { + byte b = 0; + ushort t, r; + IDX1BYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t + (cc & 0x01)); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $ea ORA indexed, 1 byte offset -**- */ + protected void ora_ix1() + { + byte t = 0; + IDX1BYTE(ref t); + a |= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $eb ADDA indexed, 1 byte offset **** */ + protected void adda_ix1() + { + byte b = 0; + ushort t, r; + IDX1BYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $ec JMP indexed, 1 byte offset -*** */ + protected void jmp_ix1() + { + INDEXED1(); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $ed JSR indexed, 1 byte offset ---- */ + protected void jsr_ix1() + { + INDEXED1(); + PUSHWORD(ref pc); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $ee LDX indexed, 1 byte offset -**- */ + protected void ldx_ix1() + { + IDX1BYTE(ref x); + CLR_NZ(); + SET_NZ8(x); + } + + /* $ef STX indexed, 1 byte offset -**- */ + protected void stx_ix1() + { + CLR_NZ(); + SET_NZ8(x); + INDEXED1(); + WriteMemory((ushort)ea.d, x); + } + + /* $f0 SUBA indexed ?*** */ + protected void suba_ix() + { + byte b = 0; + ushort t, r; + IDXBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $f1 CMPA indexed ?*** */ + protected void cmpa_ix() + { + byte b = 0; + ushort t, r; + IDXBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + } + + /* $f2 SBCA indexed ?*** */ + protected void sbca_ix() + { + byte b = 0; + ushort t, r; + IDXBYTE(ref b); + t = (ushort)b; + r = (ushort)(a - t - (cc & 0x01)); + CLR_NZC(); + SET_FLAGS8(a, (byte)t, r); + a = (byte)r; + } + + /* $f3 CPX indexed -*** */ + protected void cpx_ix() + { + byte b = 0; + ushort t, r; + IDXBYTE(ref b); + t = (ushort)b; + r = (ushort)(x - t); + CLR_NZC(); + SET_FLAGS8(x, (byte)t, r); + } + + /* $f4 ANDA indexed -**- */ + protected void anda_ix() + { + byte t = 0; + IDXBYTE(ref t); + a &= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $f5 BITA indexed -**- */ + protected void bita_ix() + { + byte t = 0, r; + IDXBYTE(ref t); + r = (byte)(a & t); + CLR_NZ(); + SET_NZ8(r); + } + + /* $f6 LDA indexed -**- */ + protected void lda_ix() + { + IDXBYTE(ref a); + CLR_NZ(); + SET_NZ8(a); + } + + /* $f7 STA indexed -**- */ + protected void sta_ix() + { + CLR_NZ(); + SET_NZ8(a); + INDEXED(); + WriteMemory((ushort)ea.d, a); + } + + /* $f8 EORA indexed -**- */ + protected void eora_ix() + { + byte t = 0; + IDXBYTE(ref t); + a ^= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $f9 ADCA indexed **** */ + protected void adca_ix() + { + byte b = 0; + ushort t, r; + IDXBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t + (cc & 0x01)); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $fa ORA indexed -**- */ + protected void ora_ix() + { + byte t = 0; + IDXBYTE(ref t); + a |= t; + CLR_NZ(); + SET_NZ8(a); + } + + /* $fb ADDA indexed **** */ + protected void adda_ix() + { + byte b = 0; + ushort t, r; + IDXBYTE(ref b); + t = (ushort)b; + r = (ushort)(a + t); + CLR_HNZC(); + SET_FLAGS8(a, (byte)t, r); + SET_H(a, (byte)t, (byte)r); + a = (byte)r; + } + + /* $fc JMP indexed -*** */ + protected void jmp_ix() + { + INDEXED(); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $fd JSR indexed ---- */ + protected void jsr_ix() + { + INDEXED(); + PUSHWORD(ref pc); + pc.LowWord = ea.LowWord; + //change_pc(PC); + } + + /* $fe LDX indexed -**- */ + protected void ldx_ix() + { + IDXBYTE(ref x); + CLR_NZ(); + SET_NZ8(x); + } + + /* $ff STX indexed -**- */ + protected void stx_ix() + { + CLR_NZ(); + SET_NZ8(x); + INDEXED(); + WriteMemory((ushort)ea.d, x); + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805op.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805op.cs.meta new file mode 100644 index 00000000..76386b76 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6805/M6805op.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0c310d005b3a9f4d8861c58a32603b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809.meta new file mode 100644 index 00000000..b7f51e1c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 24967d13608942c4289d335114c41269 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809.cs new file mode 100644 index 00000000..921dda34 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809.cs @@ -0,0 +1,901 @@ +using MAME.Core; +using System; +using System.IO; + +namespace cpu.m6809 +{ + public partial class M6809 : cpuexec_data + { + public static M6809[] mm1; + public Action[] insn; + public Register PC, PPC, D, DP, U, S, X, Y, EA; + public byte CC, ireg; + public LineState[] irq_state = new LineState[2]; + public int extra_cycles; /* cycles used up by interrupts */ + public byte int_state; + public LineState nmi_state; + private byte CC_C = 0x01, CC_V = 0x02, CC_Z = 0x04, CC_N = 0x08, CC_II = 0x10, CC_H = 0x20, CC_IF = 0x40, CC_E = 0x80; + private byte M6809_CWAI = 8, M6809_SYNC = 16, M6809_LDS = 32; + private byte M6809_IRQ_LINE = 0, M6809_FIRQ_LINE = 1; + public Func ReadOp, ReadOpArg; + public Func RM; + public Action WM; + public Func ReadIO; + public Action WriteIO; + public delegate int irq_delegate(int irqline); + public irq_delegate irq_callback; + private ulong totalExecutedCycles; + private int pendingCycles; + public override ulong TotalExecutedCycles + { + get + { + return totalExecutedCycles; + } + set + { + totalExecutedCycles = value; + } + } + public override int PendingCycles + { + get + { + return pendingCycles; + } + set + { + pendingCycles = value; + } + } + public byte[] flags8i = new byte[256] +{ +0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x0a,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 +}; + public byte[] flags8d = new byte[256] +{ +0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 +}; + private byte[] cycles_6809 = new byte[] + { + 0x06,0x06,0x02,0x06,0x06,0x02,0x06,0x06,0x06,0x06,0x06,0x02,0x06,0x06,0x03,0x06, + 0x00,0x00,0x02,0x04,0x02,0x02,0x05,0x09,0x02,0x02,0x03,0x02,0x03,0x02,0x08,0x06, + 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x02,0x05,0x03,0x06,0x14,0x0b,0x02,0x13, + 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, + 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, + 0x06,0x02,0x02,0x06,0x06,0x02,0x06,0x06,0x06,0x06,0x06,0x02,0x06,0x06,0x03,0x06, + 0x07,0x02,0x02,0x07,0x07,0x02,0x07,0x07,0x07,0x07,0x07,0x02,0x07,0x07,0x04,0x07, + 0x02,0x02,0x02,0x04,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x04,0x07,0x03,0x02, + 0x04,0x04,0x04,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x06,0x07,0x05,0x05, + 0x04,0x04,0x04,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x06,0x07,0x05,0x05, + 0x05,0x05,0x05,0x07,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x07,0x08,0x06,0x06, + 0x02,0x02,0x02,0x04,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x02,0x03,0x03, + 0x04,0x04,0x04,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05, + 0x04,0x04,0x04,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05, + 0x05,0x05,0x05,0x07,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06 + }; + public M6809() + { + insn = new Action[]{ + neg_di,neg_di,illegal,com_di,lsr_di,illegal,ror_di,asr_di, + asl_di,rol_di,dec_di,illegal,inc_di,tst_di,jmp_di,clr_di, + pref10,pref11,nop,sync,illegal,illegal,lbra,lbsr, + illegal,daa,orcc,illegal,andcc,sex,exg,tfr, + bra,brn,bhi,bls,bcc,bcs,bne,beq, + bvc,bvs,bpl,bmi,bge,blt,bgt,ble, + leax,leay,leas,leau,pshs,puls,pshu,pulu, + illegal,rts,abx,rti,cwai,mul,illegal,swi, + nega,illegal,illegal,coma,lsra,illegal,rora,asra, + asla,rola,deca,illegal,inca,tsta,illegal,clra, + negb,illegal,illegal,comb,lsrb,illegal,rorb,asrb, + aslb,rolb,decb,illegal,incb,tstb,illegal,clrb, + neg_ix,illegal,illegal,com_ix,lsr_ix,illegal,ror_ix,asr_ix, + asl_ix,rol_ix,dec_ix,illegal,inc_ix,tst_ix,jmp_ix,clr_ix, + neg_ex,illegal,illegal,com_ex,lsr_ex,illegal,ror_ex,asr_ex, + asl_ex,rol_ex,dec_ex,illegal,inc_ex,tst_ex,jmp_ex,clr_ex, + suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im,sta_im, + eora_im,adca_im,ora_im,adda_im,cmpx_im,bsr,ldx_im,stx_im, + suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di,sta_di, + eora_di,adca_di,ora_di,adda_di,cmpx_di,jsr_di,ldx_di,stx_di, + suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix,sta_ix, + eora_ix,adca_ix,ora_ix,adda_ix,cmpx_ix,jsr_ix,ldx_ix,stx_ix, + suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex,sta_ex, + eora_ex,adca_ex,ora_ex,adda_ex,cmpx_ex,jsr_ex,ldx_ex,stx_ex, + subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im,stb_im, + eorb_im,adcb_im,orb_im,addb_im,ldd_im,std_im,ldu_im,stu_im, + subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di,stb_di, + eorb_di,adcb_di,orb_di,addb_di,ldd_di,std_di,ldu_di,stu_di, + subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix,stb_ix, + eorb_ix,adcb_ix,orb_ix,addb_ix,ldd_ix,std_ix,ldu_ix,stu_ix, + subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex,stb_ex, + eorb_ex,adcb_ex,orb_ex,addb_ex,ldd_ex,std_ex,ldu_ex,stu_ex + }; + } + public override void Reset() + { + m6809_reset(); + } + private void CHECK_IRQ_LINES() + { + if (irq_state[M6809_IRQ_LINE] != LineState.CLEAR_LINE || irq_state[M6809_FIRQ_LINE] != LineState.CLEAR_LINE) + int_state &= (byte)(~M6809_SYNC); + if (irq_state[M6809_FIRQ_LINE] != LineState.CLEAR_LINE && (CC & CC_IF) == 0) + { + if ((int_state & M6809_CWAI) != 0) + { + int_state &= (byte)(~M6809_CWAI); + extra_cycles += 7; + } + else + { + CC &= (byte)(~CC_E); + PUSHWORD(PC); + PUSHBYTE(CC); + extra_cycles += 10; + } + CC |= (byte)(CC_IF | CC_II); + PC.LowWord = RM16(0xfff6); + if (irq_callback != null) + { + irq_callback(M6809_FIRQ_LINE); + } + } + else if (irq_state[M6809_IRQ_LINE] != LineState.CLEAR_LINE && (CC & CC_II) == 0) + { + + if ((int_state & M6809_CWAI) != 0) + { + int_state &= (byte)(~M6809_CWAI); + extra_cycles += 7; + } + else + { + CC |= CC_E; + PUSHWORD(PC); + PUSHWORD(U); + PUSHWORD(Y); + PUSHWORD(X); + PUSHBYTE(DP.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(D.HighByte); + PUSHBYTE(CC); + extra_cycles += 19; + } + CC |= CC_II; + PC.LowWord = RM16(0xfff8); + if (irq_callback != null) + { + irq_callback(M6809_IRQ_LINE); + } + } + } + private byte IMMBYTE() + { + byte b = ReadOpArg(PC.LowWord); + PC.LowWord++; + return b; + } + private Register IMMWORD() + { + Register w = new Register(); + w.d = (uint)((ReadOpArg(PC.LowWord) << 8) | ReadOpArg((ushort)((PC.LowWord + 1) & 0xffff))); + PC.LowWord += 2; + return w; + } + private void PUSHBYTE(byte b) + { + --S.LowWord; + WM(S.LowWord, b); + } + private void PUSHWORD(Register w) + { + --S.LowWord; + WM(S.LowWord, w.LowByte); + --S.LowWord; + WM(S.LowWord, w.HighByte); + } + private byte PULLBYTE() + { + byte b; + b = RM(S.LowWord); + S.LowWord++; + return b; + } + private ushort PULLWORD() + { + ushort w; + w = (ushort)(RM(S.LowWord) << 8); + S.LowWord++; + w |= RM(S.LowWord); + S.LowWord++; + return w; + } + private void PSHUBYTE(byte b) + { + --U.LowWord; WM(U.LowWord, b); + } + private void PSHUWORD(Register w) + { + --U.LowWord; + WM(U.LowWord, w.LowByte); + --U.LowWord; + WM(U.LowWord, w.HighByte); + } + private byte PULUBYTE() + { + byte b; + b = RM(U.LowWord); + U.LowWord++; + return b; + } + private ushort PULUWORD() + { + ushort w; + w = (ushort)(RM(U.LowWord) << 8); + U.LowWord++; + w |= RM(U.LowWord); + U.LowWord++; + return w; + } + private void CLR_HNZVC() + { + CC &= (byte)(~(CC_H | CC_N | CC_Z | CC_V | CC_C)); + } + private void CLR_NZV() + { + CC &= (byte)(~(CC_N | CC_Z | CC_V)); + } + private void CLR_NZ() + { + CC &= (byte)(~(CC_N | CC_Z)); + } + private void CLR_HNZC() + { + CC &= (byte)(~(CC_H | CC_N | CC_Z | CC_C)); + } + private void CLR_NZVC() + { + CC &= (byte)(~(CC_N | CC_Z | CC_V | CC_C)); + } + private void CLR_Z() + { + CC &= (byte)(~(CC_Z)); + } + private void CLR_NZC() + { + CC &= (byte)(~(CC_N | CC_Z | CC_C)); + } + private void CLR_ZC() + { + CC &= (byte)(~(CC_Z | CC_C)); + } + private void SET_Z(uint a) + { + if (a == 0) + { + SEZ(); + } + } + private void SET_Z8(byte a) + { + if (a == 0) + { + SEZ(); + } + } + private void SET_Z16(ushort a) + { + if (a == 0) + { + SEZ(); + } + } + private void SET_N8(byte a) + { + CC |= (byte)((a & 0x80) >> 4); + } + private void SET_N16(ushort a) + { + CC |= (byte)((a & 0x8000) >> 12); + } + private void SET_H(byte a, byte b, byte r) + { + CC |= (byte)(((a ^ b ^ r) & 0x10) << 1); + } + private void SET_C8(ushort a) + { + CC |= (byte)((a & 0x100) >> 8); + } + private void SET_C16(uint a) + { + CC |= (byte)((a & 0x10000) >> 16); + } + private void SET_V8(byte a, ushort b, ushort r) + { + CC |= (byte)(((a ^ b ^ r ^ (r >> 1)) & 0x80) >> 6); + } + private void SET_V16(ushort a, ushort b, uint r) + { + CC |= (byte)(((a ^ b ^ r ^ (r >> 1)) & 0x8000) >> 14); + } + private void SET_FLAGS8I(byte a) + { + CC |= flags8i[(a) & 0xff]; + } + private void SET_FLAGS8D(byte a) + { + CC |= flags8d[(a) & 0xff]; + } + private void SET_NZ8(byte a) + { + SET_N8(a); + SET_Z(a); + } + private void SET_NZ16(ushort a) + { + SET_N16(a); + SET_Z(a); + } + private void SET_FLAGS8(byte a, ushort b, ushort r) + { + SET_N8((byte)r); + SET_Z8((byte)r); + SET_V8(a, b, r); + SET_C8(r); + } + private void SET_FLAGS16(ushort a, ushort b, uint r) + { + SET_N16((ushort)r); + SET_Z16((ushort)r); + SET_V16(a, b, r); + SET_C16(r); + } + private ushort SIGNED(byte b) + { + return (ushort)((b & 0x80) != 0 ? b | 0xff00 : b); + } + private void DIRECT() + { + EA.d = DP.d; + EA.LowByte = IMMBYTE(); + } + private void IMM8() + { + EA.d = PC.d; + PC.LowWord++; + } + private void IMM16() + { + EA.d = PC.d; + PC.LowWord += 2; + } + private void EXTENDED() + { + EA = IMMWORD(); + } + private void SEC() + { + CC |= CC_C; + } + private void CLC() + { + CC &= (byte)(~CC_C); + } + private void SEZ() + { + CC |= CC_Z; + } + private void CLZ() + { + CC &= (byte)(~CC_Z); + } + private void SEN() + { + CC |= CC_N; + } + private void CLN() + { + CC &= (byte)(~CC_N); + } + private void SEV() + { + CC |= CC_V; + } + private void CLV() + { + CC &= (byte)(~CC_V); + } + private void SEH() + { + CC |= CC_H; + } + private void CLH() + { + CC &= (byte)(~CC_H); + } + private byte DIRBYTE() + { + DIRECT(); + return RM(EA.LowWord); + } + private Register DIRWORD() + { + Register w = new Register(); + DIRECT(); + w.LowWord = RM16(EA.LowWord); + return w; + } + private byte EXTBYTE() + { + EXTENDED(); + return RM(EA.LowWord); + } + private Register EXTWORD() + { + Register w = new Register(); + EXTENDED(); + w.LowWord = RM16(EA.LowWord); + return w; + } + private void BRANCH(bool f) + { + byte t = IMMBYTE(); + if (f) + { + PC.LowWord += (ushort)SIGNED(t); + } + } + private void LBRANCH(bool f) + { + Register t = IMMWORD(); + if (f) + { + pendingCycles -= 1; + PC.LowWord += t.LowWord; + } + } + private byte NXORV() + { + return (byte)((CC & CC_N) ^ ((CC & CC_V) << 2)); + } + private ushort RM16(ushort Addr) + { + ushort result = (ushort)(RM(Addr) << 8); + return (ushort)(result | RM((ushort)((Addr + 1) & 0xffff))); + } + private void WM16(ushort Addr, Register p) + { + WM(Addr, p.HighByte); + WM((ushort)((Addr + 1) & 0xffff), p.LowByte); + } + private void m6809_reset() + { + int_state = 0; + nmi_state = LineState.CLEAR_LINE; + irq_state[0] = LineState.CLEAR_LINE; + irq_state[1] = LineState.CLEAR_LINE; + DP.d = 0; /* Reset direct page register */ + CC |= CC_II; /* IRQ disabled */ + CC |= CC_IF; /* FIRQ disabled */ + PC.LowWord = RM16(0xfffe); + } + public override void set_irq_line(int irqline, LineState state) + { + if (irqline == (int)LineState.INPUT_LINE_NMI) + { + if (nmi_state == state) + return; + nmi_state = state; + if (state == LineState.CLEAR_LINE) + return; + if ((int_state & M6809_LDS) == 0) + return; + int_state &= (byte)(~M6809_SYNC); + if ((int_state & M6809_CWAI) != 0) + { + int_state &= (byte)(~M6809_CWAI); + extra_cycles += 7; + } + else + { + CC |= CC_E; + PUSHWORD(PC); + PUSHWORD(U); + PUSHWORD(Y); + PUSHWORD(X); + PUSHBYTE(DP.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(D.HighByte); + PUSHBYTE(CC); + extra_cycles += 19; + } + CC |= (byte)(CC_IF | CC_II); + PC.LowWord = RM16(0xfffc); + } + else if (irqline < 2) + { + irq_state[irqline] = state; + if (state == LineState.CLEAR_LINE) + return; + CHECK_IRQ_LINES(); + } + } + public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) + { + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + public override int ExecuteCycles(int cycles) + { + pendingCycles = cycles - extra_cycles; + extra_cycles = 0; + if ((int_state & (M6809_CWAI | M6809_SYNC)) != 0) + { + pendingCycles = 0; + } + else + { + do + { + int prevCycles = pendingCycles; + PPC = PC; + ireg = ReadOp(PC.LowWord); + PC.LowWord++; + insn[ireg](); + pendingCycles -= cycles_6809[ireg]; + int delta = prevCycles - pendingCycles; + totalExecutedCycles += (ulong)delta; + } while (pendingCycles > 0); + + pendingCycles -= extra_cycles; + extra_cycles = 0; + } + return cycles - pendingCycles; + } + private void fetch_effective_address() + { + byte postbyte = ReadOpArg(PC.LowWord); + PC.LowWord++; + switch (postbyte) + { + case 0x00: EA.LowWord = X.LowWord; pendingCycles -= 1; break; + case 0x01: EA.LowWord = (ushort)(X.LowWord + 1); pendingCycles -= 1; break; + case 0x02: EA.LowWord = (ushort)(X.LowWord + 2); pendingCycles -= 1; break; + case 0x03: EA.LowWord = (ushort)(X.LowWord + 3); pendingCycles -= 1; break; + case 0x04: EA.LowWord = (ushort)(X.LowWord + 4); pendingCycles -= 1; break; + case 0x05: EA.LowWord = (ushort)(X.LowWord + 5); pendingCycles -= 1; break; + case 0x06: EA.LowWord = (ushort)(X.LowWord + 6); pendingCycles -= 1; break; + case 0x07: EA.LowWord = (ushort)(X.LowWord + 7); pendingCycles -= 1; break; + case 0x08: EA.LowWord = (ushort)(X.LowWord + 8); pendingCycles -= 1; break; + case 0x09: EA.LowWord = (ushort)(X.LowWord + 9); pendingCycles -= 1; break; + case 0x0a: EA.LowWord = (ushort)(X.LowWord + 10); pendingCycles -= 1; break; + case 0x0b: EA.LowWord = (ushort)(X.LowWord + 11); pendingCycles -= 1; break; + case 0x0c: EA.LowWord = (ushort)(X.LowWord + 12); pendingCycles -= 1; break; + case 0x0d: EA.LowWord = (ushort)(X.LowWord + 13); pendingCycles -= 1; break; + case 0x0e: EA.LowWord = (ushort)(X.LowWord + 14); pendingCycles -= 1; break; + case 0x0f: EA.LowWord = (ushort)(X.LowWord + 15); pendingCycles -= 1; break; + + case 0x10: EA.LowWord = (ushort)(X.LowWord - 16); pendingCycles -= 1; break; + case 0x11: EA.LowWord = (ushort)(X.LowWord - 15); pendingCycles -= 1; break; + case 0x12: EA.LowWord = (ushort)(X.LowWord - 14); pendingCycles -= 1; break; + case 0x13: EA.LowWord = (ushort)(X.LowWord - 13); pendingCycles -= 1; break; + case 0x14: EA.LowWord = (ushort)(X.LowWord - 12); pendingCycles -= 1; break; + case 0x15: EA.LowWord = (ushort)(X.LowWord - 11); pendingCycles -= 1; break; + case 0x16: EA.LowWord = (ushort)(X.LowWord - 10); pendingCycles -= 1; break; + case 0x17: EA.LowWord = (ushort)(X.LowWord - 9); pendingCycles -= 1; break; + case 0x18: EA.LowWord = (ushort)(X.LowWord - 8); pendingCycles -= 1; break; + case 0x19: EA.LowWord = (ushort)(X.LowWord - 7); pendingCycles -= 1; break; + case 0x1a: EA.LowWord = (ushort)(X.LowWord - 6); pendingCycles -= 1; break; + case 0x1b: EA.LowWord = (ushort)(X.LowWord - 5); pendingCycles -= 1; break; + case 0x1c: EA.LowWord = (ushort)(X.LowWord - 4); pendingCycles -= 1; break; + case 0x1d: EA.LowWord = (ushort)(X.LowWord - 3); pendingCycles -= 1; break; + case 0x1e: EA.LowWord = (ushort)(X.LowWord - 2); pendingCycles -= 1; break; + case 0x1f: EA.LowWord = (ushort)(X.LowWord - 1); pendingCycles -= 1; break; + + case 0x20: EA.LowWord = Y.LowWord; pendingCycles -= 1; break; + case 0x21: EA.LowWord = (ushort)(Y.LowWord + 1); pendingCycles -= 1; break; + case 0x22: EA.LowWord = (ushort)(Y.LowWord + 2); pendingCycles -= 1; break; + case 0x23: EA.LowWord = (ushort)(Y.LowWord + 3); pendingCycles -= 1; break; + case 0x24: EA.LowWord = (ushort)(Y.LowWord + 4); pendingCycles -= 1; break; + case 0x25: EA.LowWord = (ushort)(Y.LowWord + 5); pendingCycles -= 1; break; + case 0x26: EA.LowWord = (ushort)(Y.LowWord + 6); pendingCycles -= 1; break; + case 0x27: EA.LowWord = (ushort)(Y.LowWord + 7); pendingCycles -= 1; break; + case 0x28: EA.LowWord = (ushort)(Y.LowWord + 8); pendingCycles -= 1; break; + case 0x29: EA.LowWord = (ushort)(Y.LowWord + 9); pendingCycles -= 1; break; + case 0x2a: EA.LowWord = (ushort)(Y.LowWord + 10); pendingCycles -= 1; break; + case 0x2b: EA.LowWord = (ushort)(Y.LowWord + 11); pendingCycles -= 1; break; + case 0x2c: EA.LowWord = (ushort)(Y.LowWord + 12); pendingCycles -= 1; break; + case 0x2d: EA.LowWord = (ushort)(Y.LowWord + 13); pendingCycles -= 1; break; + case 0x2e: EA.LowWord = (ushort)(Y.LowWord + 14); pendingCycles -= 1; break; + case 0x2f: EA.LowWord = (ushort)(Y.LowWord + 15); pendingCycles -= 1; break; + + case 0x30: EA.LowWord = (ushort)(Y.LowWord - 16); pendingCycles -= 1; break; + case 0x31: EA.LowWord = (ushort)(Y.LowWord - 15); pendingCycles -= 1; break; + case 0x32: EA.LowWord = (ushort)(Y.LowWord - 14); pendingCycles -= 1; break; + case 0x33: EA.LowWord = (ushort)(Y.LowWord - 13); pendingCycles -= 1; break; + case 0x34: EA.LowWord = (ushort)(Y.LowWord - 12); pendingCycles -= 1; break; + case 0x35: EA.LowWord = (ushort)(Y.LowWord - 11); pendingCycles -= 1; break; + case 0x36: EA.LowWord = (ushort)(Y.LowWord - 10); pendingCycles -= 1; break; + case 0x37: EA.LowWord = (ushort)(Y.LowWord - 9); pendingCycles -= 1; break; + case 0x38: EA.LowWord = (ushort)(Y.LowWord - 8); pendingCycles -= 1; break; + case 0x39: EA.LowWord = (ushort)(Y.LowWord - 7); pendingCycles -= 1; break; + case 0x3a: EA.LowWord = (ushort)(Y.LowWord - 6); pendingCycles -= 1; break; + case 0x3b: EA.LowWord = (ushort)(Y.LowWord - 5); pendingCycles -= 1; break; + case 0x3c: EA.LowWord = (ushort)(Y.LowWord - 4); pendingCycles -= 1; break; + case 0x3d: EA.LowWord = (ushort)(Y.LowWord - 3); pendingCycles -= 1; break; + case 0x3e: EA.LowWord = (ushort)(Y.LowWord - 2); pendingCycles -= 1; break; + case 0x3f: EA.LowWord = (ushort)(Y.LowWord - 1); pendingCycles -= 1; break; + + case 0x40: EA.LowWord = U.LowWord; pendingCycles -= 1; break; + case 0x41: EA.LowWord = (ushort)(U.LowWord + 1); pendingCycles -= 1; break; + case 0x42: EA.LowWord = (ushort)(U.LowWord + 2); pendingCycles -= 1; break; + case 0x43: EA.LowWord = (ushort)(U.LowWord + 3); pendingCycles -= 1; break; + case 0x44: EA.LowWord = (ushort)(U.LowWord + 4); pendingCycles -= 1; break; + case 0x45: EA.LowWord = (ushort)(U.LowWord + 5); pendingCycles -= 1; break; + case 0x46: EA.LowWord = (ushort)(U.LowWord + 6); pendingCycles -= 1; break; + case 0x47: EA.LowWord = (ushort)(U.LowWord + 7); pendingCycles -= 1; break; + case 0x48: EA.LowWord = (ushort)(U.LowWord + 8); pendingCycles -= 1; break; + case 0x49: EA.LowWord = (ushort)(U.LowWord + 9); pendingCycles -= 1; break; + case 0x4a: EA.LowWord = (ushort)(U.LowWord + 10); pendingCycles -= 1; break; + case 0x4b: EA.LowWord = (ushort)(U.LowWord + 11); pendingCycles -= 1; break; + case 0x4c: EA.LowWord = (ushort)(U.LowWord + 12); pendingCycles -= 1; break; + case 0x4d: EA.LowWord = (ushort)(U.LowWord + 13); pendingCycles -= 1; break; + case 0x4e: EA.LowWord = (ushort)(U.LowWord + 14); pendingCycles -= 1; break; + case 0x4f: EA.LowWord = (ushort)(U.LowWord + 15); pendingCycles -= 1; break; + + case 0x50: EA.LowWord = (ushort)(U.LowWord - 16); pendingCycles -= 1; break; + case 0x51: EA.LowWord = (ushort)(U.LowWord - 15); pendingCycles -= 1; break; + case 0x52: EA.LowWord = (ushort)(U.LowWord - 14); pendingCycles -= 1; break; + case 0x53: EA.LowWord = (ushort)(U.LowWord - 13); pendingCycles -= 1; break; + case 0x54: EA.LowWord = (ushort)(U.LowWord - 12); pendingCycles -= 1; break; + case 0x55: EA.LowWord = (ushort)(U.LowWord - 11); pendingCycles -= 1; break; + case 0x56: EA.LowWord = (ushort)(U.LowWord - 10); pendingCycles -= 1; break; + case 0x57: EA.LowWord = (ushort)(U.LowWord - 9); pendingCycles -= 1; break; + case 0x58: EA.LowWord = (ushort)(U.LowWord - 8); pendingCycles -= 1; break; + case 0x59: EA.LowWord = (ushort)(U.LowWord - 7); pendingCycles -= 1; break; + case 0x5a: EA.LowWord = (ushort)(U.LowWord - 6); pendingCycles -= 1; break; + case 0x5b: EA.LowWord = (ushort)(U.LowWord - 5); pendingCycles -= 1; break; + case 0x5c: EA.LowWord = (ushort)(U.LowWord - 4); pendingCycles -= 1; break; + case 0x5d: EA.LowWord = (ushort)(U.LowWord - 3); pendingCycles -= 1; break; + case 0x5e: EA.LowWord = (ushort)(U.LowWord - 2); pendingCycles -= 1; break; + case 0x5f: EA.LowWord = (ushort)(U.LowWord - 1); pendingCycles -= 1; break; + + case 0x60: EA.LowWord = S.LowWord; pendingCycles -= 1; break; + case 0x61: EA.LowWord = (ushort)(S.LowWord + 1); pendingCycles -= 1; break; + case 0x62: EA.LowWord = (ushort)(S.LowWord + 2); pendingCycles -= 1; break; + case 0x63: EA.LowWord = (ushort)(S.LowWord + 3); pendingCycles -= 1; break; + case 0x64: EA.LowWord = (ushort)(S.LowWord + 4); pendingCycles -= 1; break; + case 0x65: EA.LowWord = (ushort)(S.LowWord + 5); pendingCycles -= 1; break; + case 0x66: EA.LowWord = (ushort)(S.LowWord + 6); pendingCycles -= 1; break; + case 0x67: EA.LowWord = (ushort)(S.LowWord + 7); pendingCycles -= 1; break; + case 0x68: EA.LowWord = (ushort)(S.LowWord + 8); pendingCycles -= 1; break; + case 0x69: EA.LowWord = (ushort)(S.LowWord + 9); pendingCycles -= 1; break; + case 0x6a: EA.LowWord = (ushort)(S.LowWord + 10); pendingCycles -= 1; break; + case 0x6b: EA.LowWord = (ushort)(S.LowWord + 11); pendingCycles -= 1; break; + case 0x6c: EA.LowWord = (ushort)(S.LowWord + 12); pendingCycles -= 1; break; + case 0x6d: EA.LowWord = (ushort)(S.LowWord + 13); pendingCycles -= 1; break; + case 0x6e: EA.LowWord = (ushort)(S.LowWord + 14); pendingCycles -= 1; break; + case 0x6f: EA.LowWord = (ushort)(S.LowWord + 15); pendingCycles -= 1; break; + + case 0x70: EA.LowWord = (ushort)(S.LowWord - 16); pendingCycles -= 1; break; + case 0x71: EA.LowWord = (ushort)(S.LowWord - 15); pendingCycles -= 1; break; + case 0x72: EA.LowWord = (ushort)(S.LowWord - 14); pendingCycles -= 1; break; + case 0x73: EA.LowWord = (ushort)(S.LowWord - 13); pendingCycles -= 1; break; + case 0x74: EA.LowWord = (ushort)(S.LowWord - 12); pendingCycles -= 1; break; + case 0x75: EA.LowWord = (ushort)(S.LowWord - 11); pendingCycles -= 1; break; + case 0x76: EA.LowWord = (ushort)(S.LowWord - 10); pendingCycles -= 1; break; + case 0x77: EA.LowWord = (ushort)(S.LowWord - 9); pendingCycles -= 1; break; + case 0x78: EA.LowWord = (ushort)(S.LowWord - 8); pendingCycles -= 1; break; + case 0x79: EA.LowWord = (ushort)(S.LowWord - 7); pendingCycles -= 1; break; + case 0x7a: EA.LowWord = (ushort)(S.LowWord - 6); pendingCycles -= 1; break; + case 0x7b: EA.LowWord = (ushort)(S.LowWord - 5); pendingCycles -= 1; break; + case 0x7c: EA.LowWord = (ushort)(S.LowWord - 4); pendingCycles -= 1; break; + case 0x7d: EA.LowWord = (ushort)(S.LowWord - 3); pendingCycles -= 1; break; + case 0x7e: EA.LowWord = (ushort)(S.LowWord - 2); pendingCycles -= 1; break; + case 0x7f: EA.LowWord = (ushort)(S.LowWord - 1); pendingCycles -= 1; break; + + case 0x80: EA.LowWord = X.LowWord; X.LowWord++; pendingCycles -= 2; break; + case 0x81: EA.LowWord = X.LowWord; X.LowWord += 2; pendingCycles -= 3; break; + case 0x82: X.LowWord--; EA.LowWord = X.LowWord; pendingCycles -= 2; break; + case 0x83: X.LowWord -= 2; EA.LowWord = X.LowWord; pendingCycles -= 3; break; + case 0x84: EA.LowWord = X.LowWord; break; + case 0x85: EA.LowWord = (ushort)(X.LowWord + SIGNED(D.LowByte)); pendingCycles -= 1; break; + case 0x86: EA.LowWord = (ushort)(X.LowWord + SIGNED(D.HighByte)); pendingCycles -= 1; break; + case 0x87: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0x88: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(X.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; /* this is a hack to make Vectrex work. It should be m6809_ICount-=1. Dunno where the cycle was lost :( */ + case 0x89: EA = IMMWORD(); EA.LowWord += X.LowWord; pendingCycles -= 4; break; + case 0x8a: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0x8b: EA.LowWord = (ushort)(X.LowWord + D.LowWord); pendingCycles -= 4; break; + case 0x8c: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; + case 0x8d: EA = IMMWORD(); EA.LowWord += PC.LowWord; pendingCycles -= 5; break; + case 0x8e: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0x8f: EA = IMMWORD(); pendingCycles -= 5; break; + + case 0x90: EA.LowWord = X.LowWord; X.LowWord++; EA.d = RM16(EA.LowWord); pendingCycles -= 5; break; /* Indirect ,R+ not in my specs */ + case 0x91: EA.LowWord = X.LowWord; X.LowWord += 2; EA.d = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0x92: X.LowWord--; EA.LowWord = X.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 5; break; + case 0x93: X.LowWord -= 2; EA.LowWord = X.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0x94: EA.LowWord = X.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 3; break; + case 0x95: EA.LowWord = (ushort)(X.LowWord + SIGNED(D.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0x96: EA.LowWord = (ushort)(X.LowWord + SIGNED(D.HighByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0x97: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0x98: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(X.LowWord + SIGNED(EA.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0x99: EA = IMMWORD(); EA.LowWord += X.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0x9a: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0x9b: EA.LowWord = (ushort)(X.LowWord + D.LowWord); EA.d = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0x9c: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0x9d: EA = IMMWORD(); EA.LowWord += PC.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + case 0x9e: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0x9f: EA = IMMWORD(); EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + + case 0xa0: EA.LowWord = Y.LowWord; Y.LowWord++; pendingCycles -= 2; break; + case 0xa1: EA.LowWord = Y.LowWord; Y.LowWord += 2; pendingCycles -= 3; break; + case 0xa2: Y.LowWord--; EA.LowWord = Y.LowWord; pendingCycles -= 2; break; + case 0xa3: Y.LowWord -= 2; EA.LowWord = Y.LowWord; pendingCycles -= 3; break; + case 0xa4: EA.LowWord = Y.LowWord; break; + case 0xa5: EA.LowWord = (ushort)(Y.LowWord + SIGNED(D.LowByte)); pendingCycles -= 1; break; + case 0xa6: EA.LowWord = (ushort)(Y.LowWord + SIGNED(D.HighByte)); pendingCycles -= 1; break; + case 0xa7: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0xa8: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(Y.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; + case 0xa9: EA = IMMWORD(); EA.LowWord += Y.LowWord; pendingCycles -= 4; break; + case 0xaa: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0xab: EA.LowWord = (ushort)(Y.LowWord + D.LowWord); pendingCycles -= 4; break; + case 0xac: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; + case 0xad: EA = IMMWORD(); EA.LowWord += PC.LowWord; pendingCycles -= 5; break; + case 0xae: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0xaf: EA = IMMWORD(); pendingCycles -= 5; break; + + case 0xb0: EA.LowWord = Y.LowWord; Y.LowWord++; EA.LowWord = RM16(EA.LowWord); pendingCycles -= 5; break; + case 0xb1: EA.LowWord = Y.LowWord; Y.LowWord += 2; EA.LowWord = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0xb2: Y.LowWord--; EA.LowWord = Y.LowWord; EA.LowWord = RM16(EA.LowWord); pendingCycles -= 5; break; + case 0xb3: Y.LowWord -= 2; EA.LowWord = Y.LowWord; EA.LowWord = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0xb4: EA.LowWord = Y.LowWord; EA.LowWord = RM16(EA.LowWord); pendingCycles -= 3; break; + case 0xb5: EA.LowWord = (ushort)(Y.LowWord + SIGNED(D.LowByte)); EA.LowWord = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xb6: EA.LowWord = (ushort)(Y.LowWord + SIGNED(D.HighByte)); EA.LowWord = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xb7: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0xb8: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(Y.LowWord + SIGNED(EA.LowByte)); EA.LowWord = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xb9: EA = IMMWORD(); EA.LowWord += Y.LowWord; EA.LowWord = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0xba: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0xbb: EA.LowWord = (ushort)(Y.LowWord + D.LowWord); EA.d = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0xbc: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xbd: EA = IMMWORD(); EA.LowWord += PC.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + case 0xbe: EA.LowWord = 0; break; /* ILLEGAL*/ + case 0xbf: EA = IMMWORD(); EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + + case 0xc0: EA.LowWord = U.LowWord; U.LowWord++; pendingCycles -= 2; break; + case 0xc1: EA.LowWord = U.LowWord; U.LowWord += 2; pendingCycles -= 3; break; + case 0xc2: U.LowWord--; EA.LowWord = U.LowWord; pendingCycles -= 2; break; + case 0xc3: U.LowWord -= 2; EA.LowWord = U.LowWord; pendingCycles -= 3; break; + case 0xc4: EA.LowWord = U.LowWord; break; + case 0xc5: EA.LowWord = (ushort)(U.LowWord + SIGNED(D.LowByte)); pendingCycles -= 1; break; + case 0xc6: EA.LowWord = (ushort)(U.LowWord + SIGNED(D.HighByte)); pendingCycles -= 1; break; + case 0xc7: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xc8: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(U.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; + case 0xc9: EA = IMMWORD(); EA.LowWord += U.LowWord; pendingCycles -= 4; break; + case 0xca: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xcb: EA.LowWord = (ushort)(U.LowWord + D.LowWord); pendingCycles -= 4; break; + case 0xcc: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; + case 0xcd: EA = IMMWORD(); EA.LowWord += PC.LowWord; pendingCycles -= 5; break; + case 0xce: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xcf: EA = IMMWORD(); pendingCycles -= 5; break; + + case 0xd0: EA.LowWord = U.LowWord; U.LowWord++; EA.d = RM16(EA.LowWord); pendingCycles -= 5; break; + case 0xd1: EA.LowWord = U.LowWord; U.LowWord += 2; EA.d = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0xd2: U.LowWord--; EA.LowWord = U.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 5; break; + case 0xd3: U.LowWord -= 2; EA.LowWord = U.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0xd4: EA.LowWord = U.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 3; break; + case 0xd5: EA.LowWord = (ushort)(U.LowWord + SIGNED(D.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xd6: EA.LowWord = (ushort)(U.LowWord + SIGNED(D.HighByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xd7: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xd8: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(U.LowWord + SIGNED(EA.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xd9: EA = IMMWORD(); EA.LowWord += U.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0xda: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xdb: EA.LowWord = (ushort)(U.LowWord + D.LowWord); EA.d = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0xdc: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xdd: EA = IMMWORD(); EA.LowWord += PC.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + case 0xde: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xdf: EA = IMMWORD(); EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + + case 0xe0: EA.LowWord = S.LowWord; S.LowWord++; pendingCycles -= 2; break; + case 0xe1: EA.LowWord = S.LowWord; S.LowWord += 2; pendingCycles -= 3; break; + case 0xe2: S.LowWord--; EA.LowWord = S.LowWord; pendingCycles -= 2; break; + case 0xe3: S.LowWord -= 2; EA.LowWord = S.LowWord; pendingCycles -= 3; break; + case 0xe4: EA.LowWord = S.LowWord; break; + case 0xe5: EA.LowWord = (ushort)(S.LowWord + SIGNED(D.LowByte)); pendingCycles -= 1; break; + case 0xe6: EA.LowWord = (ushort)(S.LowWord + SIGNED(D.HighByte)); pendingCycles -= 1; break; + case 0xe7: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xe8: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(S.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; + case 0xe9: EA = IMMWORD(); EA.LowWord += S.LowWord; pendingCycles -= 4; break; + case 0xea: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xeb: EA.LowWord = (ushort)(S.LowWord + D.LowWord); pendingCycles -= 4; break; + case 0xec: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); pendingCycles -= 1; break; + case 0xed: EA = IMMWORD(); EA.LowWord += PC.LowWord; pendingCycles -= 5; break; + case 0xee: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xef: EA = IMMWORD(); pendingCycles -= 5; break; + + case 0xf0: EA.LowWord = S.LowWord; S.LowWord++; EA.d = RM16(EA.LowWord); pendingCycles -= 5; break; + case 0xf1: EA.LowWord = S.LowWord; S.LowWord += 2; EA.d = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0xf2: S.LowWord--; EA.LowWord = S.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 5; break; + case 0xf3: S.LowWord -= 2; EA.LowWord = S.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 6; break; + case 0xf4: EA.LowWord = S.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 3; break; + case 0xf5: EA.LowWord = (ushort)(S.LowWord + SIGNED(D.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xf6: EA.LowWord = (ushort)(S.LowWord + SIGNED(D.HighByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xf7: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xf8: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(S.LowWord + SIGNED(EA.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xf9: EA = IMMWORD(); EA.LowWord += S.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0xfa: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xfb: EA.LowWord = (ushort)(S.LowWord + D.LowWord); EA.d = RM16(EA.LowWord); pendingCycles -= 7; break; + case 0xfc: EA.LowWord = IMMBYTE(); EA.LowWord = (ushort)(PC.LowWord + SIGNED(EA.LowByte)); EA.d = RM16(EA.LowWord); pendingCycles -= 4; break; + case 0xfd: EA = IMMWORD(); EA.LowWord += PC.LowWord; EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + case 0xfe: EA.LowWord = 0; break; /*ILLEGAL*/ + case 0xff: EA = IMMWORD(); EA.d = RM16(EA.LowWord); pendingCycles -= 8; break; + } + } + public void SaveStateBinary(BinaryWriter writer) + { + writer.Write(PC.LowWord); + writer.Write(PPC.LowWord); + writer.Write(D.LowWord); + writer.Write(DP.LowWord); + writer.Write(U.LowWord); + writer.Write(S.LowWord); + writer.Write(X.LowWord); + writer.Write(Y.LowWord); + writer.Write(CC); + writer.Write((byte)irq_state[0]); + writer.Write((byte)irq_state[1]); + writer.Write(int_state); + writer.Write((byte)nmi_state); + writer.Write(TotalExecutedCycles); + writer.Write(PendingCycles); + } + public void LoadStateBinary(BinaryReader reader) + { + PC.LowWord = reader.ReadUInt16(); + PPC.LowWord = reader.ReadUInt16(); + D.LowWord = reader.ReadUInt16(); + DP.LowWord = reader.ReadUInt16(); + U.LowWord = reader.ReadUInt16(); + S.LowWord = reader.ReadUInt16(); + X.LowWord = reader.ReadUInt16(); + Y.LowWord = reader.ReadUInt16(); + CC = reader.ReadByte(); + irq_state[0] = (LineState)reader.ReadByte(); + irq_state[1] = (LineState)reader.ReadByte(); + int_state = reader.ReadByte(); + nmi_state = (LineState)reader.ReadByte(); + TotalExecutedCycles = reader.ReadUInt64(); + PendingCycles = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809.cs.meta new file mode 100644 index 00000000..f34b5942 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 727532af9b9469442a63c74022c8905b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809op.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809op.cs new file mode 100644 index 00000000..614303a8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809op.cs @@ -0,0 +1,2394 @@ +using MAME.Core; + +namespace cpu.m6809 +{ + public partial class M6809 + { + void illegal() + { + + } + void neg_di() + { + ushort r, t; + t = DIRBYTE(); + r = (ushort)(-t); + CLR_NZVC(); + SET_FLAGS8(0, t, r); + WM(EA.LowWord, (byte)r); + } + void com_di() + { + byte t; + t = DIRBYTE(); + t = (byte)(~t); + CLR_NZV(); + SET_NZ8(t); + SEC(); + WM(EA.LowWord, t); + } + void lsr_di() + { + byte t; + t = DIRBYTE(); + CLR_NZC(); + CC |= (byte)(t & CC_C); + t >>= 1; + SET_Z8(t); + WM(EA.LowWord, t); + } + void ror_di() + { + byte t, r; + t = DIRBYTE(); + r = (byte)((CC & CC_C) << 7); + CLR_NZC(); + CC |= (byte)(t & CC_C); + r |= (byte)(t >> 1); + SET_NZ8(r); + WM(EA.LowWord, r); + } + void asr_di() + { + byte t; + t = DIRBYTE(); + CLR_NZC(); + CC |= (byte)(t & CC_C); + t = (byte)((t & 0x80) | (t >> 1)); + SET_NZ8(t); + WM(EA.LowWord, t); + } + void asl_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + WM(EA.LowWord, (byte)r); + } + void rol_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)((CC & CC_C) | (t << 1)); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + WM(EA.LowWord, (byte)r); + } + void dec_di() + { + byte t; + t = DIRBYTE(); + --t; + CLR_NZV(); + SET_FLAGS8D(t); + WM(EA.LowWord, t); + } + void inc_di() + { + byte t; + t = DIRBYTE(); + ++t; + CLR_NZV(); + SET_FLAGS8I(t); + WM(EA.LowWord, t); + } + void tst_di() + { + byte t; + t = DIRBYTE(); + CLR_NZV(); + SET_NZ8(t); + } + void jmp_di() + { + DIRECT(); + PC.d = EA.d; + //CHANGE_PC; + } + void clr_di() + { + DIRECT(); + RM(EA.LowWord); + WM(EA.LowWord, 0); + CLR_NZVC(); + SEZ(); + } + void nop() + { + + } + void sync() + { + int_state |= M6809_SYNC; + CHECK_IRQ_LINES(); + if ((int_state & M6809_SYNC) != 0) + if (pendingCycles > 0) pendingCycles = 0; + } + void lbra() + { + EA = IMMWORD(); + PC.LowWord += EA.LowWord; + //CHANGE_PC; + if (EA.LowWord == 0xfffd) + if (pendingCycles > 0) + pendingCycles = 0; + } + void lbsr() + { + EA = IMMWORD(); + PUSHWORD(PC); + PC.LowWord += EA.LowWord; + //CHANGE_PC; + } + void daa() + { + byte msn, lsn; + ushort t, cf = 0; + msn = (byte)(D.HighByte & 0xf0); + lsn = (byte)(D.HighByte & 0x0f); + if (lsn > 0x09 || (CC & CC_H) != 0) + cf |= 0x06; + if (msn > 0x80 && lsn > 0x09) + cf |= 0x60; + if (msn > 0x90 || (CC & CC_C) != 0) + cf |= 0x60; + t = (ushort)(cf + D.HighByte); + CLR_NZV(); + SET_NZ8((byte)t); + SET_C8(t); + D.HighByte = (byte)t; + } + void orcc() + { + byte t; + t = IMMBYTE(); + CC |= t; + CHECK_IRQ_LINES(); + } + void andcc() + { + byte t; + t = IMMBYTE(); + CC &= t; + CHECK_IRQ_LINES(); + } + void sex() + { + ushort t; + t = SIGNED(D.LowByte); + D.LowWord = t; + CLR_NZ(); + SET_NZ16(t); + } + void exg() + { + ushort t1, t2; + byte tb; + tb = IMMBYTE(); + if (((tb ^ (tb >> 4)) & 0x08) != 0) + { + t1 = t2 = 0xff; + } + else + { + switch (tb >> 4) + { + case 0: t1 = D.LowWord; break; + case 1: t1 = X.LowWord; break; + case 2: t1 = Y.LowWord; break; + case 3: t1 = U.LowWord; break; + case 4: t1 = S.LowWord; break; + case 5: t1 = PC.LowWord; break; + case 8: t1 = D.HighByte; break; + case 9: t1 = D.LowByte; break; + case 10: t1 = CC; break; + case 11: t1 = DP.HighByte; break; + default: t1 = 0xff; break; + } + switch (tb & 15) + { + case 0: t2 = D.LowWord; break; + case 1: t2 = X.LowWord; break; + case 2: t2 = Y.LowWord; break; + case 3: t2 = U.LowWord; break; + case 4: t2 = S.LowWord; break; + case 5: t2 = PC.LowWord; break; + case 8: t2 = D.HighByte; break; + case 9: t2 = D.LowByte; break; + case 10: t2 = CC; break; + case 11: t2 = DP.HighByte; break; + default: t2 = 0xff; break; + } + } + switch (tb >> 4) + { + case 0: D.LowWord = t2; break; + case 1: X.LowWord = t2; break; + case 2: Y.LowWord = t2; break; + case 3: U.LowWord = t2; break; + case 4: S.LowWord = t2; break; + case 5: PC.LowWord = t2; break; + case 8: D.HighByte = (byte)t2; break; + case 9: D.LowByte = (byte)t2; break; + case 10: CC = (byte)t2; break; + case 11: DP.HighByte = (byte)t2; break; + } + switch (tb & 15) + { + case 0: D.LowWord = t1; break; + case 1: X.LowWord = t1; break; + case 2: Y.LowWord = t1; break; + case 3: U.LowWord = t1; break; + case 4: S.LowWord = t1; break; + case 5: PC.LowWord = t1; break; + case 8: D.HighByte = (byte)t1; break; + case 9: D.LowByte = (byte)t1; break; + case 10: CC = (byte)t1; break; + case 11: DP.HighByte = (byte)t1; break; + } + } + void tfr() + { + byte tb; + ushort t; + tb = IMMBYTE(); + if (((tb ^ (tb >> 4)) & 0x08) != 0) + { + t = 0xff; + } + else + { + switch (tb >> 4) + { + case 0: t = D.LowWord; break; + case 1: t = X.LowWord; break; + case 2: t = Y.LowWord; break; + case 3: t = U.LowWord; break; + case 4: t = S.LowWord; break; + case 5: t = PC.LowWord; break; + case 8: t = D.HighByte; break; + case 9: t = D.LowByte; break; + case 10: t = CC; break; + case 11: t = DP.HighByte; break; + default: t = 0xff; break; + } + } + switch (tb & 15) + { + case 0: D.LowWord = t; break; + case 1: X.LowWord = t; break; + case 2: Y.LowWord = t; break; + case 3: U.LowWord = t; break; + case 4: S.LowWord = t; break; + case 5: PC.LowWord = t; break; + case 8: D.HighByte = (byte)t; break; + case 9: D.LowByte = (byte)t; break; + case 10: CC = (byte)t; break; + case 11: DP.HighByte = (byte)t; break; + } + } + void bra() + { + byte t; + t = IMMBYTE(); + PC.LowWord += SIGNED(t); + if (t == 0xfe) + if (pendingCycles > 0) + pendingCycles = 0; + } + void brn() + { + byte t; + t = IMMBYTE(); + } + void lbrn() + { + EA = IMMWORD(); + } + void bhi() + { + BRANCH((CC & (CC_Z | CC_C)) == 0); + } + void lbhi() + { + LBRANCH((CC & (CC_Z | CC_C)) == 0); + } + void bls() + { + BRANCH((CC & (CC_Z | CC_C)) != 0); + } + void lbls() + { + LBRANCH((CC & (CC_Z | CC_C)) != 0); + } + void bcc() + { + BRANCH((CC & CC_C) == 0); + } + void lbcc() + { + LBRANCH((CC & CC_C) == 0); + } + void bcs() + { + BRANCH((CC & CC_C) != 0); + } + void lbcs() + { + LBRANCH((CC & CC_C) != 0); + } + void bne() + { + BRANCH((CC & CC_Z) == 0); + } + void lbne() + { + LBRANCH((CC & CC_Z) == 0); + } + void beq() + { + BRANCH((CC & CC_Z) != 0); + } + void lbeq() + { + LBRANCH((CC & CC_Z) != 0); + } + void bvc() + { + BRANCH((CC & CC_V) == 0); + } + void lbvc() + { + LBRANCH((CC & CC_V) == 0); + } + void bvs() + { + BRANCH((CC & CC_V) != 0); + } + void lbvs() + { + LBRANCH((CC & CC_V) != 0); + } + void bpl() + { + BRANCH((CC & CC_N) == 0); + } + void lbpl() + { + LBRANCH((CC & CC_N) == 0); + } + void bmi() + { + BRANCH((CC & CC_N) != 0); + } + void lbmi() + { + LBRANCH((CC & CC_N) != 0); + } + void bge() + { + BRANCH(NXORV() == 0); + } + void lbge() + { + LBRANCH(NXORV() == 0); + } + void blt() + { + BRANCH(NXORV() != 0); + } + void lblt() + { + LBRANCH(NXORV() != 0); + } + void bgt() + { + BRANCH(!(NXORV() != 0 || (CC & CC_Z) != 0)); + } + void lbgt() + { + LBRANCH(!(NXORV() != 0 || (CC & CC_Z) != 0)); + } + void ble() + { + BRANCH(NXORV() != 0 || (CC & CC_Z) != 0); + } + void lble() + { + LBRANCH(NXORV() != 0 || (CC & CC_Z) != 0); + } + void leax() + { + fetch_effective_address(); + X.LowWord = EA.LowWord; + CLR_Z(); + SET_Z(X.LowWord); + } + void leay() + { + fetch_effective_address(); + Y.LowWord = EA.LowWord; + CLR_Z(); + SET_Z(Y.LowWord); + } + void leas() + { + fetch_effective_address(); + S.LowWord = EA.LowWord; + int_state |= M6809_LDS; + } + void leau() + { + fetch_effective_address(); + U.LowWord = EA.LowWord; + } + void pshs() + { + byte t; + t = IMMBYTE(); + if ((t & 0x80) != 0) { PUSHWORD(PC); pendingCycles -= 2; } + if ((t & 0x40) != 0) { PUSHWORD(U); pendingCycles -= 2; } + if ((t & 0x20) != 0) { PUSHWORD(Y); pendingCycles -= 2; } + if ((t & 0x10) != 0) { PUSHWORD(X); pendingCycles -= 2; } + if ((t & 0x08) != 0) { PUSHBYTE(DP.HighByte); pendingCycles -= 1; } + if ((t & 0x04) != 0) { PUSHBYTE(D.LowByte); pendingCycles -= 1; } + if ((t & 0x02) != 0) { PUSHBYTE(D.HighByte); pendingCycles -= 1; } + if ((t & 0x01) != 0) { PUSHBYTE(CC); pendingCycles -= 1; } + } + void puls() + { + byte t; + t = IMMBYTE(); + if ((t & 0x01) != 0) { CC = PULLBYTE(); pendingCycles -= 1; } + if ((t & 0x02) != 0) { D.HighByte = PULLBYTE(); pendingCycles -= 1; } + if ((t & 0x04) != 0) { D.LowByte = PULLBYTE(); pendingCycles -= 1; } + if ((t & 0x08) != 0) { DP.HighByte = PULLBYTE(); pendingCycles -= 1; } + if ((t & 0x10) != 0) { X.d = PULLWORD(); pendingCycles -= 2; } + if ((t & 0x20) != 0) { Y.d = PULLWORD(); pendingCycles -= 2; } + if ((t & 0x40) != 0) { U.d = PULLWORD(); pendingCycles -= 2; } + if ((t & 0x80) != 0) { PC.d = PULLWORD(); pendingCycles -= 2; } + if ((t & 0x01) != 0) { CHECK_IRQ_LINES(); } + } + void pshu() + { + byte t; + t = IMMBYTE(); + if ((t & 0x80) != 0) { PSHUWORD(PC); pendingCycles -= 2; } + if ((t & 0x40) != 0) { PSHUWORD(S); pendingCycles -= 2; } + if ((t & 0x20) != 0) { PSHUWORD(Y); pendingCycles -= 2; } + if ((t & 0x10) != 0) { PSHUWORD(X); pendingCycles -= 2; } + if ((t & 0x08) != 0) { PSHUBYTE(DP.HighByte); pendingCycles -= 1; } + if ((t & 0x04) != 0) { PSHUBYTE(D.LowByte); pendingCycles -= 1; } + if ((t & 0x02) != 0) { PSHUBYTE(D.HighByte); pendingCycles -= 1; } + if ((t & 0x01) != 0) { PSHUBYTE(CC); pendingCycles -= 1; } + } + void pulu() + { + byte t; + t = IMMBYTE(); + if ((t & 0x01) != 0) { CC = PULUBYTE(); pendingCycles -= 1; } + if ((t & 0x02) != 0) { D.HighByte = PULUBYTE(); pendingCycles -= 1; } + if ((t & 0x04) != 0) { D.LowByte = PULUBYTE(); pendingCycles -= 1; } + if ((t & 0x08) != 0) { DP.HighByte = PULUBYTE(); pendingCycles -= 1; } + if ((t & 0x10) != 0) { X.d = PULUWORD(); pendingCycles -= 2; } + if ((t & 0x20) != 0) { Y.d = PULUWORD(); pendingCycles -= 2; } + if ((t & 0x40) != 0) { S.d = PULUWORD(); pendingCycles -= 2; } + if ((t & 0x80) != 0) { PC.d = PULUWORD(); pendingCycles -= 2; } + if ((t & 0x01) != 0) { CHECK_IRQ_LINES(); } + } + void rts() + { + PC.d = PULLWORD(); + //CHANGE_PC; + } + void abx() + { + X.LowWord += D.LowByte; + } + void rti() + { + byte t; + CC = PULLBYTE(); + t = (byte)(CC & CC_E); + if (t != 0) + { + pendingCycles -= 9; + D.HighByte = PULLBYTE(); + D.LowByte = PULLBYTE(); + DP.HighByte = PULLBYTE(); + X.d = PULLWORD(); + Y.d = PULLWORD(); + U.d = PULLWORD(); + } + PC.d = PULLWORD(); + //CHANGE_PC; + CHECK_IRQ_LINES(); + } + void cwai() + { + byte t; + t = IMMBYTE(); + CC &= t; + CC |= CC_E; + PUSHWORD(PC); + PUSHWORD(U); + PUSHWORD(Y); + PUSHWORD(X); + PUSHBYTE(DP.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(D.HighByte); + PUSHBYTE(CC); + int_state |= M6809_CWAI; + CHECK_IRQ_LINES(); + if ((int_state & M6809_CWAI) != 0) + if (pendingCycles > 0) + pendingCycles = 0; + } + void mul() + { + ushort t; + t = (ushort)(D.HighByte * D.LowByte); + CLR_ZC(); + SET_Z16(t); + if ((t & 0x80) != 0) + SEC(); + D.LowWord = t; + } + void swi() + { + CC |= CC_E; + PUSHWORD(PC); + PUSHWORD(U); + PUSHWORD(Y); + PUSHWORD(X); + PUSHBYTE(DP.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(D.HighByte); + PUSHBYTE(CC); + CC |= (byte)(CC_IF | CC_II); + PC.d = RM16(0xfffa); + //CHANGE_PC; + } + void swi2() + { + CC |= CC_E; + PUSHWORD(PC); + PUSHWORD(U); + PUSHWORD(Y); + PUSHWORD(X); + PUSHBYTE(DP.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(D.HighByte); + PUSHBYTE(CC); + PC.d = RM16(0xfff4); + //CHANGE_PC; + } + void swi3() + { + CC |= CC_E; + PUSHWORD(PC); + PUSHWORD(U); + PUSHWORD(Y); + PUSHWORD(X); + PUSHBYTE(DP.HighByte); + PUSHBYTE(D.LowByte); + PUSHBYTE(D.HighByte); + PUSHBYTE(CC); + PC.d = RM16(0xfff2); + //CHANGE_PC; + } + void nega() + { + ushort r; + r = (ushort)(-D.HighByte); + CLR_NZVC(); + SET_FLAGS8(0, D.HighByte, r); + D.HighByte = (byte)r; + } + void coma() + { + D.HighByte = (byte)(~D.HighByte); + CLR_NZV(); + SET_NZ8(D.HighByte); + SEC(); + } + void lsra() + { + CLR_NZC(); + CC |= (byte)(D.HighByte & CC_C); + D.HighByte >>= 1; + SET_Z8(D.HighByte); + } + void rora() + { + byte r; + r = (byte)((CC & CC_C) << 7); + CLR_NZC(); + CC |= (byte)(D.HighByte & CC_C); + r |= (byte)(D.HighByte >> 1); + SET_NZ8(r); + D.HighByte = r; + } + void asra() + { + CLR_NZC(); + CC |= (byte)(D.HighByte & CC_C); + D.HighByte = (byte)((D.HighByte & 0x80) | (D.HighByte >> 1)); + SET_NZ8(D.HighByte); + } + void asla() + { + ushort r; + r = (ushort)(D.HighByte << 1); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, D.HighByte, r); + D.HighByte = (byte)r; + } + void rola() + { + ushort t, r; + t = D.HighByte; + r = (ushort)((CC & CC_C) | (t << 1)); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + D.HighByte = (byte)r; + } + void deca() + { + --D.HighByte; + CLR_NZV(); + SET_FLAGS8D(D.HighByte); + } + void inca() + { + ++D.HighByte; + CLR_NZV(); + SET_FLAGS8I(D.HighByte); + } + void tsta() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void clra() + { + D.HighByte = 0; + CLR_NZVC(); + SEZ(); + } + void negb() + { + ushort r; + r = (ushort)(-D.LowByte); + CLR_NZVC(); + SET_FLAGS8(0, D.LowByte, r); + D.LowByte = (byte)r; + } + void comb() + { + D.LowByte = (byte)(~D.LowByte); + CLR_NZV(); + SET_NZ8(D.LowByte); + SEC(); + } + void lsrb() + { + CLR_NZC(); + CC |= (byte)(D.LowByte & CC_C); + D.LowByte >>= 1; + SET_Z8(D.LowByte); + } + void rorb() + { + byte r; + r = (byte)((CC & CC_C) << 7); + CLR_NZC(); + CC |= (byte)(D.LowByte & CC_C); + r |= (byte)(D.LowByte >> 1); + SET_NZ8(r); + D.LowByte = r; + } + void asrb() + { + CLR_NZC(); + CC |= (byte)(D.LowByte & CC_C); + D.LowByte = (byte)((D.LowByte & 0x80) | (D.LowByte >> 1)); + SET_NZ8(D.LowByte); + } + void aslb() + { + ushort r; + r = (ushort)(D.LowByte << 1); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, D.LowByte, r); + D.LowByte = (byte)r; + } + void rolb() + { + ushort t, r; + t = D.LowByte; + r = (ushort)(CC & CC_C); + r |= (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + D.LowByte = (byte)r; + } + void decb() + { + --D.LowByte; + CLR_NZV(); + SET_FLAGS8D(D.LowByte); + } + void incb() + { + ++D.LowByte; + CLR_NZV(); + SET_FLAGS8I(D.LowByte); + } + void tstb() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void clrb() + { + D.LowByte = 0; + CLR_NZVC(); + SEZ(); + } + void neg_ix() + { + ushort r, t; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(-t); + CLR_NZVC(); + SET_FLAGS8(0, t, r); + WM(EA.LowWord, (byte)r); + } + void com_ix() + { + byte t; + fetch_effective_address(); + t = (byte)(~RM(EA.LowWord)); + CLR_NZV(); + SET_NZ8(t); + SEC(); + WM(EA.LowWord, t); + } + void lsr_ix() + { + byte t; + fetch_effective_address(); + t = RM(EA.LowWord); + CLR_NZC(); + CC |= (byte)(t & CC_C); + t >>= 1; + SET_Z8(t); + WM(EA.LowWord, t); + } + void ror_ix() + { + byte t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (byte)((CC & CC_C) << 7); + CLR_NZC(); + CC |= (byte)(t & CC_C); + r |= (byte)(t >> 1); + SET_NZ8(r); + WM(EA.LowWord, r); + } + void asr_ix() + { + byte t; + fetch_effective_address(); + t = RM(EA.LowWord); + CLR_NZC(); + CC |= (byte)(t & CC_C); + t = (byte)((t & 0x80) | (t >> 1)); + SET_NZ8(t); + WM(EA.LowWord, t); + } + void asl_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + WM(EA.LowWord, (byte)r); + } + void rol_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(CC & CC_C); + r |= (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + WM(EA.LowWord, (byte)r); + } + void dec_ix() + { + byte t; + fetch_effective_address(); + t = (byte)(RM(EA.LowWord) - 1); + CLR_NZV(); + SET_FLAGS8D(t); + WM(EA.LowWord, t); + } + void inc_ix() + { + byte t; + fetch_effective_address(); + t = (byte)(RM(EA.LowWord) + 1); + CLR_NZV(); + SET_FLAGS8I(t); + WM(EA.LowWord, t); + } + void tst_ix() + { + byte t; + fetch_effective_address(); + t = RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(t); + } + void jmp_ix() + { + fetch_effective_address(); + PC.d = EA.d; + //CHANGE_PC; + } + void clr_ix() + { + fetch_effective_address(); + RM(EA.LowWord); + WM(EA.LowWord, 0); + CLR_NZVC(); SEZ(); + } + void neg_ex() + { + ushort r, t; + t = EXTBYTE(); + r = (ushort)(-t); + CLR_NZVC(); + SET_FLAGS8(0, t, r); + WM(EA.LowWord, (byte)r); + } + void com_ex() + { + byte t; + t = EXTBYTE(); + t = (byte)(~t); + CLR_NZV(); + SET_NZ8(t); + SEC(); + WM(EA.LowWord, t); + } + void lsr_ex() + { + byte t; + t = EXTBYTE(); + CLR_NZC(); + CC |= (byte)(t & CC_C); + t >>= 1; + SET_Z8(t); + WM(EA.LowWord, t); + } + void ror_ex() + { + byte t, r; + t = EXTBYTE(); + r = (byte)((CC & CC_C) << 7); + CLR_NZC(); + CC |= (byte)(t & CC_C); + r |= (byte)(t >> 1); + SET_NZ8(r); + WM(EA.LowWord, r); + } + void asr_ex() + { + byte t; + t = EXTBYTE(); + CLR_NZC(); + CC |= (byte)(t & CC_C); + t = (byte)((t & 0x80) | (t >> 1)); + SET_NZ8(t); + WM(EA.LowWord, t); + } + void asl_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(t << 1); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + WM(EA.LowWord, (byte)r); + } + void rol_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)((CC & CC_C) | (t << 1)); + CLR_NZVC(); + SET_FLAGS8((byte)t, t, r); + WM(EA.LowWord, (byte)r); + } + void dec_ex() + { + byte t; + t = EXTBYTE(); + --t; + CLR_NZV(); + SET_FLAGS8D(t); + WM(EA.LowWord, t); + } + void inc_ex() + { + byte t; + t = EXTBYTE(); + ++t; + CLR_NZV(); + SET_FLAGS8I(t); + WM(EA.LowWord, t); + } + void tst_ex() + { + byte t; + t = EXTBYTE(); + CLR_NZV(); + SET_NZ8(t); + } + void jmp_ex() + { + EXTENDED(); + PC.d = EA.d; + //CHANGE_PC; + } + void clr_ex() + { + EXTENDED(); + RM(EA.LowWord); + WM(EA.LowWord, 0); + CLR_NZVC(); + SEZ(); + } + void suba_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void cmpa_im() + { + ushort t, r; + int i1, i2, i3; + t = IMMBYTE(); + r = (ushort)(D.HighByte - t); + i1 = CC; + CLR_NZVC(); + i2 = CC; + SET_FLAGS8(D.HighByte, t, r); + i3 = CC; + } + void sbca_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void subd_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void cmpd_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpu_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = U.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void anda_im() + { + byte t; + t = IMMBYTE(); + D.HighByte &= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void bita_im() + { + byte t, r; + t = IMMBYTE(); + r = (byte)(D.HighByte & t); + CLR_NZV(); + SET_NZ8(r); + } + void lda_im() + { + D.HighByte = IMMBYTE(); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void sta_im() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + IMM8(); + WM(EA.LowWord, D.HighByte); + } + void eora_im() + { + byte t; + t = IMMBYTE(); + D.HighByte ^= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adca_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void ora_im() + { + byte t; + t = IMMBYTE(); + D.HighByte |= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adda_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void cmpx_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpy_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = Y.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmps_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = S.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void bsr() + { + byte t; + t = IMMBYTE(); + PUSHWORD(PC); + PC.LowWord += SIGNED(t); + //CHANGE_PC; + } + void ldx_im() + { + X = IMMWORD(); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + void ldy_im() + { + Y = IMMWORD(); + CLR_NZV(); + SET_NZ16(Y.LowWord); + } + void stx_im() + { + CLR_NZV(); + SET_NZ16(X.LowWord); + IMM16(); + WM16(EA.LowWord, X); + } + void sty_im() + { + CLR_NZV(); + SET_NZ16(Y.LowWord); + IMM16(); + WM16(EA.LowWord, Y); + } + void suba_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void cmpa_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + } + void sbca_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void subd_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void cmpd_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpu_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = U.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16(U.LowWord, (ushort)b.d, r); + } + void anda_di() + { + byte t; + t = DIRBYTE(); + D.HighByte &= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void bita_di() + { + byte t, r; + t = DIRBYTE(); + r = (byte)(D.HighByte & t); + CLR_NZV(); + SET_NZ8(r); + } + void lda_di() + { + D.HighByte = DIRBYTE(); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void sta_di() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + DIRECT(); + WM(EA.LowWord, D.HighByte); + } + void eora_di() + { + byte t; + t = DIRBYTE(); + D.HighByte ^= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adca_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void ora_di() + { + byte t; + t = DIRBYTE(); + D.HighByte |= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adda_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void cmpx_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpy_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = Y.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmps_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = S.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void jsr_di() + { + DIRECT(); + PUSHWORD(PC); + PC.d = EA.d; + //CHANGE_PC; + } + void ldx_di() + { + X = DIRWORD(); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + void ldy_di() + { + Y = DIRWORD(); + CLR_NZV(); + SET_NZ16(Y.LowWord); + } + void stx_di() + { + CLR_NZV(); + SET_NZ16(X.LowWord); + DIRECT(); + WM16(EA.LowWord, X); + } + void sty_di() + { + CLR_NZV(); + SET_NZ16(Y.LowWord); + DIRECT(); + WM16(EA.LowWord, Y); + } + void suba_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void cmpa_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + } + void sbca_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.HighByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void subd_ix() + { + uint r, d; + Register b; + fetch_effective_address(); + b.d = RM16(EA.LowWord); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void cmpd_ix() + { + uint r, d; + Register b; + fetch_effective_address(); + b.d = RM16(EA.LowWord); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpu_ix() + { + uint r; + Register b = new Register(); + fetch_effective_address(); + b.d = RM16(EA.LowWord); + r = U.LowWord - b.d; + CLR_NZVC(); + SET_FLAGS16(U.LowWord, b.LowWord, r); + } + void anda_ix() + { + fetch_effective_address(); + D.HighByte &= RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void bita_ix() + { + byte r; + fetch_effective_address(); + r = (byte)(D.HighByte & RM(EA.LowWord)); + CLR_NZV(); + SET_NZ8(r); + } + void lda_ix() + { + fetch_effective_address(); + D.HighByte = RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void sta_ix() + { + fetch_effective_address(); + CLR_NZV(); + SET_NZ8(D.HighByte); + WM(EA.LowWord, D.HighByte); + } + void eora_ix() + { + fetch_effective_address(); + D.HighByte ^= RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adca_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.HighByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void ora_ix() + { + fetch_effective_address(); + D.HighByte |= RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adda_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void cmpx_ix() + { + uint r, d; + Register b; + fetch_effective_address(); + b.d = RM16(EA.LowWord); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpy_ix() + { + uint r, d; + Register b; + fetch_effective_address(); + b.d = RM16(EA.LowWord); + d = Y.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmps_ix() + { + uint r, d; + Register b; + fetch_effective_address(); + b.d = RM16(EA.LowWord); + d = S.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void jsr_ix() + { + fetch_effective_address(); + PUSHWORD(PC); + PC.d = EA.d; + //CHANGE_PC; + } + void ldx_ix() + { + fetch_effective_address(); + X.LowWord = RM16(EA.LowWord); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + void ldy_ix() + { + fetch_effective_address(); + Y.LowWord = RM16(EA.LowWord); + CLR_NZV(); + SET_NZ16(Y.LowWord); + } + void stx_ix() + { + fetch_effective_address(); + CLR_NZV(); + SET_NZ16(X.LowWord); + WM16(EA.LowWord, X); + } + void sty_ix() + { + fetch_effective_address(); + CLR_NZV(); + SET_NZ16(Y.LowWord); + WM16(EA.LowWord, Y); + } + void suba_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void cmpa_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte - t); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + } + void sbca_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.HighByte, t, r); + D.HighByte = (byte)r; + } + void subd_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void cmpd_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = D.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpu_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = U.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void anda_ex() + { + byte t; + t = EXTBYTE(); + D.HighByte &= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void bita_ex() + { + byte t, r; + t = EXTBYTE(); + r = (byte)(D.HighByte & t); + CLR_NZV(); SET_NZ8(r); + } + void lda_ex() + { + D.HighByte = EXTBYTE(); + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void sta_ex() + { + CLR_NZV(); + SET_NZ8(D.HighByte); + EXTENDED(); + WM(EA.LowWord, D.HighByte); + } + void eora_ex() + { + byte t; + t = EXTBYTE(); + D.HighByte ^= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adca_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void ora_ex() + { + byte t; + t = EXTBYTE(); + D.HighByte |= t; + CLR_NZV(); + SET_NZ8(D.HighByte); + } + void adda_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.HighByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.HighByte, t, r); + SET_H(D.HighByte, (byte)t, (byte)r); + D.HighByte = (byte)r; + } + void cmpx_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = X.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmpy_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = Y.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void cmps_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = S.LowWord; + r = d - b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + } + void jsr_ex() + { + EXTENDED(); + PUSHWORD(PC); + PC.d = EA.d; + //CHANGE_PC; + } + void ldx_ex() + { + X = EXTWORD(); + CLR_NZV(); + SET_NZ16(X.LowWord); + } + void ldy_ex() + { + Y = EXTWORD(); + CLR_NZV(); + SET_NZ16(Y.LowWord); + } + void stx_ex() + { + CLR_NZV(); + SET_NZ16(X.LowWord); + EXTENDED(); + WM16(EA.LowWord, X); + } + void sty_ex() + { + CLR_NZV(); + SET_NZ16(Y.LowWord); + EXTENDED(); + WM16(EA.LowWord, Y); + } + void subb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void cmpb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + void sbcb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void addd_im() + { + uint r, d; + Register b; + b = IMMWORD(); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void andb_im() + { + byte t; + t = IMMBYTE(); + D.LowByte &= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void bitb_im() + { + byte t, r; + t = IMMBYTE(); + r = (byte)(D.LowByte & t); + CLR_NZV(); + SET_NZ8(r); + } + void ldb_im() + { + D.LowByte = IMMBYTE(); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void stb_im() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + IMM8(); + WM(EA.LowWord, D.LowByte); + } + void eorb_im() + { + byte t; + t = IMMBYTE(); + D.LowByte ^= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void adcb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void orb_im() + { + byte t; + t = IMMBYTE(); + D.LowByte |= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void addb_im() + { + ushort t, r; + t = IMMBYTE(); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void ldd_im() + { + D = IMMWORD(); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + void std_im() + { + CLR_NZV(); + SET_NZ16(D.LowWord); + IMM16(); + WM16(EA.LowWord, D); + } + void ldu_im() + { + U = IMMWORD(); + CLR_NZV(); + SET_NZ16(U.LowWord); + } + void lds_im() + { + S = IMMWORD(); + CLR_NZV(); + SET_NZ16(S.LowWord); + int_state |= M6809_LDS; + } + void stu_im() + { + CLR_NZV(); + SET_NZ16(U.LowWord); + IMM16(); + WM16(EA.LowWord, U); + } + void sts_im() + { + CLR_NZV(); + SET_NZ16(S.LowWord); + IMM16(); + WM16(EA.LowWord, S); + } + void subb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void cmpb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + void sbcb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void addd_di() + { + uint r, d; + Register b; + b = DIRWORD(); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void andb_di() + { + byte t; + t = DIRBYTE(); + D.LowByte &= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void bitb_di() + { + byte t, r; + t = DIRBYTE(); + r = (byte)(D.LowByte & t); + CLR_NZV(); + SET_NZ8(r); + } + void ldb_di() + { + D.LowByte = DIRBYTE(); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void stb_di() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + DIRECT(); + WM(EA.LowWord, D.LowByte); + } + void eorb_di() + { + byte t; + t = DIRBYTE(); + D.LowByte ^= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void adcb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void orb_di() + { + byte t; + t = DIRBYTE(); + D.LowByte |= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void addb_di() + { + ushort t, r; + t = DIRBYTE(); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void ldd_di() + { + D = DIRWORD(); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + void std_di() + { + CLR_NZV(); + SET_NZ16(D.LowWord); + DIRECT(); + WM16(EA.LowWord, D); + } + void ldu_di() + { + U = DIRWORD(); + CLR_NZV(); + SET_NZ16(U.LowWord); + } + void lds_di() + { + S = DIRWORD(); + CLR_NZV(); + SET_NZ16(S.LowWord); + int_state |= M6809_LDS; + } + void stu_di() + { + CLR_NZV(); + SET_NZ16(U.LowWord); + DIRECT(); + WM16(EA.LowWord, U); + } + void sts_di() + { + CLR_NZV(); + SET_NZ16(S.LowWord); + DIRECT(); + WM16(EA.LowWord, S); + } + void subb_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void cmpb_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + void sbcb_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.LowByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void addd_ix() + { + uint r, d; + Register b; + fetch_effective_address(); + b.d = RM16(EA.LowWord); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void andb_ix() + { + fetch_effective_address(); + D.LowByte &= RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void bitb_ix() + { + byte r; + fetch_effective_address(); + r = (byte)(D.LowByte & RM(EA.LowWord)); + CLR_NZV(); + SET_NZ8(r); + } + void ldb_ix() + { + fetch_effective_address(); + D.LowByte = RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void stb_ix() + { + fetch_effective_address(); + CLR_NZV(); + SET_NZ8(D.LowByte); + WM(EA.LowWord, D.LowByte); + } + void eorb_ix() + { + fetch_effective_address(); + D.LowByte ^= RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void adcb_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.LowByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void orb_ix() + { + fetch_effective_address(); + D.LowByte |= RM(EA.LowWord); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void addb_ix() + { + ushort t, r; + fetch_effective_address(); + t = RM(EA.LowWord); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void ldd_ix() + { + fetch_effective_address(); + D.LowWord = RM16(EA.LowWord); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + void std_ix() + { + fetch_effective_address(); + CLR_NZV(); + SET_NZ16(D.LowWord); + WM16(EA.LowWord, D); + } + void ldu_ix() + { + fetch_effective_address(); + U.LowWord = RM16(EA.LowWord); + CLR_NZV(); + SET_NZ16(U.LowWord); + } + void lds_ix() + { + fetch_effective_address(); + S.LowWord = RM16(EA.LowWord); + CLR_NZV(); + SET_NZ16(S.LowWord); + int_state |= M6809_LDS; + } + void stu_ix() + { + fetch_effective_address(); + CLR_NZV(); + SET_NZ16(U.LowWord); + WM16(EA.LowWord, U); + } + void sts_ix() + { + fetch_effective_address(); + CLR_NZV(); + SET_NZ16(S.LowWord); + WM16(EA.LowWord, S); + } + void subb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void cmpb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte - t); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + } + void sbcb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte - t - (CC & CC_C)); + CLR_NZVC(); + SET_FLAGS8(D.LowByte, t, r); + D.LowByte = (byte)r; + } + void addd_ex() + { + uint r, d; + Register b; + b = EXTWORD(); + d = D.LowWord; + r = d + b.d; + CLR_NZVC(); + SET_FLAGS16((ushort)d, (ushort)b.d, r); + D.LowWord = (ushort)r; + } + void andb_ex() + { + byte t; + t = EXTBYTE(); + D.LowByte &= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void bitb_ex() + { + byte t, r; + t = EXTBYTE(); + r = (byte)(D.LowByte & t); + CLR_NZV(); + SET_NZ8(r); + } + void ldb_ex() + { + D.LowByte = EXTBYTE(); + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void stb_ex() + { + CLR_NZV(); + SET_NZ8(D.LowByte); + EXTENDED(); + WM(EA.LowWord, D.LowByte); + } + void eorb_ex() + { + byte t; + t = EXTBYTE(); + D.LowByte ^= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void adcb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte + t + (CC & CC_C)); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void orb_ex() + { + byte t; + t = EXTBYTE(); + D.LowByte |= t; + CLR_NZV(); + SET_NZ8(D.LowByte); + } + void addb_ex() + { + ushort t, r; + t = EXTBYTE(); + r = (ushort)(D.LowByte + t); + CLR_HNZVC(); + SET_FLAGS8(D.LowByte, t, r); + SET_H(D.LowByte, (byte)t, (byte)r); + D.LowByte = (byte)r; + } + void ldd_ex() + { + D = EXTWORD(); + CLR_NZV(); + SET_NZ16(D.LowWord); + } + void std_ex() + { + CLR_NZV(); + SET_NZ16(D.LowWord); + EXTENDED(); + WM16(EA.LowWord, D); + } + void ldu_ex() + { + U = EXTWORD(); + CLR_NZV(); + SET_NZ16(U.LowWord); + } + void lds_ex() + { + S = EXTWORD(); + CLR_NZV(); + SET_NZ16(S.LowWord); + int_state |= M6809_LDS; + } + void stu_ex() + { + CLR_NZV(); + SET_NZ16(U.LowWord); + EXTENDED(); + WM16(EA.LowWord, U); + } + void sts_ex() + { + CLR_NZV(); + SET_NZ16(S.LowWord); + EXTENDED(); + WM16(EA.LowWord, S); + } + void pref10() + { + byte ireg2 = ReadOp(PC.LowWord); + PC.LowWord++; + switch (ireg2) + { + case 0x21: lbrn(); pendingCycles -= 5; break; + case 0x22: lbhi(); pendingCycles -= 5; break; + case 0x23: lbls(); pendingCycles -= 5; break; + case 0x24: lbcc(); pendingCycles -= 5; break; + case 0x25: lbcs(); pendingCycles -= 5; break; + case 0x26: lbne(); pendingCycles -= 5; break; + case 0x27: lbeq(); pendingCycles -= 5; break; + case 0x28: lbvc(); pendingCycles -= 5; break; + case 0x29: lbvs(); pendingCycles -= 5; break; + case 0x2a: lbpl(); pendingCycles -= 5; break; + case 0x2b: lbmi(); pendingCycles -= 5; break; + case 0x2c: lbge(); pendingCycles -= 5; break; + case 0x2d: lblt(); pendingCycles -= 5; break; + case 0x2e: lbgt(); pendingCycles -= 5; break; + case 0x2f: lble(); pendingCycles -= 5; break; + + case 0x3f: swi2(); pendingCycles -= 20; break; + + case 0x83: cmpd_im(); pendingCycles -= 5; break; + case 0x8c: cmpy_im(); pendingCycles -= 5; break; + case 0x8e: ldy_im(); pendingCycles -= 4; break; + case 0x8f: sty_im(); pendingCycles -= 4; break; + + case 0x93: cmpd_di(); pendingCycles -= 7; break; + case 0x9c: cmpy_di(); pendingCycles -= 7; break; + case 0x9e: ldy_di(); pendingCycles -= 6; break; + case 0x9f: sty_di(); pendingCycles -= 6; break; + + case 0xa3: cmpd_ix(); pendingCycles -= 7; break; + case 0xac: cmpy_ix(); pendingCycles -= 7; break; + case 0xae: ldy_ix(); pendingCycles -= 6; break; + case 0xaf: sty_ix(); pendingCycles -= 6; break; + + case 0xb3: cmpd_ex(); pendingCycles -= 8; break; + case 0xbc: cmpy_ex(); pendingCycles -= 8; break; + case 0xbe: ldy_ex(); pendingCycles -= 7; break; + case 0xbf: sty_ex(); pendingCycles -= 7; break; + + case 0xce: lds_im(); pendingCycles -= 4; break; + case 0xcf: sts_im(); pendingCycles -= 4; break; + + case 0xde: lds_di(); pendingCycles -= 6; break; + case 0xdf: sts_di(); pendingCycles -= 6; break; + + case 0xee: lds_ix(); pendingCycles -= 6; break; + case 0xef: sts_ix(); pendingCycles -= 6; break; + + case 0xfe: lds_ex(); pendingCycles -= 7; break; + case 0xff: sts_ex(); pendingCycles -= 7; break; + + default: illegal(); break; + } + } + void pref11() + { + byte ireg2 = ReadOp(PC.LowWord); + PC.LowWord++; + switch (ireg2) + { + case 0x3f: swi3(); pendingCycles -= 20; break; + + case 0x83: cmpu_im(); pendingCycles -= 5; break; + case 0x8c: cmps_im(); pendingCycles -= 5; break; + + case 0x93: cmpu_di(); pendingCycles -= 7; break; + case 0x9c: cmps_di(); pendingCycles -= 7; break; + + case 0xa3: cmpu_ix(); pendingCycles -= 7; break; + case 0xac: cmps_ix(); pendingCycles -= 7; break; + + case 0xb3: cmpu_ex(); pendingCycles -= 8; break; + case 0xbc: cmps_ex(); pendingCycles -= 8; break; + + default: illegal(); break; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809op.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809op.cs.meta new file mode 100644 index 00000000..d1f356f0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/m6809/M6809op.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2fd2fa6c87071aa4482ca5895aa105e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec.meta new file mode 100644 index 00000000..53e4fe83 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9712b77131e67e342acd3852569c6692 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/Nec.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/Nec.cs new file mode 100644 index 00000000..e19b5b30 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/Nec.cs @@ -0,0 +1,1334 @@ +using MAME.Core; +using System; +using System.IO; + +namespace cpu.nec +{ + public partial class Nec : cpuexec_data + { + protected ulong totalExecutedCycles; + public int pendingCycles; + public override ulong TotalExecutedCycles + { + get + { + return totalExecutedCycles; + } + set + { + totalExecutedCycles = value; + } + } + public override int PendingCycles + { + get + { + return pendingCycles; + } + set + { + pendingCycles = value; + } + } + public override void set_irq_line(int irqline, LineState state) + { + if (irqline == (int)LineState.INPUT_LINE_NMI) + { + if (I.nmi_state == (uint)state) + { + return; + } + I.nmi_state = (uint)state; + if (state != LineState.CLEAR_LINE) + { + I.pending_irq |= 0x02; + } + } + else + { + I.irq_state = (uint)state; + if (state == LineState.CLEAR_LINE) + { + I.pending_irq &= 0xfffffffe; + } + else + { + I.pending_irq |= 0x01; + } + } + } + public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) + { + if (line >= 0 && line < 35) + { + irq _irq = ObjectPoolAuto.Acquire(); + _irq.Init(cpunum, line, state, vector, EmuTimer.get_current_time()); + Cpuint.lirq.Add(_irq); + //Cpuint.lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time())); + int event_index = Cpuint.input_event_index[cpunum, line]++; + if (event_index >= 35) + { + Cpuint.input_event_index[cpunum, line]--; + //Cpuint.cpunum_empty_event_queue(machine, NULL, cpunum | (line << 8)); + event_index = Cpuint.input_event_index[cpunum, line]++; + } + if (event_index < 35) + { + //Cpuint.input_event_queue[cpunum][line][event_index] = input_event; + //if (event_index == 0) + { + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + } + } + } + public struct necbasicregs + { + //public ushort[] w;//[8]; + public byte[] b;//[16]; + } + public struct nec_Regs + { + public necbasicregs regs; + public ushort[] sregs;//[4]; + public ushort ip; + public int SignVal; + public uint AuxVal, OverVal, ZeroVal, CarryVal, ParityVal; + public bool TF, IF, DF, MF; + public uint int_vector; + public uint pending_irq; + public uint nmi_state; + public uint irq_state; + public bool poll_state; + public byte no_interrupt; + //int (*irq_callback)(int irqline); + //memory_interface mem; + //const nec_config *config; + } + public struct Mod_RM + { + public int[] regw; + public int[] regb; + public int[] RMw; + public int[] RMb; + } + public int iNOP; + public static Nec[] nn1; + public Mod_RM mod_RM; + public byte[] v25v35_decryptiontable; + public nec_Regs I; + public int chip_type; + public static int prefix_base; + public static int seg_prefix; + public int INT_IRQ = 0x01, NMI_IRQ = 0x02; + public bool[] parity_table = new bool[0x100]; + public Func ReadOp, ReadOpArg; + public Func ReadByte; + public Action WriteByte; + public Func ReadWord; + public Action WriteWord; + public Func ReadIOByte; + public Action WriteIOByte; + public Func ReadIOWord; + public Action WriteIOWord; + public delegate void nec_delegate(); + public nec_delegate[] nec_instruction; + public delegate int getea_delegate(); + public getea_delegate[] GetEA; + public Nec() + { + nec_init(); + } + private int DefaultBase(int Seg, nec_Regs I) + { + return (((seg_prefix != 0) && (Seg == 3 || Seg == 2)) ? prefix_base : (int)(I.sregs[Seg] << 4)); + } + private byte GetMemB(int Seg, int Off) + { + return ReadByte(DefaultBase(Seg, I) + Off); + } + private ushort GetMemW(int Seg, int Off) + { + return ReadWord(DefaultBase(Seg, I) + Off); + } + private void PutMemB(int Seg, int Off, byte x) + { + WriteByte(DefaultBase(Seg, I) + Off, x); + } + private void PutMemW(int Seg, int Off, ushort x) + { + WriteWord(DefaultBase(Seg, I) + Off, x); + } + private byte FETCH() + { + return ReadOpArg(((I.sregs[1] << 4) + I.ip++) ^ 0); + } + public byte fetchop() + { + byte ret = ReadOp(((I.sregs[1] << 4) + I.ip++) ^ 0); + if (I.MF) + { + if (v25v35_decryptiontable != null) + { + ret = v25v35_decryptiontable[ret]; + } + } + return ret; + } + public ushort FETCHWORD() + { + ushort var = (ushort)(ReadOpArg(((I.sregs[1] << 4) + I.ip) ^ 0) + (ReadOpArg(((I.sregs[1] << 4) + I.ip + 1) ^ 0) << 8)); + I.ip += 2; + return var; + } + public int GetModRM() + { + int ModRM = ReadOpArg(((I.sregs[1] << 4) + I.ip++) ^ 0); + return ModRM; + } + public void PUSH(ushort val) + { + //I.regs.w[4] -= 2; + ushort w4 = (ushort)(I.regs.b[8] + I.regs.b[9] * 0x100 - 2); + I.regs.b[8] = (byte)(w4 % 0x100); + I.regs.b[9] = (byte)(w4 / 0x100); + WriteWord((I.sregs[2] << 4) + I.regs.b[8] + I.regs.b[9] * 0x100, val); + } + public void POP(ref ushort var) + { + var = ReadWord((I.sregs[2] << 4) + I.regs.b[8] + I.regs.b[9] * 0x100); + //I.regs.w[4] += 2; + ushort w4 = (ushort)(I.regs.b[8] + I.regs.b[9] * 0x100 + 2); + I.regs.b[8] = (byte)(w4 % 0x100); + I.regs.b[9] = (byte)(w4 / 0x100); + } + public void POPW(int i) + { + ushort var = ReadWord((I.sregs[2] << 4) + I.regs.b[8] + I.regs.b[9] * 0x100); + I.regs.b[i * 2] = (byte)(var % 0x100); + I.regs.b[i * 2 + 1] = (byte)(var / 0x100); + ushort w4 = (ushort)(I.regs.b[8] + I.regs.b[9] * 0x100 + 2); + I.regs.b[8] = (byte)(w4 % 0x100); + I.regs.b[9] = (byte)(w4 / 0x100); + } + public byte PEEK(uint addr) + { + return (byte)ReadOpArg((int)(addr ^ 0)); + } + public byte PEEKOP(uint addr) + { + return (byte)ReadOp((int)(addr ^ 0)); + } + public void SetCFB(uint x) + { + I.CarryVal = x & 0x100; + } + public void SetCFW(uint x) + { + I.CarryVal = x & 0x10000; + } + public void SetAF(int x, int y, int z) + { + I.AuxVal = (uint)(((x) ^ ((y) ^ (z))) & 0x10); + } + public void SetSZPF_Byte(int x) + { + I.ZeroVal = I.ParityVal = (uint)((sbyte)x); + I.SignVal = (int)I.ZeroVal; + } + public void SetSZPF_Word(int x) + { + I.ZeroVal = I.ParityVal = (uint)((short)x); + I.SignVal = (int)I.ZeroVal; + } + public void SetOFW_Add(int x, int y, int z) + { + I.OverVal = (uint)(((x) ^ (y)) & ((x) ^ (z)) & 0x8000); + } + public void SetOFB_Add(int x, int y, int z) + { + I.OverVal = (uint)(((x) ^ (y)) & ((x) ^ (z)) & 0x80); + } + public void SetOFW_Sub(int x, int y, int z) + { + I.OverVal = (uint)(((z) ^ (y)) & ((z) ^ (x)) & 0x8000); + } + public void SetOFB_Sub(int x, int y, int z) + { + I.OverVal = (uint)(((z) ^ (y)) & ((z) ^ (x)) & 0x80); + } + public void ADDB(ref byte src, ref byte dst) + { + uint res = (uint)(dst + src); + SetCFB((uint)res); + SetOFB_Add((int)res, src, dst); + SetAF((int)res, src, dst); + SetSZPF_Byte((int)res); + dst = (byte)res; + } + public void ADDW(ref ushort src, ref ushort dst) + { + uint res = (uint)(dst + src); + SetCFW(res); + SetOFW_Add((int)res, src, dst); + SetAF((int)res, src, dst); + SetSZPF_Word((int)res); + dst = (ushort)res; + } + public void SUBB(ref byte src, ref byte dst) + { + uint res = (uint)(dst - src); + SetCFB(res); + SetOFB_Sub((int)res, src, dst); + SetAF((int)res, src, dst); + SetSZPF_Byte((int)res); + dst = (byte)res; + } + public void SUBW(ref ushort src, ref ushort dst) + { + uint res = (uint)(dst - src); + SetCFW(res); + SetOFW_Sub((int)res, src, dst); + SetAF((int)res, src, dst); + SetSZPF_Word((int)res); + dst = (ushort)res; + } + public void ORB(ref byte src, ref byte dst) + { + dst |= src; + I.CarryVal = I.OverVal = I.AuxVal = 0; + SetSZPF_Byte(dst); + } + public void ORW(ref ushort src, ref ushort dst) + { + dst |= src; + I.CarryVal = I.OverVal = I.AuxVal = 0; + SetSZPF_Word(dst); + } + public void ANDB(ref byte src, ref byte dst) + { + dst &= src; + I.CarryVal = I.OverVal = I.AuxVal = 0; + SetSZPF_Byte(dst); + } + public void ANDW(ref ushort src, ref ushort dst) + { + dst &= src; + I.CarryVal = I.OverVal = I.AuxVal = 0; + SetSZPF_Word(dst); + } + public void XORB(ref byte src, ref byte dst) + { + dst ^= src; + I.CarryVal = I.OverVal = I.AuxVal = 0; + SetSZPF_Byte(dst); + } + public void XORW(ref ushort src, ref ushort dst) + { + dst ^= src; + I.CarryVal = I.OverVal = I.AuxVal = 0; + SetSZPF_Word(dst); + } + public bool CF() + { + return (I.CarryVal != 0); + } + public bool SF() + { + return (I.SignVal < 0); + } + public bool ZF() + { + return (I.ZeroVal == 0); + } + public bool PF() + { + return parity_table[(byte)I.ParityVal]; + } + public bool AF() + { + return (I.AuxVal != 0); + } + public bool OF() + { + return (I.OverVal != 0); + } + public bool MD() + { + return I.MF; + } + public void CLK(int all) + { + pendingCycles -= all; + } + public void CLKS(int v20, int v30, int v33) + { + int ccount = (v20 << 16) | (v30 << 8) | v33; + pendingCycles -= (ccount >> chip_type) & 0x7f; + } + public void CLKW(int v20o, int v30o, int v33o, int v20e, int v30e, int v33e, int addr) + { + int ocount = (v20o << 16) | (v30o << 8) | v33o, ecount = (v20e << 16) | (v30e << 8) | v33e; + pendingCycles -= ((addr & 1) != 0) ? ((ocount >> chip_type) & 0x7f) : ((ecount >> chip_type) & 0x7f); + } + public void CLKM(int ModRM, int v20, int v30, int v33, int v20m, int v30m, int v33m) + { + int ccount = (v20 << 16) | (v30 << 8) | v33, mcount = (v20m << 16) | (v30m << 8) | v33m; + pendingCycles -= (ModRM >= 0xc0) ? ((ccount >> chip_type) & 0x7f) : ((mcount >> chip_type) & 0x7f); + } + public void CLKR(int ModRM, int v20o, int v30o, int v33o, int v20e, int v30e, int v33e, int vall, int addr) + { + int ocount = (v20o << 16) | (v30o << 8) | v33o, ecount = (v20e << 16) | (v30e << 8) | v33e; + if (ModRM >= 0xc0) + { + pendingCycles -= vall; + } + else + { + pendingCycles -= ((addr & 1) != 0) ? ((ocount >> chip_type) & 0x7f) : ((ecount >> chip_type) & 0x7f); + } + } + public ushort CompressFlags() + { + return (ushort)((CF() ? 1 : 0) | ((PF() ? 1 : 0) << 2) | ((AF() ? 1 : 0) << 4) | ((ZF() ? 1 : 0) << 6) | ((SF() ? 1 : 0) << 7) | ((I.TF ? 1 : 0) << 8) | ((I.IF ? 1 : 0) << 9) | ((I.DF ? 1 : 0) << 10) | ((OF() ? 1 : 0) << 11) | ((MD() ? 1 : 0) << 15)); + } + public void ExpandFlags(ushort f) + { + I.CarryVal = (uint)(f & 1); + I.ParityVal = (uint)((f & 4) == 0 ? 1 : 0); + I.AuxVal = (uint)(f & 16); + I.ZeroVal = (uint)((f & 64) == 0 ? 1 : 0); + I.SignVal = ((f & 128) != 0) ? -1 : 0; + I.TF = (f & 256) == 256; + I.IF = (f & 512) == 512; + I.DF = (f & 1024) == 1024; + I.OverVal = (uint)(f & 2048); + I.MF = (f & 0x8000) == 0x8000; + } + public void IncWordReg(int Reg) + { + int tmp = (int)(I.regs.b[Reg * 2] + I.regs.b[Reg * 2 + 1] * 0x100); + int tmp1 = tmp + 1; + I.OverVal = (uint)((tmp == 0x7fff) ? 1 : 0); + SetAF(tmp1, tmp, 1); + SetSZPF_Word(tmp1); + //I.regs.w[Reg] = (ushort)tmp1; + I.regs.b[Reg * 2] = (byte)((ushort)tmp1 % 0x100); + I.regs.b[Reg * 2 + 1] = (byte)((ushort)tmp1 / 0x100); + } + public void DecWordReg(int Reg) + { + int tmp = (int)(I.regs.b[Reg * 2] + I.regs.b[Reg * 2 + 1] * 0x100); + int tmp1 = tmp - 1; + I.OverVal = (uint)((tmp == 0x8000) ? 1 : 0); + SetAF(tmp1, tmp, 1); + SetSZPF_Word(tmp1); + //I.regs.w[Reg] = (ushort)tmp1; + I.regs.b[Reg * 2] = (byte)((ushort)tmp1 % 0x100); + I.regs.b[Reg * 2 + 1] = (byte)((ushort)tmp1 / 0x100); + } + public void JMP(bool flag) + { + int tmp = (int)((sbyte)FETCH()); + if (flag) + { + byte[] table = new byte[] { 3, 10, 10 }; + I.ip = (ushort)(I.ip + tmp); + pendingCycles -= table[chip_type / 8]; + //PC = (I.sregs[1] << 4) + I.ip; + return; + } + } + public void ADJ4(int param1, int param2) + { + if (AF() || ((I.regs.b[0] & 0xf) > 9)) + { + ushort tmp; + tmp = (ushort)(I.regs.b[0] + param1); + I.regs.b[0] = (byte)tmp; + I.AuxVal = 1; + I.CarryVal |= (uint)(tmp & 0x100); + } + if (CF() || (I.regs.b[0] > 0x9f)) + { + I.regs.b[0] += (byte)param2; + I.CarryVal = 1; + } + SetSZPF_Byte(I.regs.b[0]); + } + public void ADJB(int param1, int param2) + { + if (AF() || ((I.regs.b[0] & 0xf) > 9)) + { + I.regs.b[0] += (byte)param1; + I.regs.b[1] += (byte)param2; + I.AuxVal = 1; + I.CarryVal = 1; + } + else + { + I.AuxVal = 0; + I.CarryVal = 0; + } + I.regs.b[0] &= 0x0F; + } + public void BITOP_BYTE(ref int ModRM, ref int tmp) + { + ModRM = FETCH(); + if (ModRM >= 0xc0) + { + tmp = I.regs.b[mod_RM.RMb[ModRM]]; + } + else + { + EA = GetEA[ModRM](); + tmp = ReadByte(EA); + } + } + public void BITOP_WORD(ref int ModRM, ref int tmp) + { + ModRM = FETCH(); + if (ModRM >= 0xc0) + { + tmp = I.regs.b[mod_RM.RMw[ModRM] * 2] + I.regs.b[mod_RM.RMw[ModRM] * 2 + 1] * 0x100; + } + else + { + EA = GetEA[ModRM](); + tmp = ReadWord(EA); + } + } + public void BIT_NOT(ref int tmp, ref int tmp2) + { + if ((tmp & (1 << tmp2)) != 0) + { + tmp &= (~(1 << tmp2)); + } + else + { + tmp |= (1 << tmp2); + } + } + public void XchgAWReg(int Reg) + { + ushort tmp; + tmp = (ushort)(I.regs.b[Reg * 2] + I.regs.b[Reg * 2 + 1] * 0x100); + //I.regs.w[Reg] = I.regs.w[0]; + //I.regs.w[0] = tmp; + I.regs.b[Reg * 2] = I.regs.b[0]; + I.regs.b[Reg * 2 + 1] = I.regs.b[1]; + I.regs.b[0] = (byte)(tmp % 0x100); + I.regs.b[1] = (byte)(tmp / 0x100); + } + public void ROL_BYTE(ref int dst) + { + I.CarryVal = (uint)(dst & 0x80); + dst = (dst << 1) + (CF() ? 1 : 0); + } + public void ROL_WORD(ref int dst) + { + I.CarryVal = (uint)(dst & 0x8000); + dst = (dst << 1) + (CF() ? 1 : 0); + } + public void ROR_BYTE(ref int dst) + { + I.CarryVal = (uint)(dst & 0x1); + dst = (dst >> 1) + ((CF() ? 1 : 0) << 7); + } + public void ROR_WORD(ref int dst) + { + I.CarryVal = (uint)(dst & 0x1); + dst = (dst >> 1) + ((CF() ? 1 : 0) << 15); + } + public void ROLC_BYTE(ref int dst) + { + dst = (dst << 1) + (CF() ? 1 : 0); + SetCFB((uint)dst); + } + public void ROLC_WORD(ref int dst) + { + dst = (dst << 1) + (CF() ? 1 : 0); + SetCFW((uint)dst); + } + public void RORC_BYTE(ref int dst) + { + dst = ((CF() ? 1 : 0) << 8) + dst; + I.CarryVal = (uint)(dst & 0x01); + dst >>= 1; + } + public void RORC_WORD(ref int dst) + { + dst = ((CF() ? 1 : 0) << 16) + dst; + I.CarryVal = (uint)(dst & 0x01); + dst >>= 1; + } + public void SHL_BYTE(int c, ref int dst, int ModRM) + { + pendingCycles -= c; + dst <<= c; + SetCFB((uint)dst); + SetSZPF_Byte(dst); + PutbackRMByte(ModRM, (byte)dst); + } + public void SHL_WORD(int c, ref int dst, int ModRM) + { + pendingCycles -= c; + dst <<= c; + SetCFW((uint)dst); + SetSZPF_Word(dst); + PutbackRMWord(ModRM, (ushort)dst); + } + public void SHR_BYTE(int c, ref int dst, int ModRM) + { + pendingCycles -= c; + dst >>= c - 1; + I.CarryVal = (uint)(dst & 0x1); + dst >>= 1; + SetSZPF_Byte(dst); + PutbackRMByte(ModRM, (byte)dst); + } + public void SHR_WORD(int c, ref int dst, int ModRM) + { + pendingCycles -= c; + dst >>= c - 1; + I.CarryVal = (uint)(dst & 0x1); + dst >>= 1; + SetSZPF_Word(dst); + PutbackRMWord(ModRM, (ushort)dst); + } + public void SHRA_BYTE(int c, ref int dst, int ModRM) + { + pendingCycles -= c; + dst = ((sbyte)dst) >> (c - 1); + I.CarryVal = (uint)(dst & 0x1); + dst = ((sbyte)((byte)dst)) >> 1; + SetSZPF_Byte(dst); + PutbackRMByte(ModRM, (byte)dst); + } + public void SHRA_WORD(int c, ref int dst, int ModRM) + { + pendingCycles -= c; + dst = ((short)dst) >> (c - 1); + I.CarryVal = (uint)(dst & 0x1); + dst = ((short)((ushort)dst)) >> 1; + SetSZPF_Word(dst); + PutbackRMWord(ModRM, (ushort)dst); + } + public void DIVUB(int tmp, out bool b1) + { + int uresult, uresult2; + b1 = false; + uresult = I.regs.b[0] + I.regs.b[1] * 0x100; + uresult2 = uresult % tmp; + if ((uresult /= tmp) > 0xff) + { + nec_interrupt(0, false); + b1 = true; + } + else + { + I.regs.b[0] = (byte)uresult; + I.regs.b[1] = (byte)uresult2; + } + } + public void DIVB(int tmp, out bool b1) + { + int result, result2; + b1 = false; + result = (short)(I.regs.b[0] + I.regs.b[1] * 0x100); + result2 = result % (short)((sbyte)tmp); + if ((result /= (short)((sbyte)tmp)) > 0xff) + { + nec_interrupt(0, false); + b1 = true; + } + else + { + I.regs.b[0] = (byte)result; + I.regs.b[1] = (byte)result2; + } + } + public void DIVUW(int tmp, out bool b1) + { + uint uresult, uresult2; + b1 = false; + uresult = ((uint)(I.regs.b[4] + I.regs.b[5] * 0x100) << 16) | (uint)(I.regs.b[0] + I.regs.b[1] * 0x100); + uresult2 = (uint)(uresult % tmp); + if ((uresult /= (uint)tmp) > 0xffff) + { + nec_interrupt(0, false); + b1 = true; + } + else + { + //I.regs.w[0] = (ushort)uresult; + //I.regs.w[2] = (ushort)uresult2; + I.regs.b[0] = (byte)(uresult % 0x100); + I.regs.b[1] = (byte)(uresult / 0x100); + I.regs.b[4] = (byte)(uresult2 % 0x100); + I.regs.b[5] = (byte)(uresult2 / 0x100); + } + } + public void DIVW(int tmp, out bool b1) + { + int result, result2; + b1 = false; + result = (int)(((uint)(I.regs.b[4] + I.regs.b[5] * 0x100) << 16) + (I.regs.b[0] + I.regs.b[1] * 0x100)); + result2 = result % (int)((short)tmp); + if ((result /= (int)((short)tmp)) > 0xffff) + { + nec_interrupt(0, false); + b1 = true; + } + else + { + //I.regs.w[0] = (ushort)result; + //I.regs.w[2] = (ushort)result2; + I.regs.b[0] = (byte)((ushort)result % 0x100); + I.regs.b[1] = (byte)((ushort)result / 0x100); + I.regs.b[4] = (byte)((ushort)result2 % 0x100); + I.regs.b[5] = (byte)((ushort)result2 / 0x100); + } + } + public void ADD4S(ref int tmp, ref int tmp2) + { + int i, v1, v2, result; + int count = (I.regs.b[2] + 1) / 2; + ushort di = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100); + ushort si = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100); + byte[] table = new byte[] { 18, 19, 19 }; + I.ZeroVal = I.CarryVal = 0; + for (i = 0; i < count; i++) + { + pendingCycles -= table[chip_type / 8]; + tmp = GetMemB(3, si); + tmp2 = GetMemB(0, di); + v1 = (tmp >> 4) * 10 + (tmp & 0xf); + v2 = (tmp2 >> 4) * 10 + (tmp2 & 0xf); + result = (int)(v1 + v2 + I.CarryVal); + I.CarryVal = (uint)(result > 99 ? 1 : 0); + result = result % 100; + v1 = ((result / 10) << 4) | (result % 10); + PutMemB(0, di, (byte)v1); + if (v1 != 0) + { + I.ZeroVal = 1; + } + si++; + di++; + } + } + public void SUB4S(ref int tmp, ref int tmp2) + { + int count = (I.regs.b[2] + 1) / 2; + int i, v1, v2, result; + ushort di = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100); + ushort si = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100); + byte[] table = new byte[3] { 18, 19, 19 }; + I.ZeroVal = I.CarryVal = 0; + for (i = 0; i < count; i++) + { + pendingCycles -= table[chip_type / 8]; + tmp = GetMemB(0, di); + tmp2 = GetMemB(3, si); + v1 = (tmp >> 4) * 10 + (tmp & 0xf); + v2 = (tmp2 >> 4) * 10 + (tmp2 & 0xf); + if (v1 < (v2 + I.CarryVal)) + { + v1 += 100; + result = (int)(v1 - (v2 + I.CarryVal)); + I.CarryVal = 1; + } + else + { + result = (int)(v1 - (v2 + I.CarryVal)); + I.CarryVal = 0; + } + v1 = ((result / 10) << 4) | (result % 10); + PutMemB(0, di, (byte)v1); + if (v1 != 0) + { + I.ZeroVal = 1; + } + si++; + di++; + } + } + private void CMP4S(ref int tmp, ref int tmp2) + { + int count = (I.regs.b[2] + 1) / 2; + int i, v1, v2, result; + ushort di = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100); + ushort si = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100); + byte[] table = new byte[3] { 14, 19, 19 }; + I.ZeroVal = I.CarryVal = 0; + for (i = 0; i < count; i++) + { + pendingCycles -= table[chip_type / 8]; + tmp = GetMemB(0, di); + tmp2 = GetMemB(3, si); + v1 = (tmp >> 4) * 10 + (tmp & 0xf); + v2 = (tmp2 >> 4) * 10 + (tmp2 & 0xf); + if (v1 < (v2 + I.CarryVal)) + { + v1 += 100; + result = (int)(v1 - (v2 + I.CarryVal)); + I.CarryVal = 1; + } + else + { + result = (int)(v1 - (v2 + I.CarryVal)); + I.CarryVal = 0; + } + v1 = ((result / 10) << 4) | (result % 10); + if (v1 != 0) + { + I.ZeroVal = 1; + } + si++; + di++; + } + } + public void nec_init() + { + mod_RM = new Mod_RM(); + mod_RM.regw = new int[256]; + mod_RM.regb = new int[256]; + mod_RM.RMw = new int[256]; + mod_RM.RMb = new int[256]; + nec_instruction = new nec_delegate[]{ + i_add_br8, + i_add_wr16, + i_add_r8b, + i_add_r16w, + i_add_ald8, + i_add_axd16, + i_push_es, + i_pop_es, + i_or_br8, + i_or_wr16, + i_or_r8b, + i_or_r16w, + i_or_ald8, + i_or_axd16, + i_push_cs, + i_pre_nec, + i_adc_br8, + i_adc_wr16, + i_adc_r8b, + i_adc_r16w, + i_adc_ald8, + i_adc_axd16, + i_push_ss, + i_pop_ss, + i_sbb_br8, + i_sbb_wr16, + i_sbb_r8b, + i_sbb_r16w, + i_sbb_ald8, + i_sbb_axd16, + i_push_ds, + i_pop_ds, + i_and_br8, + i_and_wr16, + i_and_r8b, + i_and_r16w, + i_and_ald8, + i_and_axd16, + i_es, + i_daa, + i_sub_br8, + i_sub_wr16, + i_sub_r8b, + i_sub_r16w, + i_sub_ald8, + i_sub_axd16, + i_cs, + i_das, + i_xor_br8, + i_xor_wr16, + i_xor_r8b, + i_xor_r16w, + i_xor_ald8, + i_xor_axd16, + i_ss, + i_aaa, + i_cmp_br8, + i_cmp_wr16, + i_cmp_r8b, + i_cmp_r16w, + i_cmp_ald8, + i_cmp_axd16, + i_ds, + i_aas, + i_inc_ax, + i_inc_cx, + i_inc_dx, + i_inc_bx, + i_inc_sp, + i_inc_bp, + i_inc_si, + i_inc_di, + i_dec_ax, + i_dec_cx, + i_dec_dx, + i_dec_bx, + i_dec_sp, + i_dec_bp, + i_dec_si, + i_dec_di, + i_push_ax, + i_push_cx, + i_push_dx, + i_push_bx, + i_push_sp, + i_push_bp, + i_push_si, + i_push_di, + i_pop_ax, + i_pop_cx, + i_pop_dx, + i_pop_bx, + i_pop_sp, + i_pop_bp, + i_pop_si, + i_pop_di, + i_pusha, + i_popa, + i_chkind, + i_brkn, + i_repnc, + i_repc, + i_invalid, + i_invalid, + i_push_d16, + i_imul_d16, + i_push_d8, + i_imul_d8, + i_insb, + i_insw, + i_outsb, + i_outsw, + i_jo, + i_jno, + i_jc, + i_jnc, + i_jz, + i_jnz, + i_jce, + i_jnce, + i_js, + i_jns, + i_jp, + i_jnp, + i_jl, + i_jnl, + i_jle, + i_jnle, + i_80pre, + i_81pre, + i_82pre, + i_83pre, + i_test_br8, + i_test_wr16, + i_xchg_br8, + i_xchg_wr16, + i_mov_br8, + i_mov_wr16, + i_mov_r8b, + i_mov_r16w, + i_mov_wsreg, + i_lea, + i_mov_sregw, + i_popw, + i_nop, + i_xchg_axcx, + i_xchg_axdx, + i_xchg_axbx, + i_xchg_axsp, + i_xchg_axbp, + i_xchg_axsi, + i_xchg_axdi, + i_cbw, + i_cwd, + i_call_far, + i_wait, + i_pushf, + i_popf, + i_sahf, + i_lahf, + i_mov_aldisp, + i_mov_axdisp, + i_mov_dispal, + i_mov_dispax, + i_movsb, + i_movsw, + i_cmpsb, + i_cmpsw, + i_test_ald8, + i_test_axd16, + i_stosb, + i_stosw, + i_lodsb, + i_lodsw, + i_scasb, + i_scasw, + i_mov_ald8, + i_mov_cld8, + i_mov_dld8, + i_mov_bld8, + i_mov_ahd8, + i_mov_chd8, + i_mov_dhd8, + i_mov_bhd8, + i_mov_axd16, + i_mov_cxd16, + i_mov_dxd16, + i_mov_bxd16, + i_mov_spd16, + i_mov_bpd16, + i_mov_sid16, + i_mov_did16, + i_rotshft_bd8, + i_rotshft_wd8, + i_ret_d16, + i_ret, + i_les_dw, + i_lds_dw, + i_mov_bd8, + i_mov_wd16, + i_enter, + i_leave, + i_retf_d16, + i_retf, + i_int3, + i_int, + i_into, + i_iret, + i_rotshft_b, + i_rotshft_w, + i_rotshft_bcl, + i_rotshft_wcl, + i_aam, + i_aad, + i_setalc, + i_trans, + i_fpo, + i_fpo, + i_fpo, + i_fpo, + i_fpo, + i_fpo, + i_fpo, + i_fpo, + i_loopne, + i_loope, + i_loop, + i_jcxz, + i_inal, + i_inax, + i_outal, + i_outax, + i_call_d16, + i_jmp_d16, + i_jmp_far, + i_jmp_d8, + i_inaldx, + i_inaxdx, + i_outdxal, + i_outdxax, + i_lock, + i_invalid, + i_repne, + i_repe, + i_hlt, + i_cmc, + i_f6pre, + i_f7pre, + i_clc, + i_stc, + i_di, + i_ei, + i_cld, + i_std, + i_fepre, + i_ffpre + }; + GetEA = new getea_delegate[192]{ + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, + + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, + + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, + EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207 + }; + } + public override void Reset() + { + nec_reset(); + } + public void nec_reset() + { + //const nec_config *config; + uint i, j, c; + //BREGS[] reg_name = new BREGS[8] { BREGS.AL, BREGS.CL, BREGS.DL, BREGS.BL, BREGS.AH, BREGS.CH, BREGS.DH, BREGS.BH }; + int[] reg_name = new int[8] { 0, 2, 4, 6, 1, 3, 5, 7 }; + //int (*save_irqcallback)(int); + //memory_interface save_mem; + //save_irqcallback = I.irq_callback; + //save_mem = I.mem; + //config = I.config; + I.sregs = new ushort[4]; + I.regs.b = new byte[16]; + for (i = 0; i < 4; i++) + { + I.sregs[i] = 0; + } + I.ip = 0; + I.SignVal = 0; + I.AuxVal = 0; + I.OverVal = 0; + I.ZeroVal = 0; + I.CarryVal = 0; + I.ParityVal = 0; + I.TF = false; + I.IF = false; + I.DF = false; + I.MF = false; + I.int_vector = 0; + I.pending_irq = 0; + I.irq_state = 0; + I.poll_state = false; + I.no_interrupt = 0; + //I.irq_callback = save_irqcallback; + //I.mem = save_mem; + //I.config = config; + I.sregs[1] = 0xffff; + //PC = (I.sregs[1] << 4) + I.ip; + for (i = 0; i < 256; i++) + { + for (j = i, c = 0; j > 0; j >>= 1) + { + if ((j & 1) != 0) + { + c++; + } + } + parity_table[i] = ((c & 1) == 0); + } + I.ZeroVal = I.ParityVal = 1; + I.MF = true; + for (i = 0; i < 256; i++) + { + mod_RM.regb[i] = reg_name[(i & 0x38) >> 3]; + mod_RM.regw[i] = (int)((i & 0x38) >> 3); + } + for (i = 0xc0; i < 0x100; i++) + { + mod_RM.RMw[i] = (int)(i & 7); + mod_RM.RMb[i] = reg_name[i & 7]; + } + I.poll_state = true; + } + public void nec_interrupt(int int_num, bool md_flag) + { + uint dest_seg, dest_off; + i_pushf(); + I.TF = I.IF = false; + if (md_flag) + { + I.MF = false; + } + if (int_num == -1) + { + int_num = Cpuint.cpu_irq_callback(cpunum, 0); + I.irq_state = 0; + I.pending_irq &= 0xfffffffe; + } + dest_off = ReadWord(int_num * 4); + dest_seg = ReadWord(int_num * 4 + 2); + PUSH(I.sregs[1]); + PUSH(I.ip); + I.ip = (ushort)dest_off; + I.sregs[1] = (ushort)dest_seg; + //CHANGE_PC; + } + public void nec_trap() + { + nec_instruction[fetchop()](); + nec_interrupt(1, false); + } + public void external_int() + { + if ((I.pending_irq & 0x02) != 0) + { + nec_interrupt(2, false); + I.pending_irq &= unchecked((uint)(~2)); + } + else if (I.pending_irq != 0) + { + nec_interrupt(-1, false); + } + } + public void SaveStateBinary(BinaryWriter writer) + { + int i; + writer.Write(I.regs.b, 0, 16); + for (i = 0; i < 4; i++) + { + writer.Write(I.sregs[i]); + } + writer.Write(I.ip); + writer.Write(I.TF); + writer.Write(I.IF); + writer.Write(I.DF); + writer.Write(I.MF); + writer.Write(I.SignVal); + writer.Write(I.int_vector); + writer.Write(I.pending_irq); + writer.Write(I.nmi_state); + writer.Write(I.irq_state); + writer.Write(I.poll_state); + writer.Write(I.AuxVal); + writer.Write(I.OverVal); + writer.Write(I.ZeroVal); + writer.Write(I.CarryVal); + writer.Write(I.ParityVal); + writer.Write(I.no_interrupt); + writer.Write(prefix_base); + writer.Write(seg_prefix); + writer.Write(TotalExecutedCycles); + writer.Write(PendingCycles); + } + public void LoadStateBinary(BinaryReader reader) + { + int i; + I.regs.b = reader.ReadBytes(16); + for (i = 0; i < 4; i++) + { + I.sregs[i] = reader.ReadUInt16(); + } + I.ip = reader.ReadUInt16(); + I.TF = reader.ReadBoolean(); + I.IF = reader.ReadBoolean(); + I.DF = reader.ReadBoolean(); + I.MF = reader.ReadBoolean(); + I.SignVal = reader.ReadInt32(); + I.int_vector = reader.ReadUInt32(); + I.pending_irq = reader.ReadUInt32(); + I.nmi_state = reader.ReadUInt32(); + I.irq_state = reader.ReadUInt32(); + I.poll_state = reader.ReadBoolean(); + I.AuxVal = reader.ReadUInt32(); + I.OverVal = reader.ReadUInt32(); + I.ZeroVal = reader.ReadUInt32(); + I.CarryVal = reader.ReadUInt32(); + I.ParityVal = reader.ReadUInt32(); + I.no_interrupt = reader.ReadByte(); + prefix_base = reader.ReadInt32(); + seg_prefix = reader.ReadInt32(); + TotalExecutedCycles = reader.ReadUInt64(); + PendingCycles = reader.ReadInt32(); + } + } + public class V30 : Nec + { + public V30() + { + nec_init(); + chip_type = 8; + } + public override int ExecuteCycles(int cycles) + { + return v30_execute(cycles); + } + public int v30_execute(int cycles) + { + pendingCycles = cycles; + while (pendingCycles > 0) + { + int prevCycles = pendingCycles; + if (I.pending_irq != 0 && I.no_interrupt == 0) + { + if ((I.pending_irq & NMI_IRQ) != 0) + { + external_int(); + } + else if (I.IF) + { + external_int(); + } + } + if (I.no_interrupt != 0) + { + I.no_interrupt--; + } + iNOP = fetchop(); + nec_instruction[iNOP](); + int delta = prevCycles - pendingCycles; + totalExecutedCycles += (ulong)delta; + } + return cycles - pendingCycles; + } + } + public class V33 : Nec + { + public V33() + { + nec_init(); + chip_type = 0; + } + public override int ExecuteCycles(int cycles) + { + return v33_execute(cycles); + } + public int v33_execute(int cycles) + { + pendingCycles = cycles; + while (pendingCycles > 0) + { + int prevCycles = pendingCycles; + if (I.pending_irq != 0 && I.no_interrupt == 0) + { + if ((I.pending_irq & NMI_IRQ) != 0) + { + external_int(); + } + else if (I.IF) + { + external_int(); + } + } + if (I.no_interrupt != 0) + { + I.no_interrupt--; + } + iNOP = fetchop(); + nec_instruction[iNOP](); + int delta = prevCycles - pendingCycles; + totalExecutedCycles += (ulong)delta; + } + return cycles - pendingCycles; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/Nec.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/Nec.cs.meta new file mode 100644 index 00000000..5db7cd50 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/Nec.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3565408bc12d5c4eafb64846e799d0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecEa.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecEa.cs new file mode 100644 index 00000000..1870edbe --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecEa.cs @@ -0,0 +1,170 @@ +namespace cpu.nec +{ + partial class Nec + { + static int EA; + static ushort EO; + static ushort E16; + int EA_000() + { + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + I.regs.b[12] + I.regs.b[13] * 0x100); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_001() + { + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + I.regs.b[14] + I.regs.b[15] * 0x100); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_002() + { + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + I.regs.b[12] + I.regs.b[13] * 0x100); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_003() + { + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + I.regs.b[14] + I.regs.b[15] * 0x100); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_004() + { + EO = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_005() + { + EO = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_006() + { + EO = FETCH(); + EO += (ushort)(FETCH() << 8); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_007() + { + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_100() + { + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + I.regs.b[12] + I.regs.b[13] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_101() + { + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + I.regs.b[14] + I.regs.b[15] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_102() + { + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + I.regs.b[12] + I.regs.b[13] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_103() + { + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + I.regs.b[14] + I.regs.b[15] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_104() + { + EO = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_105() + { + EO = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_106() + { + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_107() + { + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + (sbyte)FETCH()); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_200() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + I.regs.b[12] + I.regs.b[13] * 0x100 + (short)E16); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_201() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + I.regs.b[14] + I.regs.b[15] * 0x100 + (short)E16); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_202() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + I.regs.b[12] + I.regs.b[13] * 0x100 + (short)E16); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_203() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + I.regs.b[14] + I.regs.b[15] * 0x100 + (short)E16); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_204() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (short)E16); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_205() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (short)E16); + EA = DefaultBase(3, I) + EO; + return EA; + } + int EA_206() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[10] + I.regs.b[11] * 0x100 + (short)E16); + EA = DefaultBase(2, I) + EO; + return EA; + } + int EA_207() + { + E16 = FETCH(); + E16 += (ushort)(FETCH() << 8); + EO = (ushort)(I.regs.b[6] + I.regs.b[7] * 0x100 + (short)E16); + EA = DefaultBase(3, I) + EO; + return EA; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecEa.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecEa.cs.meta new file mode 100644 index 00000000..ead41dc2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecEa.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d5f27e4fff949a459570d38e744620f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecInstr.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecInstr.cs new file mode 100644 index 00000000..fe093627 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecInstr.cs @@ -0,0 +1,2472 @@ +namespace cpu.nec +{ + partial class Nec + { + void i_add_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + ADDB(ref src, ref dst); + PutbackRMByte(ModRM, dst); + CLKM(ModRM, 2, 2, 2, 16, 16, 7); + } + void i_add_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + ADDW(ref src, ref dst); + PutbackRMWord(ModRM, dst); + CLKR(ModRM, 24, 24, 11, 24, 16, 7, 2, EA); + } + void i_add_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + ADDB(ref src, ref dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_add_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + ADDW(ref src, ref dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_add_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + ADDB(ref src, ref dst); + I.regs.b[0] = dst; + CLKS(4, 4, 2); + } + void i_add_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + ADDW(ref src, ref dst); + //I.regs.w[0] = dst; + I.regs.b[0] = (byte)(dst % 0x100); + I.regs.b[1] = (byte)(dst / 0x100); + CLKS(4, 4, 2); + } + void i_push_es() + { + PUSH(I.sregs[0]); + CLKS(12, 8, 3); + } + void i_pop_es() + { + POP(ref I.sregs[0]); + CLKS(12, 8, 5); + } + void i_or_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + ORB(ref src, ref dst); + PutbackRMByte(ModRM, dst); + CLKM(ModRM, 2, 2, 2, 16, 16, 7); + } + void i_or_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + ORW(ref src, ref dst); + PutbackRMWord(ModRM, dst); + CLKR(ModRM, 24, 24, 11, 24, 16, 7, 2, EA); + } + void i_or_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + ORB(ref src, ref dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_or_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + ORW(ref src, ref dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_or_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + ORB(ref src, ref dst); + I.regs.b[0] = dst; + CLKS(4, 4, 2); + } + void i_or_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + ORW(ref src, ref dst); + //I.regs.w[0] = dst; + I.regs.b[0] = (byte)(dst % 0x100); + I.regs.b[1] = (byte)(dst / 0x100); + CLKS(4, 4, 2); + } + void i_push_cs() + { + PUSH(I.sregs[1]); + CLKS(12, 8, 3); + } + void i_pre_nec() + { + int ModRM = 0, tmp = 0, tmp2 = 0; + switch (FETCH()) + { + case 0x10: BITOP_BYTE(ref ModRM, ref tmp); CLKS(3, 3, 4); tmp2 = I.regs.b[2] & 0x7; I.ZeroVal = (uint)(((tmp & (1 << tmp2)) != 0) ? 1 : 0); I.CarryVal = I.OverVal = 0; break; /* Test */ + case 0x11: BITOP_WORD(ref ModRM, ref tmp); CLKS(3, 3, 4); tmp2 = I.regs.b[2] & 0xf; I.ZeroVal = (uint)(((tmp & (1 << tmp2)) != 0) ? 1 : 0); I.CarryVal = I.OverVal = 0; break; /* Test */ + case 0x12: BITOP_BYTE(ref ModRM, ref tmp); CLKS(5, 5, 4); tmp2 = I.regs.b[2] & 0x7; tmp &= ~(1 << tmp2); PutbackRMByte(ModRM, (byte)tmp); break; /* Clr */ + case 0x13: BITOP_WORD(ref ModRM, ref tmp); CLKS(5, 5, 4); tmp2 = I.regs.b[2] & 0xf; tmp &= ~(1 << tmp2); PutbackRMWord(ModRM, (ushort)tmp); break; /* Clr */ + case 0x14: BITOP_BYTE(ref ModRM, ref tmp); CLKS(4, 4, 4); tmp2 = I.regs.b[2] & 0x7; tmp |= (1 << tmp2); PutbackRMByte(ModRM, (byte)tmp); break; /* Set */ + case 0x15: BITOP_WORD(ref ModRM, ref tmp); CLKS(4, 4, 4); tmp2 = I.regs.b[2] & 0xf; tmp |= (1 << tmp2); PutbackRMWord(ModRM, (ushort)tmp); break; /* Set */ + case 0x16: BITOP_BYTE(ref ModRM, ref tmp); CLKS(4, 4, 4); tmp2 = I.regs.b[2] & 0x7; BIT_NOT(ref tmp, ref tmp2); PutbackRMByte(ModRM, (byte)tmp); break; /* Not */ + case 0x17: BITOP_WORD(ref ModRM, ref tmp); CLKS(4, 4, 4); tmp2 = I.regs.b[2] & 0xf; BIT_NOT(ref tmp, ref tmp2); PutbackRMWord(ModRM, (ushort)tmp); break; /* Not */ + + case 0x18: BITOP_BYTE(ref ModRM, ref tmp); CLKS(4, 4, 4); tmp2 = (FETCH()) & 0x7; I.ZeroVal = (uint)(((tmp & (1 << tmp2)) != 0) ? 1 : 0); I.CarryVal = I.OverVal = 0; break; /* Test */ + case 0x19: BITOP_WORD(ref ModRM, ref tmp); CLKS(4, 4, 4); tmp2 = (FETCH()) & 0xf; I.ZeroVal = (uint)(((tmp & (1 << tmp2)) != 0) ? 1 : 0); I.CarryVal = I.OverVal = 0; break; /* Test */ + case 0x1a: BITOP_BYTE(ref ModRM, ref tmp); CLKS(6, 6, 4); tmp2 = (FETCH()) & 0x7; tmp &= ~(1 << tmp2); PutbackRMByte(ModRM, (byte)tmp); break; /* Clr */ + case 0x1b: BITOP_WORD(ref ModRM, ref tmp); CLKS(6, 6, 4); tmp2 = (FETCH()) & 0xf; tmp &= ~(1 << tmp2); PutbackRMWord(ModRM, (ushort)tmp); break; /* Clr */ + case 0x1c: BITOP_BYTE(ref ModRM, ref tmp); CLKS(5, 5, 4); tmp2 = (FETCH()) & 0x7; tmp |= (1 << tmp2); PutbackRMByte(ModRM, (byte)tmp); break; /* Set */ + case 0x1d: BITOP_WORD(ref ModRM, ref tmp); CLKS(5, 5, 4); tmp2 = (FETCH()) & 0xf; tmp |= (1 << tmp2); PutbackRMWord(ModRM, (ushort)tmp); break; /* Set */ + case 0x1e: BITOP_BYTE(ref ModRM, ref tmp); CLKS(5, 5, 4); tmp2 = (FETCH()) & 0x7; BIT_NOT(ref tmp, ref tmp2); PutbackRMByte(ModRM, (byte)tmp); break; /* Not */ + case 0x1f: BITOP_WORD(ref ModRM, ref tmp); CLKS(5, 5, 4); tmp2 = (FETCH()) & 0xf; BIT_NOT(ref tmp, ref tmp2); PutbackRMWord(ModRM, (ushort)tmp); break; /* Not */ + + case 0x20: ADD4S(ref tmp, ref tmp2); CLKS(7, 7, 2); break; + case 0x22: SUB4S(ref tmp, ref tmp2); CLKS(7, 7, 2); break; + case 0x26: CMP4S(ref tmp, ref tmp2); CLKS(7, 7, 2); break; + case 0x28: ModRM = FETCH(); tmp = GetRMByte(ModRM); tmp <<= 4; tmp |= I.regs.b[0] & 0xf; I.regs.b[0] = (byte)((I.regs.b[0] & 0xf0) | ((tmp >> 8) & 0xf)); tmp &= 0xff; PutbackRMByte(ModRM, (byte)tmp); CLKM(ModRM, 13, 13, 9, 28, 28, 15); break; + case 0x2a: ModRM = FETCH(); tmp = GetRMByte(ModRM); tmp2 = (I.regs.b[0] & 0xf) << 4; I.regs.b[0] = (byte)((I.regs.b[0] & 0xf0) | (tmp & 0xf)); tmp = tmp2 | (tmp >> 4); PutbackRMByte(ModRM, (byte)tmp); CLKM(ModRM, 17, 17, 13, 32, 32, 19); break; + case 0x31: ModRM = FETCH(); ModRM = 0; break; + case 0x33: ModRM = FETCH(); ModRM = 0; break; + case 0x92: CLK(2); break; /* V25/35 FINT */ + case 0xe0: ModRM = FETCH(); ModRM = 0; break; + case 0xf0: ModRM = FETCH(); ModRM = 0; break; + case 0xff: ModRM = FETCH(); ModRM = 0; break; + default: break; + } + } + void i_adc_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + src += (byte)(CF() ? 1 : 0); + ADDB(ref src, ref dst); + PutbackRMByte(ModRM, dst); + CLKM(ModRM, 2, 2, 2, 16, 16, 7); + } + void i_adc_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + src += (ushort)(CF() ? 1 : 0); + ADDW(ref src, ref dst); + PutbackRMWord(ModRM, dst); + CLKR(ModRM, 24, 24, 11, 24, 16, 7, 2, EA); + } + void i_adc_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + src += (byte)(CF() ? 1 : 0); + ADDB(ref src, ref dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_adc_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + src += (ushort)(CF() ? 1 : 0); + ADDW(ref src, ref dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_adc_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + src += (byte)(CF() ? 1 : 0); + ADDB(ref src, ref dst); + I.regs.b[0] = dst; + CLKS(4, 4, 2); + } + void i_adc_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + src += (ushort)(CF() ? 1 : 0); + ADDW(ref src, ref dst); + //I.regs.w[0] = dst; + I.regs.b[0] = (byte)(dst % 0x100); + I.regs.b[1] = (byte)(dst / 0x100); + CLKS(4, 4, 2); + } + void i_push_ss() + { + PUSH(I.sregs[2]); + CLKS(12, 8, 3); + } + void i_pop_ss() + { + POP(ref I.sregs[2]); + CLKS(12, 8, 5); + I.no_interrupt = 1; + } + void i_sbb_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + src += (byte)(CF() ? 1 : 0); + SUBB(ref src, ref dst); + PutbackRMByte(ModRM, dst); + CLKM(ModRM, 2, 2, 2, 16, 16, 7); + } + void i_sbb_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + src += (ushort)(CF() ? 1 : 0); + SUBW(ref src, ref dst); + PutbackRMWord(ModRM, dst); + CLKR(ModRM, 24, 24, 11, 24, 16, 7, 2, EA); + } + void i_sbb_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + src += (byte)(CF() ? 1 : 0); + SUBB(ref src, ref dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_sbb_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + src += (ushort)(CF() ? 1 : 0); + SUBW(ref src, ref dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_sbb_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + src += (byte)(CF() ? 1 : 0); + SUBB(ref src, ref dst); + I.regs.b[0] = dst; + CLKS(4, 4, 2); + } + void i_sbb_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + src += (ushort)(CF() ? 1 : 0); + SUBW(ref src, ref dst); + //I.regs.w[0] = dst; + I.regs.b[0] = (byte)(dst % 0x100); + I.regs.b[1] = (byte)(dst / 0x100); + CLKS(4, 4, 2); + } + void i_push_ds() + { + PUSH(I.sregs[3]); + CLKS(12, 8, 3); + } + void i_pop_ds() + { + POP(ref I.sregs[3]); + CLKS(12, 8, 5); + } + void i_and_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + ANDB(ref src, ref dst); + PutbackRMByte(ModRM, dst); + CLKM(ModRM, 2, 2, 2, 16, 16, 7); + } + void i_and_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + ANDW(ref src, ref dst); + PutbackRMWord(ModRM, dst); + CLKR(ModRM, 24, 24, 11, 24, 16, 7, 2, EA); + } + void i_and_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + ANDB(ref src, ref dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_and_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + ANDW(ref src, ref dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_and_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + ANDB(ref src, ref dst); + I.regs.b[0] = dst; + CLKS(4, 4, 2); + } + void i_and_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + ANDW(ref src, ref dst); + //I.regs.w[0] = dst; + I.regs.b[0] = (byte)(dst % 0x100); + I.regs.b[1] = (byte)(dst / 0x100); + CLKS(4, 4, 2); + } + void i_es() + { + seg_prefix = 1; + prefix_base = I.sregs[0] << 4; + CLK(2); + nec_instruction[fetchop()](); + seg_prefix = 0; + } + void i_daa() + { + ADJ4(6, 0x60); + CLKS(3, 3, 2); + } + void i_sub_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + SUBB(ref src, ref dst); + PutbackRMByte(ModRM, dst); + CLKM(ModRM, 2, 2, 2, 16, 16, 7); + } + void i_sub_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + SUBW(ref src, ref dst); + PutbackRMWord(ModRM, dst); + CLKR(ModRM, 24, 24, 11, 24, 16, 7, 2, EA); + } + void i_sub_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + SUBB(ref src, ref dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_sub_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + SUBW(ref src, ref dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_sub_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + SUBB(ref src, ref dst); + I.regs.b[0] = dst; + CLKS(4, 4, 2); + } + void i_sub_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + SUBW(ref src, ref dst); + //I.regs.w[0] = dst; + I.regs.b[0] = (byte)(dst % 0x100); + I.regs.b[1] = (byte)(dst / 0x100); + CLKS(4, 4, 2); + } + void i_cs() + { + seg_prefix = 1; + prefix_base = I.sregs[1] << 4; + CLK(2); + nec_instruction[fetchop()](); + seg_prefix = 0; + } + void i_das() + { + ADJ4(-6, -0x60); + CLKS(3, 3, 2); + } + void i_xor_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + XORB(ref src, ref dst); + PutbackRMByte(ModRM, dst); + CLKM(ModRM, 2, 2, 2, 16, 16, 7); + } + void i_xor_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + XORW(ref src, ref dst); + PutbackRMWord(ModRM, dst); + CLKR(ModRM, 24, 24, 11, 24, 16, 7, 2, EA); + } + void i_xor_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + XORB(ref src, ref dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_xor_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + XORW(ref src, ref dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_xor_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + XORB(ref src, ref dst); + I.regs.b[0] = dst; + CLKS(4, 4, 2); + } + void i_xor_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + XORW(ref src, ref dst); + //I.regs.w[0] = dst; + I.regs.b[0] = (byte)(dst % 0x100); + I.regs.b[1] = (byte)(dst / 0x100); + CLKS(4, 4, 2); + } + void i_ss() + { + seg_prefix = 1; + prefix_base = I.sregs[2] << 4; + CLK(2); + nec_instruction[fetchop()](); + seg_prefix = 0; + } + void i_aaa() + { + ADJB(6, (I.regs.b[0] > 0xf9) ? 2 : 1); + CLKS(7, 7, 4); + } + void i_cmp_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + SUBB(ref src, ref dst); + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_cmp_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + SUBW(ref src, ref dst); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_cmp_r8b() + { + int ModRM; + byte src, dst; + DEF_r8b(out ModRM, out src, out dst); + SUBB(ref src, ref dst); + CLKM(ModRM, 2, 2, 2, 11, 11, 6); + } + void i_cmp_r16w() + { + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + SUBW(ref src, ref dst); + CLKR(ModRM, 15, 15, 8, 15, 11, 6, 2, EA); + } + void i_cmp_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + SUBB(ref src, ref dst); + CLKS(4, 4, 2); + } + void i_cmp_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + SUBW(ref src, ref dst); + CLKS(4, 4, 2); + } + void i_ds() + { + seg_prefix = 1; + prefix_base = I.sregs[3] << 4; + CLK(2); + nec_instruction[fetchop()](); + seg_prefix = 0; + } + void i_aas() + { + ADJB(-6, (I.regs.b[0] < 6) ? -2 : -1); + CLKS(7, 7, 4); + } + void i_inc_ax() + { + IncWordReg(0); + CLK(2); + } + void i_inc_cx() + { + IncWordReg(1); + CLK(2); + } + void i_inc_dx() + { + IncWordReg(2); + CLK(2); + } + void i_inc_bx() + { + IncWordReg(3); + CLK(2); + } + void i_inc_sp() + { + IncWordReg(4); + CLK(2); + } + void i_inc_bp() + { + IncWordReg(5); + CLK(2); + } + void i_inc_si() + { + IncWordReg(6); + CLK(2); + } + void i_inc_di() + { + IncWordReg(7); + CLK(2); + } + void i_dec_ax() + { + DecWordReg(0); + CLK(2); + } + void i_dec_cx() + { + DecWordReg(1); + CLK(2); + } + void i_dec_dx() + { + DecWordReg(2); + CLK(2); + } + void i_dec_bx() + { + DecWordReg(3); + CLK(2); + } + void i_dec_sp() + { + DecWordReg(4); + CLK(2); + } + void i_dec_bp() + { + DecWordReg(5); + CLK(2); + } + void i_dec_si() + { + DecWordReg(6); + CLK(2); + } + void i_dec_di() + { + DecWordReg(7); + CLK(2); + } + void i_push_ax() + { + //PUSH(I.regs.w[0]); + PUSH((ushort)(I.regs.b[0] + I.regs.b[1] * 0x100)); + CLKS(12, 8, 3); + } + void i_push_cx() + { + //PUSH(I.regs.w[1]); + PUSH((ushort)(I.regs.b[2] + I.regs.b[3] * 0x100)); + CLKS(12, 8, 3); + } + void i_push_dx() + { + //PUSH(I.regs.w[2]); + PUSH((ushort)(I.regs.b[4] + I.regs.b[5] * 0x100)); + CLKS(12, 8, 3); + } + void i_push_bx() + { + //PUSH(I.regs.w[3]); + PUSH((ushort)(I.regs.b[6] + I.regs.b[7] * 0x100)); + CLKS(12, 8, 3); + } + void i_push_sp() + { + //PUSH(I.regs.w[4]); + PUSH((ushort)(I.regs.b[8] + I.regs.b[9] * 0x100)); + CLKS(12, 8, 3); + } + void i_push_bp() + { + //PUSH(I.regs.w[5]); + PUSH((ushort)(I.regs.b[10] + I.regs.b[11] * 0x100)); + CLKS(12, 8, 3); + } + void i_push_si() + { + //PUSH(I.regs.w[6]); + PUSH((ushort)(I.regs.b[12] + I.regs.b[13] * 0x100)); + CLKS(12, 8, 3); + } + void i_push_di() + { + //PUSH(I.regs.w[7]); + PUSH((ushort)(I.regs.b[14] + I.regs.b[15] * 0x100)); + CLKS(12, 8, 3); + } + void i_pop_ax() + { + //POP(ref I.regs.w[0]); + POPW(0); + CLKS(12, 8, 5); + } + void i_pop_cx() + { + //POP(ref I.regs.w[1]); + POPW(1); + CLKS(12, 8, 5); + } + void i_pop_dx() + { + //POP(ref I.regs.w[2]); + POPW(2); + CLKS(12, 8, 5); + } + void i_pop_bx() + { + //POP(ref I.regs.w[3]); + POPW(3); + CLKS(12, 8, 5); + } + void i_pop_sp() + { + //POP(ref I.regs.w[4]); + POPW(4); + CLKS(12, 8, 5); + } + void i_pop_bp() + { + //POP(ref I.regs.w[5]); + POPW(5); + CLKS(12, 8, 5); + } + void i_pop_si() + { + //POP(ref I.regs.w[6]); + POPW(6); + CLKS(12, 8, 5); + } + void i_pop_di() + { + //POP(ref I.regs.w[7]); + POPW(7); + CLKS(12, 8, 5); + } + void i_pusha() + { + ushort tmp = (ushort)(I.regs.b[8] + I.regs.b[9] * 0x100);// I.regs.w[4]; + /*PUSH(I.regs.w[0]); + PUSH(I.regs.w[1]); + PUSH(I.regs.w[2]); + PUSH(I.regs.w[3]);*/ + PUSH((ushort)(I.regs.b[0] + I.regs.b[1] * 0x100)); + PUSH((ushort)(I.regs.b[2] + I.regs.b[3] * 0x100)); + PUSH((ushort)(I.regs.b[4] + I.regs.b[5] * 0x100)); + PUSH((ushort)(I.regs.b[6] + I.regs.b[7] * 0x100)); + PUSH(tmp); + /*PUSH(I.regs.w[5]); + PUSH(I.regs.w[6]); + PUSH(I.regs.w[7]);*/ + PUSH((ushort)(I.regs.b[10] + I.regs.b[11] * 0x100)); + PUSH((ushort)(I.regs.b[12] + I.regs.b[13] * 0x100)); + PUSH((ushort)(I.regs.b[14] + I.regs.b[15] * 0x100)); + CLKS(67, 35, 20); + } + void i_popa() + { + ushort tmp = 0; + /*POP(ref I.regs.w[7]); + POP(ref I.regs.w[6]); + POP(ref I.regs.w[5]);*/ + POPW(7); + POPW(6); + POPW(5); + POP(ref tmp); + /*POP(ref I.regs.w[3]); + POP(ref I.regs.w[2]); + POP(ref I.regs.w[1]); + POP(ref I.regs.w[0]);*/ + POPW(3); + POPW(2); + POPW(1); + POPW(0); + CLKS(75, 43, 22); + } + void i_chkind() + { + int low, high, tmp; + int ModRM; + ModRM = GetModRM(); + low = GetRMWord(ModRM); + high = GetnextRMWord(); + tmp = RegWord(ModRM); + if (tmp < low || tmp > high) + { + nec_interrupt(5, false); + } + pendingCycles -= 20; + } + void i_brkn() + { + nec_interrupt(FETCH(), true); + CLKS(50, 50, 24); + } + void i_repnc() + { + int next = fetchop(); + ushort c = (ushort)(I.regs.b[2] + I.regs.b[3] * 0x100);// I.regs.w[1]; + switch (next) + { /* Segments */ + case 0x26: seg_prefix = 1; prefix_base = (I.sregs[0] << 4); next = fetchop(); CLK(2); break; + case 0x2e: seg_prefix = 1; prefix_base = (I.sregs[1] << 4); next = fetchop(); CLK(2); break; + case 0x36: seg_prefix = 1; prefix_base = (I.sregs[2] << 4); next = fetchop(); CLK(2); break; + case 0x3e: seg_prefix = 1; prefix_base = (I.sregs[3] << 4); next = fetchop(); CLK(2); break; + } + switch (next) + { + case 0x6c: CLK(2); if (c != 0) do { i_insb(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); /*I.regs.w[1] = c;*/ break; + case 0x6d: CLK(2); if (c != 0) do { i_insw(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6e: CLK(2); if (c != 0) do { i_outsb(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6f: CLK(2); if (c != 0) do { i_outsw(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa4: CLK(2); if (c != 0) do { i_movsb(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa5: CLK(2); if (c != 0) do { i_movsw(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa6: CLK(2); if (c != 0) do { i_cmpsb(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa7: CLK(2); if (c != 0) do { i_cmpsw(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaa: CLK(2); if (c != 0) do { i_stosb(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xab: CLK(2); if (c != 0) do { i_stosw(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xac: CLK(2); if (c != 0) do { i_lodsb(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xad: CLK(2); if (c != 0) do { i_lodsw(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xae: CLK(2); if (c != 0) do { i_scasb(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaf: CLK(2); if (c != 0) do { i_scasw(); c--; } while (c > 0 && !CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + default: nec_instruction[next](); break; + } + seg_prefix = 0; + } + void i_repc() + { + int next = fetchop(); + ushort c = (ushort)(I.regs.b[2] + I.regs.b[3] * 0x100);// I.regs.w[1]; + switch (next) + { /* Segments */ + case 0x26: seg_prefix = 1; prefix_base = (I.sregs[0] << 4); next = fetchop(); CLK(2); break; + case 0x2e: seg_prefix = 1; prefix_base = (I.sregs[1] << 4); next = fetchop(); CLK(2); break; + case 0x36: seg_prefix = 1; prefix_base = (I.sregs[2] << 4); next = fetchop(); CLK(2); break; + case 0x3e: seg_prefix = 1; prefix_base = (I.sregs[3] << 4); next = fetchop(); CLK(2); break; + } + switch (next) + { + case 0x6c: CLK(2); if (c != 0) do { i_insb(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100);/*I.regs.w[1] = c;*/ break; + case 0x6d: CLK(2); if (c != 0) do { i_insw(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6e: CLK(2); if (c != 0) do { i_outsb(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6f: CLK(2); if (c != 0) do { i_outsw(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa4: CLK(2); if (c != 0) do { i_movsb(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa5: CLK(2); if (c != 0) do { i_movsw(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa6: CLK(2); if (c != 0) do { i_cmpsb(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa7: CLK(2); if (c != 0) do { i_cmpsw(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaa: CLK(2); if (c != 0) do { i_stosb(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xab: CLK(2); if (c != 0) do { i_stosw(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xac: CLK(2); if (c != 0) do { i_lodsb(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xad: CLK(2); if (c != 0) do { i_lodsw(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xae: CLK(2); if (c != 0) do { i_scasb(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaf: CLK(2); if (c != 0) do { i_scasw(); c--; } while (c > 0 && CF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + default: nec_instruction[next](); break; + } + seg_prefix = 0; + } + void i_push_d16() + { + int tmp; + tmp = FETCHWORD(); + PUSH((ushort)tmp); + //CLKW(12, 12, 5, 12, 8, 5, I.regs.w[4]); + CLKW(12, 12, 5, 12, 8, 5, I.regs.b[8] + I.regs.b[9] * 0x100); + } + void i_imul_d16() + { + int tmp; + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + tmp = FETCHWORD(); + dst = (ushort)((int)((short)src) * (int)((short)tmp)); + I.CarryVal = I.OverVal = (uint)(((((int)dst) >> 15 != 0) && (((int)dst) >> 15 != -1)) ? 1 : 0); + //I.regs.w[mod_RM.regw[ModRM]] = (ushort)dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + pendingCycles -= (ModRM >= 0xc0) ? 38 : 47; + } + void i_push_d8() + { + int tmp = (ushort)((short)((sbyte)FETCH())); + PUSH((ushort)tmp); + //CLKW(11, 11, 5, 11, 7, 3, I.regs.w[4]); + CLKW(11, 11, 5, 11, 7, 3, I.regs.b[8] + I.regs.b[9] * 0x100); + } + void i_imul_d8() + { + int src2; + int ModRM; + ushort src, dst; + DEF_r16w(out ModRM, out src, out dst); + src2 = (ushort)((short)((sbyte)FETCH())); + dst = (ushort)((int)((short)src) * (int)((short)src2)); + I.CarryVal = I.OverVal = (uint)(((((int)dst) >> 15 != 0) && (((int)dst) >> 15 != -1)) ? 1 : 0); + //I.regs.w[mod_RM.regw[ModRM]] = (ushort)dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + pendingCycles -= (ModRM >= 0xc0) ? 31 : 39; + } + void i_insb() + { + //PutMemB(0, I.regs.w[7], ReadIOByte(I.regs.w[2])); + PutMemB(0, I.regs.b[14] + I.regs.b[15] * 0x100, ReadIOByte(I.regs.b[4] + I.regs.b[5] * 0x100)); + //I.regs.w[7] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100); + w7 += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + CLK(8); + } + void i_insw() + { + //PutMemW(0, I.regs.w[7], ReadIOWord(I.regs.w[2])); + PutMemW(0, I.regs.b[14] + I.regs.b[15] * 0x100, ReadIOWord(I.regs.b[4] + I.regs.b[5] * 0x100)); + //I.regs.w[7] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100); + w7 += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + CLKS(18, 10, 8); + } + void i_outsb() + { + //WriteIOByte(I.regs.w[2], GetMemB(3, I.regs.w[6])); + WriteIOByte(I.regs.b[4] + I.regs.b[5] * 0x100, GetMemB(3, I.regs.b[12] + I.regs.b[13] * 0x100)); + //I.regs.w[6] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100); + w6 += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLK(8); + } + void i_outsw() + { + //WriteIOWord(I.regs.w[2], GetMemW(3, I.regs.w[6])); + WriteIOWord(I.regs.b[4] + I.regs.b[5] * 0x100, GetMemW(3, I.regs.b[12] + I.regs.b[13] * 0x100)); + //I.regs.w[6] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100); + w6 += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLKS(18, 10, 8); + } + void i_jo() + { + bool b1 = OF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jno() + { + bool b1 = !OF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jc() + { + bool b1 = CF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jnc() + { + bool b1 = !CF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jz() + { + bool b1 = ZF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jnz() + { + bool b1 = !ZF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jce() + { + bool b1 = CF() || ZF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jnce() + { + bool b1 = !(CF() || ZF()); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_js() + { + bool b1 = SF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jns() + { + bool b1 = !SF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jp() + { + bool b1 = PF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jnp() + { + bool b1 = !PF(); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jl() + { + bool b1 = (SF() != OF()) && (!ZF()); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jnl() + { + bool b1 = (ZF()) || (SF() == OF()); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jle() + { + bool b1 = (ZF()) || (SF() != OF()); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_jnle() + { + bool b1 = (SF() == OF()) && (!ZF()); + JMP(b1); + if (!b1) + { + CLKS(4, 4, 3); + } + } + void i_80pre() + { + int ModRM; + byte src, dst; + ModRM = GetModRM(); + dst = GetRMByte(ModRM); + src = FETCH(); + if (ModRM >= 0xc0) + { + CLKS(4, 4, 2); + } + else if ((ModRM & 0x38) == 0x38) + { + CLKS(13, 13, 6); + } + else + { + CLKS(18, 18, 7); + } + switch (ModRM & 0x38) + { + case 0x00: ADDB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x08: ORB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x10: src += (byte)(CF() ? 1 : 0); ADDB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x18: src += (byte)(CF() ? 1 : 0); SUBB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x20: ANDB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x28: SUBB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x30: XORB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x38: SUBB(ref src, ref dst); break; + } + } + void i_81pre() + { + int ModRM; + ushort src, dst; + ModRM = GetModRM(); + dst = GetRMWord(ModRM); + src = FETCH(); + src += (ushort)(FETCH() << 8); + if (ModRM >= 0xc0) + { + CLKS(4, 4, 2); + } + else if ((ModRM & 0x38) == 0x38) + { + CLKW(17, 17, 8, 17, 13, 6, EA); + } + else + { + CLKW(26, 26, 11, 26, 18, 7, EA); + } + switch (ModRM & 0x38) + { + case 0x00: ADDW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x08: ORW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x10: src += (ushort)(CF() ? 1 : 0); ADDW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x18: src += (ushort)(CF() ? 1 : 0); SUBW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x20: ANDW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x28: SUBW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x30: XORW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x38: SUBW(ref src, ref dst); break; + } + } + void i_82pre() + { + int ModRM; + byte src, dst; + ModRM = GetModRM(); + dst = GetRMByte(ModRM); + src = (byte)((sbyte)FETCH()); + if (ModRM >= 0xc0) + { + CLKS(4, 4, 2); + } + else if ((ModRM & 0x38) == 0x38) + { + CLKS(13, 13, 6); + } + else + { + CLKS(18, 18, 7); + } + switch (ModRM & 0x38) + { + case 0x00: ADDB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x08: ORB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x10: src += (byte)(CF() ? 1 : 0); ADDB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x18: src += (byte)(CF() ? 1 : 0); SUBB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x20: ANDB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x28: SUBB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x30: XORB(ref src, ref dst); PutbackRMByte(ModRM, dst); break; + case 0x38: SUBB(ref src, ref dst); break; + } + } + void i_83pre() + { + int ModRM; + ushort src, dst; + ModRM = GetModRM(); + dst = GetRMWord(ModRM); + src = (ushort)((short)((sbyte)FETCH())); + if (ModRM >= 0xc0) + { + CLKS(4, 4, 2); + } + else if ((ModRM & 0x38) == 0x38) + { + CLKW(17, 17, 8, 17, 13, 6, EA); + } + else + { + CLKW(26, 26, 11, 26, 18, 7, EA); + } + switch (ModRM & 0x38) + { + case 0x00: ADDW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x08: ORW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x10: src += (ushort)(CF() ? 1 : 0); ADDW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x18: src += (ushort)(CF() ? 1 : 0); SUBW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x20: ANDW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x28: SUBW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x30: XORW(ref src, ref dst); PutbackRMWord(ModRM, dst); break; + case 0x38: SUBW(ref src, ref dst); break; + } + } + void i_test_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + ANDB(ref src, ref dst); + CLKM(ModRM, 2, 2, 2, 10, 10, 6); + } + void i_test_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + ANDW(ref src, ref dst); + CLKR(ModRM, 14, 14, 8, 14, 10, 6, 2, EA); + } + void i_xchg_br8() + { + int ModRM; + byte src, dst; + DEF_br8(out ModRM, out src, out dst); + I.regs.b[mod_RM.regb[ModRM]] = dst; + PutbackRMByte(ModRM, src); + CLKM(ModRM, 3, 3, 3, 16, 18, 8); + } + void i_xchg_wr16() + { + int ModRM; + ushort src, dst; + DEF_wr16(out ModRM, out src, out dst); + //I.regs.w[mod_RM.regw[ModRM]] = dst; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(dst % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(dst / 0x100); + PutbackRMWord(ModRM, src); + CLKR(ModRM, 24, 24, 12, 24, 16, 8, 3, EA); + } + void i_mov_br8() + { + int ModRM; + byte src; + ModRM = GetModRM(); + src = I.regs.b[mod_RM.regb[ModRM]]; + PutRMByte(ModRM, src); + CLKM(ModRM, 2, 2, 2, 9, 9, 3); + } + void i_mov_wr16() + { + int ModRM; + ushort src; + ModRM = GetModRM(); + //src = I.regs.w[mod_RM.regw[ModRM]]; + src = (ushort)(I.regs.b[mod_RM.regw[ModRM] * 2] + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] * 0x100); + PutRMWord(ModRM, src); + CLKR(ModRM, 13, 13, 5, 13, 9, 3, 2, EA); + } + void i_mov_r8b() + { + int ModRM; + byte src; + ModRM = GetModRM(); + src = GetRMByte(ModRM); + I.regs.b[mod_RM.regb[ModRM]] = src; + CLKM(ModRM, 2, 2, 2, 11, 11, 5); + } + void i_mov_r16w() + { + int ModRM; + ushort src; + ModRM = GetModRM(); + src = GetRMWord(ModRM); + //I.regs.w[mod_RM.regw[ModRM]] = src; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(src % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(src / 0x100); + CLKR(ModRM, 15, 15, 7, 15, 11, 5, 2, EA); + } + void i_mov_wsreg() + { + int ModRM; + ModRM = GetModRM(); + PutRMWord(ModRM, I.sregs[(ModRM & 0x38) >> 3]); + CLKR(ModRM, 14, 14, 5, 14, 10, 3, 2, EA); + } + void i_lea() + { + int ModRM = FETCH(); + GetEA[ModRM](); + //I.regs.w[mod_RM.regw[ModRM]] = EO; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(EO % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(EO / 0x100); + CLKS(4, 4, 2); + } + void i_mov_sregw() + { + int ModRM; + ushort src; + ModRM = GetModRM(); + src = GetRMWord(ModRM); + CLKR(ModRM, 15, 15, 7, 15, 11, 5, 2, EA); + switch (ModRM & 0x38) + { + case 0x00: I.sregs[0] = src; break; /* mov es,ew */ + case 0x08: I.sregs[1] = src; break; /* mov cs,ew */ + case 0x10: I.sregs[2] = src; break; /* mov ss,ew */ + case 0x18: I.sregs[3] = src; break; /* mov ds,ew */ + default: break; + } + I.no_interrupt = 1; + } + void i_popw() + { + int ModRM; + ushort tmp = 0; + ModRM = GetModRM(); + POP(ref tmp); + PutRMWord(ModRM, tmp); + pendingCycles -= 21; + } + void i_nop() + { + CLK(3); + if (I.no_interrupt == 0 && pendingCycles > 0 && (I.pending_irq == 0) && (PEEKOP((uint)((I.sregs[1] << 4) + I.ip))) == 0xeb && (PEEK((uint)((I.sregs[1] << 4) + I.ip + 1))) == 0xfd) + pendingCycles %= 15; + } + void i_xchg_axcx() + { + XchgAWReg(1); + CLK(3); + } + void i_xchg_axdx() + { + XchgAWReg(2); + CLK(3); + } + void i_xchg_axbx() + { + XchgAWReg(3); + CLK(3); + } + void i_xchg_axsp() + { + XchgAWReg(4); + CLK(3); + } + void i_xchg_axbp() + { + XchgAWReg(5); + CLK(3); + } + void i_xchg_axsi() + { + XchgAWReg(6); + CLK(3); + } + void i_xchg_axdi() + { + XchgAWReg(7); + CLK(3); + } + void i_cbw() + { + I.regs.b[1] = (byte)(((I.regs.b[0] & 0x80) != 0) ? 0xff : 0); + CLK(2); + } + void i_cwd() + { + //I.regs.w[2] = (ushort)(((I.regs.b[1] & 0x80) != 0) ? 0xffff : 0); + ushort w2 = (ushort)(((I.regs.b[1] & 0x80) != 0) ? 0xffff : 0); + I.regs.b[4] = (byte)(w2 % 0x100); + I.regs.b[5] = (byte)(w2 / 0x100); + CLK(4); + } + void i_call_far() + { + ushort tmp, tmp2; + tmp = FETCHWORD(); + tmp2 = FETCHWORD(); + PUSH(I.sregs[1]); + PUSH(I.ip); + I.ip = (ushort)tmp; + I.sregs[1] = (ushort)tmp2; + //CHANGE_PC; + CLKW(29, 29, 13, 29, 21, 9, I.regs.b[8] + I.regs.b[9] * 0x100); + } + void i_wait() + { + if (!I.poll_state) + { + I.ip--; + } + CLK(5); + } + void i_pushf() + { + ushort tmp = CompressFlags(); + PUSH(tmp); + CLKS(12, 8, 3); + } + void i_popf() + { + ushort tmp = 0; + POP(ref tmp); + ExpandFlags(tmp); + CLKS(12, 8, 5); + if (I.TF) + { + nec_trap(); + } + } + void i_sahf() + { + ushort tmp = (ushort)((CompressFlags() & 0xff00) | (I.regs.b[1] & 0xd5)); + ExpandFlags(tmp); + CLKS(3, 3, 2); + } + void i_lahf() + { + I.regs.b[1] = (byte)(CompressFlags() & 0xff); + CLKS(3, 3, 2); + } + void i_mov_aldisp() + { + ushort addr; + addr = FETCHWORD(); + I.regs.b[0] = GetMemB(3, addr); + CLKS(10, 10, 5); + } + void i_mov_axdisp() + { + ushort addr; + addr = FETCHWORD(); + //I.regs.w[0] = GetMemW(3, addr); + ushort w0 = GetMemW(3, addr); + I.regs.b[0] = (byte)(w0 % 0x100); + I.regs.b[1] = (byte)(w0 / 0x100); + CLKW(14, 14, 7, 14, 10, 5, addr); + } + void i_mov_dispal() + { + ushort addr; + addr = FETCHWORD(); + PutMemB(3, addr, I.regs.b[0]); + CLKS(9, 9, 3); + } + void i_mov_dispax() + { + ushort addr; + addr = FETCHWORD(); + PutMemW(3, addr, (ushort)(I.regs.b[0] + I.regs.b[1] * 0x100)); + CLKW(13, 13, 5, 13, 9, 3, addr); + } + void i_movsb() + { + byte tmp = GetMemB(3, I.regs.b[12] + I.regs.b[13] * 0x100); + PutMemB(0, I.regs.b[14] + I.regs.b[15] * 0x100, tmp); + //I.regs.w[7] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + //I.regs.w[6] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-2 * (I.DF ? 1 : 0) + 1)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (-2 * (I.DF ? 1 : 0) + 1)); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLKS(8, 8, 6); + } + void i_movsw() + { + ushort tmp = GetMemW(3, I.regs.b[12] + I.regs.b[13] * 0x100); + PutMemW(0, I.regs.b[14] + I.regs.b[15] * 0x100, tmp); + //I.regs.w[7] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + //I.regs.w[6] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-4 * (I.DF ? 1 : 0) + 2)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (-4 * (I.DF ? 1 : 0) + 2)); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLKS(16, 16, 10); + } + void i_cmpsb() + { + byte src = GetMemB(0, I.regs.b[14] + I.regs.b[15] * 0x100); + byte dst = GetMemB(3, I.regs.b[12] + I.regs.b[13] * 0x100); + SUBB(ref src, ref dst); + //I.regs.w[7] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + //I.regs.w[6] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-2 * (I.DF ? 1 : 0) + 1)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (-2 * (I.DF ? 1 : 0) + 1)); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLKS(14, 14, 14); + } + void i_cmpsw() + { + ushort src = GetMemW(0, I.regs.b[14] + I.regs.b[15] * 0x100); + ushort dst = GetMemW(3, I.regs.b[12] + I.regs.b[13] * 0x100); + SUBW(ref src, ref dst); + //I.regs.w[7] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + //I.regs.w[6] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-4 * (I.DF ? 1 : 0) + 2)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (-4 * (I.DF ? 1 : 0) + 2)); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLKS(14, 14, 14); + } + void i_test_ald8() + { + byte src, dst; + DEF_ald8(out src, out dst); + ANDB(ref src, ref dst); + CLKS(4, 4, 2); + } + void i_test_axd16() + { + ushort src, dst; + DEF_axd16(out src, out dst); + ANDW(ref src, ref dst); + CLKS(4, 4, 2); + } + void i_stosb() + { + PutMemB(0, I.regs.b[14] + I.regs.b[15] * 0x100, I.regs.b[0]); + //I.regs.w[7] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-2 * (I.DF ? 1 : 0) + 1)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + CLKS(4, 4, 3); + } + void i_stosw() + { + PutMemW(0, I.regs.b[14] + I.regs.b[15] * 0x100, (ushort)(I.regs.b[0] + I.regs.b[1] * 0x100)); + //I.regs.w[7] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-4 * (I.DF ? 1 : 0) + 2)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + CLKW(8, 8, 5, 8, 4, 3, I.regs.b[14] + I.regs.b[15] * 0x100); + } + void i_lodsb() + { + I.regs.b[0] = GetMemB(3, I.regs.b[12] + I.regs.b[13] * 0x100); + //I.regs.w[6] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (-2 * (I.DF ? 1 : 0) + 1)); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLKS(4, 4, 3); + } + void i_lodsw() + { + ushort w0 = GetMemW(3, I.regs.b[12] + I.regs.b[13] * 0x100); + I.regs.b[0] = (byte)(w0 % 0x100); + I.regs.b[1] = (byte)(w0 / 0x100); + //I.regs.w[0] = GetMemW(3, I.regs.b[12] + I.regs.b[13] * 0x100); + //I.regs.w[6] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + ushort w6 = (ushort)(I.regs.b[12] + I.regs.b[13] * 0x100 + (-4 * (I.DF ? 1 : 0) + 2)); + I.regs.b[12] = (byte)(w6 % 0x100); + I.regs.b[13] = (byte)(w6 / 0x100); + CLKW(8, 8, 5, 8, 4, 3, I.regs.b[12] + I.regs.b[13] * 0x100); + } + void i_scasb() + { + byte src = GetMemB(0, I.regs.b[14] + I.regs.b[15] * 0x100); + byte dst = I.regs.b[0]; + SUBB(ref src, ref dst); + //I.regs.w[7] += (ushort)(-2 * (I.DF ? 1 : 0) + 1); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-2 * (I.DF ? 1 : 0) + 1)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + CLKS(4, 4, 3); + } + void i_scasw() + { + ushort src = GetMemW(0, I.regs.b[14] + I.regs.b[15] * 0x100); + ushort dst = (ushort)(I.regs.b[0] + I.regs.b[1] * 0x100); + SUBW(ref src, ref dst); + //I.regs.w[7] += (ushort)(-4 * (I.DF ? 1 : 0) + 2); + ushort w7 = (ushort)(I.regs.b[14] + I.regs.b[15] * 0x100 + (-4 * (I.DF ? 1 : 0) + 2)); + I.regs.b[14] = (byte)(w7 % 0x100); + I.regs.b[15] = (byte)(w7 / 0x100); + CLKW(8, 8, 5, 8, 4, 3, I.regs.b[14] + I.regs.b[15] * 0x100); + } + void i_mov_ald8() + { + I.regs.b[0] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_cld8() + { + I.regs.b[2] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_dld8() + { + I.regs.b[4] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_bld8() + { + I.regs.b[6] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_ahd8() + { + I.regs.b[1] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_chd8() + { + I.regs.b[3] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_dhd8() + { + I.regs.b[5] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_bhd8() + { + I.regs.b[7] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_axd16() + { + I.regs.b[0] = FETCH(); + I.regs.b[1] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_cxd16() + { + I.regs.b[2] = FETCH(); + I.regs.b[3] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_dxd16() + { + I.regs.b[4] = FETCH(); + I.regs.b[5] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_bxd16() + { + I.regs.b[6] = FETCH(); + I.regs.b[7] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_spd16() + { + I.regs.b[8] = FETCH(); + I.regs.b[9] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_bpd16() + { + I.regs.b[10] = FETCH(); + I.regs.b[11] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_sid16() + { + I.regs.b[12] = FETCH(); + I.regs.b[13] = FETCH(); + CLKS(4, 4, 2); + } + void i_mov_did16() + { + I.regs.b[14] = FETCH(); + I.regs.b[15] = FETCH(); + CLKS(4, 4, 2); + } + void i_rotshft_bd8() + { + int ModRM; + int src, dst; + byte c; + ModRM = GetModRM(); + src = GetRMByte(ModRM); + dst = src; + c = FETCH(); + CLKM(ModRM, 7, 7, 2, 19, 19, 6); + if (c != 0) + { + switch (ModRM & 0x38) + { + case 0x00: do { ROL_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x08: do { ROR_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x10: do { ROLC_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x18: do { RORC_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x20: SHL_BYTE(c, ref dst, ModRM); break; + case 0x28: SHR_BYTE(c, ref dst, ModRM); break; + case 0x30: break; + case 0x38: SHRA_BYTE(c, ref dst, ModRM); break; + } + } + } + void i_rotshft_wd8() + { + int ModRM; + int src, dst; + byte c; + ModRM = GetModRM(); + src = GetRMWord(ModRM); + dst = src; + c = FETCH(); + CLKM(ModRM, 7, 7, 2, 27, 19, 6); + if (c != 0) + { + switch (ModRM & 0x38) + { + case 0x00: do { ROL_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x08: do { ROR_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x10: do { ROLC_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x18: do { RORC_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x20: SHL_WORD(c, ref dst, ModRM); break; + case 0x28: SHR_WORD(c, ref dst, ModRM); break; + case 0x30: break; + case 0x38: SHRA_WORD(c, ref dst, ModRM); break; + } + } + } + void i_ret_d16() + { + ushort count = FETCH(); + count += (ushort)(FETCH() << 8); + POP(ref I.ip); + //I.regs.w[4] += count; + ushort w4 = (ushort)(I.regs.b[8] + I.regs.b[9] * 0x100 + count); + I.regs.b[8] = (byte)(w4 % 0x100); + I.regs.b[9] = (byte)(w4 / 0x100); + //CHANGE_PC; + CLKS(24, 24, 10); + } + void i_ret() + { + POP(ref I.ip); + //CHANGE_PC; + CLKS(19, 19, 10); + } + void i_les_dw() + { + int ModRM; + ModRM = GetModRM(); + ushort tmp = GetRMWord(ModRM); + //I.regs.w[mod_RM.regw[ModRM]] = tmp; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(tmp % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(tmp / 0x100); + I.sregs[0] = GetnextRMWord(); + CLKW(26, 26, 14, 26, 18, 10, EA); + } + void i_lds_dw() + { + int ModRM; + ModRM = GetModRM(); + ushort tmp = GetRMWord(ModRM); + //I.regs.w[mod_RM.regw[ModRM]] = tmp; + I.regs.b[mod_RM.regw[ModRM] * 2] = (byte)(tmp % 0x100); + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] = (byte)(tmp / 0x100); + I.sregs[3] = GetnextRMWord(); + CLKW(26, 26, 14, 26, 18, 10, EA); + } + void i_mov_bd8() + { + int ModRM; + ModRM = GetModRM(); + PutImmRMByte(ModRM); + pendingCycles -= (ModRM >= 0xc0) ? 4 : 11; + } + void i_mov_wd16() + { + int ModRM; + ModRM = GetModRM(); + PutImmRMWord(ModRM); + pendingCycles -= (ModRM >= 0xc0) ? 4 : 15; + } + void i_enter() + { + ushort nb = FETCH(); + int i, level; + pendingCycles -= 23; + nb += (ushort)(FETCH() << 8); + level = FETCH(); + PUSH((ushort)(I.regs.b[10] + I.regs.b[11] * 0x100)); + //I.regs.w[5] = I.regs.w[4]; + I.regs.b[10] = I.regs.b[8]; + I.regs.b[11] = I.regs.b[9]; + //I.regs.w[4] -= nb; + ushort w4 = (ushort)(I.regs.b[8] + I.regs.b[9] * 0x100 - nb); + I.regs.b[8] = (byte)(w4 % 0x100); + I.regs.b[9] = (byte)(w4 / 0x100); + for (i = 1; i < level; i++) + { + PUSH(GetMemW(2, I.regs.b[10] + I.regs.b[11] * 0x100 - i * 2)); + pendingCycles -= 16; + } + if (level != 0) + { + PUSH((ushort)(I.regs.b[10] + I.regs.b[11] * 0x100)); + } + } + void i_leave() + { + //I.regs.w[4] = I.regs.w[5]; + I.regs.b[8] = I.regs.b[10]; + I.regs.b[9] = I.regs.b[11]; + //POP(ref I.regs.w[5]); + POPW(5); + pendingCycles -= 8; + } + void i_retf_d16() + { + ushort count = FETCH(); + count += (ushort)(FETCH() << 8); + POP(ref I.ip); + POP(ref I.sregs[1]); + //I.regs.w[4] += count; + ushort w4 = (ushort)(I.regs.b[8] + I.regs.b[9] * 0x100 + count); + I.regs.b[8] = (byte)(w4 % 0x100); + I.regs.b[9] = (byte)(w4 / 0x100); + //CHANGE_PC; + CLKS(32, 32, 16); + } + void i_retf() + { + POP(ref I.ip); + POP(ref I.sregs[1]); + //CHANGE_PC; + CLKS(29, 29, 16); + } + void i_int3() + { + nec_interrupt(3, false); + CLKS(50, 50, 24); + } + void i_int() + { + nec_interrupt(FETCH(), false); + CLKS(50, 50, 24); + } + void i_into() + { + if (OF()) + { + nec_interrupt(4, false); + CLKS(52, 52, 26); + } + else + { + CLK(3); + } + } + void i_iret() + { + POP(ref I.ip); + POP(ref I.sregs[1]); + i_popf(); + I.MF = true; + //CHANGE_PC; + CLKS(39, 39, 19); + } + void i_rotshft_b() + { + int ModRM; + int src, dst; + ModRM = GetModRM(); + src = GetRMByte(ModRM); + dst = src; + CLKM(ModRM, 6, 6, 2, 16, 16, 7); + switch (ModRM & 0x38) + { + case 0x00: ROL_BYTE(ref dst); PutbackRMByte(ModRM, (byte)dst); I.OverVal = (uint)((src ^ dst) & 0x80); break; + case 0x08: ROR_BYTE(ref dst); PutbackRMByte(ModRM, (byte)dst); I.OverVal = (uint)((src ^ dst) & 0x80); break; + case 0x10: ROLC_BYTE(ref dst); PutbackRMByte(ModRM, (byte)dst); I.OverVal = (uint)((src ^ dst) & 0x80); break; + case 0x18: RORC_BYTE(ref dst); PutbackRMByte(ModRM, (byte)dst); I.OverVal = (uint)((src ^ dst) & 0x80); break; + case 0x20: SHL_BYTE(1, ref dst, ModRM); I.OverVal = (uint)((src ^ dst) & 0x80); break; + case 0x28: SHR_BYTE(1, ref dst, ModRM); I.OverVal = (uint)((src ^ dst) & 0x80); break; + case 0x30: break; + case 0x38: SHRA_BYTE(1, ref dst, ModRM); I.OverVal = 0; break; + } + } + void i_rotshft_w() + { + int ModRM; + int src, dst; + ModRM = GetModRM(); + src = GetRMWord(ModRM); + dst = src; + CLKM(ModRM, 6, 6, 2, 24, 16, 7); + switch (ModRM & 0x38) + { + case 0x00: ROL_WORD(ref dst); PutbackRMWord(ModRM, (ushort)dst); I.OverVal = (uint)((src ^ dst) & 0x8000); break; + case 0x08: ROR_WORD(ref dst); PutbackRMWord(ModRM, (ushort)dst); I.OverVal = (uint)((src ^ dst) & 0x8000); break; + case 0x10: ROLC_WORD(ref dst); PutbackRMWord(ModRM, (ushort)dst); I.OverVal = (uint)((src ^ dst) & 0x8000); break; + case 0x18: RORC_WORD(ref dst); PutbackRMWord(ModRM, (ushort)dst); I.OverVal = (uint)((src ^ dst) & 0x8000); break; + case 0x20: SHL_WORD(1, ref dst, ModRM); I.OverVal = (uint)((src ^ dst) & 0x8000); break; + case 0x28: SHR_WORD(1, ref dst, ModRM); I.OverVal = (uint)((src ^ dst) & 0x8000); break; + case 0x30: break; + case 0x38: SHRA_WORD(1, ref dst, ModRM); I.OverVal = 0; break; + } + } + void i_rotshft_bcl() + { + int ModRM; + int src, dst; + byte c; + ModRM = GetModRM(); + src = GetRMByte(ModRM); + dst = src; + c = I.regs.b[2]; + CLKM(ModRM, 7, 7, 2, 19, 19, 6); + if (c != 0) + { + switch (ModRM & 0x38) + { + case 0x00: do { ROL_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x08: do { ROR_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x10: do { ROLC_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x18: do { RORC_BYTE(ref dst); c--; CLK(1); } while (c > 0); PutbackRMByte(ModRM, (byte)dst); break; + case 0x20: SHL_BYTE(c, ref dst, ModRM); break; + case 0x28: SHR_BYTE(c, ref dst, ModRM); break; + case 0x30: break; + case 0x38: SHRA_BYTE(c, ref dst, ModRM); break; + } + } + } + void i_rotshft_wcl() + { + int ModRM; + int src, dst; + byte c; + ModRM = GetModRM(); + src = GetRMWord(ModRM); + dst = src; + c = I.regs.b[2]; + CLKM(ModRM, 7, 7, 2, 27, 19, 6); + if (c != 0) + { + switch (ModRM & 0x38) + { + case 0x00: do { ROL_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x08: do { ROR_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x10: do { ROLC_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x18: do { RORC_WORD(ref dst); c--; CLK(1); } while (c > 0); PutbackRMWord(ModRM, (ushort)dst); break; + case 0x20: SHL_WORD(c, ref dst, ModRM); break; + case 0x28: SHR_WORD(c, ref dst, ModRM); break; + case 0x30: break; + case 0x38: SHRA_WORD(c, ref dst, ModRM); break; + } + } + } + void i_aam() + { + byte mult = FETCH(); + mult = 0; + I.regs.b[1] = (byte)(I.regs.b[0] / 10); + I.regs.b[0] %= 10; + SetSZPF_Word(I.regs.b[0] + I.regs.b[1] * 0x100); + CLKS(15, 15, 12); + } + void i_aad() + { + byte mult = FETCH(); + mult = 0; + I.regs.b[0] = (byte)(I.regs.b[1] * 10 + I.regs.b[0]); + I.regs.b[1] = 0; + SetSZPF_Byte(I.regs.b[0]); + CLKS(7, 7, 8); + } + void i_setalc() + { + I.regs.b[0] = (byte)(CF() ? 0xff : 0x00); + pendingCycles -= 3; + } + void i_trans() + { + int dest = (I.regs.b[6] + I.regs.b[7] * 0x100 + I.regs.b[0]) & 0xffff; + I.regs.b[0] = GetMemB(3, dest); + CLKS(9, 9, 5); + } + void i_fpo() + { + int ModRM; + ModRM = GetModRM(); + pendingCycles -= 2; + } + void i_loopne() + { + sbyte disp = (sbyte)FETCH(); + //I.regs.w[1]--; + ushort w1 = (ushort)(I.regs.b[2] + I.regs.b[3] * 0x100 - 1); + I.regs.b[2] = (byte)(w1 % 0x100); + I.regs.b[3] = (byte)(w1 / 0x100); + if (!ZF() && (I.regs.b[2] + I.regs.b[3] * 0x100 != 0)) + { + I.ip = (ushort)(I.ip + disp); + CLKS(14, 14, 6); + } + else + { + CLKS(5, 5, 3); + } + } + void i_loope() + { + sbyte disp = (sbyte)FETCH(); + //I.regs.w[1]--; + ushort w1 = (ushort)(I.regs.b[2] + I.regs.b[3] * 0x100 - 1); + I.regs.b[2] = (byte)(w1 % 0x100); + I.regs.b[3] = (byte)(w1 / 0x100); + if (ZF() && (I.regs.b[2] + I.regs.b[3] * 0x100 != 0)) + { + I.ip = (ushort)(I.ip + disp); + CLKS(14, 14, 6); + } + else + { + CLKS(5, 5, 3); + } + } + void i_loop() + { + sbyte disp = (sbyte)FETCH(); + //I.regs.w[1]--; + ushort w1 = (ushort)(I.regs.b[2] + I.regs.b[3] * 0x100 - 1); + I.regs.b[2] = (byte)(w1 % 0x100); + I.regs.b[3] = (byte)(w1 / 0x100); + if (I.regs.b[2] + I.regs.b[3] * 0x100 != 0) + { + I.ip = (ushort)(I.ip + disp); + CLKS(13, 13, 6); + } + else + { + CLKS(5, 5, 3); + } + } + void i_jcxz() + { + sbyte disp = (sbyte)FETCH(); + if (I.regs.b[2] + I.regs.b[3] * 0x100 == 0) + { + I.ip = (ushort)(I.ip + disp); + CLKS(13, 13, 6); + } + else + { + CLKS(5, 5, 3); + } + } + void i_inal() + { + byte port = FETCH(); + I.regs.b[0] = ReadIOByte(port); + CLKS(9, 9, 5); + } + void i_inax() + { + byte port = FETCH(); + //I.regs.w[0] = ReadIOWord(port); + ushort w0 = ReadIOWord(port); + I.regs.b[0] = (byte)(w0 % 0x100); + I.regs.b[1] = (byte)(w0 / 0x100); + CLKW(13, 13, 7, 13, 9, 5, port); + } + void i_outal() + { + byte port = FETCH(); + WriteIOByte(port, I.regs.b[0]); + CLKS(8, 8, 3); + } + void i_outax() + { + byte port = FETCH(); + //WriteIOWord(port, I.regs.w[0]); + WriteIOWord(port, (ushort)(I.regs.b[0] + I.regs.b[1] * 0x100)); + CLKW(12, 12, 5, 12, 8, 3, port); + } + void i_call_d16() + { + ushort tmp; + tmp = FETCHWORD(); + PUSH(I.ip); + I.ip = (ushort)(I.ip + (short)tmp); + //CHANGE_PC; + pendingCycles -= 24; + } + void i_jmp_d16() + { + ushort tmp; + tmp = FETCHWORD(); + I.ip = (ushort)(I.ip + (short)tmp); + //CHANGE_PC; + pendingCycles -= 15; + } + void i_jmp_far() + { + ushort tmp, tmp1; + tmp = FETCHWORD(); + tmp1 = FETCHWORD(); + I.sregs[1] = (ushort)tmp1; + I.ip = (ushort)tmp; + //CHANGE_PC; + pendingCycles -= 27; + } + void i_jmp_d8() + { + int tmp = (int)((sbyte)FETCH()); + pendingCycles -= 12; + if (tmp == -2 && I.no_interrupt == 0 && (I.pending_irq == 0) && pendingCycles > 0) + { + pendingCycles %= 12; + } + I.ip = (ushort)(I.ip + tmp); + } + void i_inaldx() + { + //I.regs.b[0] = ReadIOByte(I.regs.w[2]); + I.regs.b[0] = ReadIOByte(I.regs.b[4] + I.regs.b[5] * 0x100); + CLKS(8, 8, 5); + } + void i_inaxdx() + { + //I.regs.w[0] = ReadIOWord(I.regs.w[2]); + ushort w0 = ReadIOWord(I.regs.b[4] + I.regs.b[5] * 0x100); + I.regs.b[0] = (byte)(w0 % 0x100); + I.regs.b[1] = (byte)(w0 / 0x100); + CLKW(12, 12, 7, 12, 8, 5, I.regs.b[4] + I.regs.b[5] * 0x100); + } + void i_outdxal() + { + //WriteIOByte(I.regs.w[2], I.regs.b[0]); + WriteIOByte(I.regs.b[4] + I.regs.b[5] * 0x100, I.regs.b[0]); + CLKS(8, 8, 3); + } + void i_outdxax() + { + //WriteIOWord(I.regs.w[2], I.regs.w[0]); + //CLKW(12, 12, 5, 12, 8, 3, I.regs.w[2]); + WriteIOWord(I.regs.b[4] + I.regs.b[5] * 0x100, (ushort)(I.regs.b[0] + I.regs.b[1] * 0x100)); + CLKW(12, 12, 5, 12, 8, 3, I.regs.b[4] + I.regs.b[5] * 0x100); + } + void i_lock() + { + I.no_interrupt = 1; + CLK(2); + } + void i_repne() + { + byte next = fetchop(); + ushort c = (ushort)(I.regs.b[2] + I.regs.b[3] * 0x100);//I.regs.w[1]; + switch (next) + { + case 0x26: seg_prefix = 1; prefix_base = (I.sregs[0] << 4); next = fetchop(); CLK(2); break; + case 0x2e: seg_prefix = 1; prefix_base = (I.sregs[1] << 4); next = fetchop(); CLK(2); break; + case 0x36: seg_prefix = 1; prefix_base = (I.sregs[2] << 4); next = fetchop(); CLK(2); break; + case 0x3e: seg_prefix = 1; prefix_base = (I.sregs[3] << 4); next = fetchop(); CLK(2); break; + } + switch (next) + { + case 0x6c: CLK(2); if (c != 0) do { i_insb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100);/*I.regs.w[1] = c;*/ break; + case 0x6d: CLK(2); if (c != 0) do { i_insw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6e: CLK(2); if (c != 0) do { i_outsb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6f: CLK(2); if (c != 0) do { i_outsw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa4: CLK(2); if (c != 0) do { i_movsb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa5: CLK(2); if (c != 0) do { i_movsw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa6: CLK(2); if (c != 0) do { i_cmpsb(); c--; } while (c > 0 && ZF() == false); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa7: CLK(2); if (c != 0) do { i_cmpsw(); c--; } while (c > 0 && ZF() == false); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaa: CLK(2); if (c != 0) do { i_stosb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xab: CLK(2); if (c != 0) do { i_stosw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xac: CLK(2); if (c != 0) do { i_lodsb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xad: CLK(2); if (c != 0) do { i_lodsw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xae: CLK(2); if (c != 0) do { i_scasb(); c--; } while (c > 0 && ZF() == false); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaf: CLK(2); if (c != 0) do { i_scasw(); c--; } while (c > 0 && ZF() == false); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + default: nec_instruction[next](); break; + } + seg_prefix = 0; + } + void i_repe() + { + byte next = fetchop(); + ushort c = (ushort)(I.regs.b[2] + I.regs.b[3] * 0x100);// I.regs.w[1]; + switch (next) + { + case 0x26: seg_prefix = 1; prefix_base = (I.sregs[0] << 4); next = fetchop(); CLK(2); break; + case 0x2e: seg_prefix = 1; prefix_base = (I.sregs[1] << 4); next = fetchop(); CLK(2); break; + case 0x36: seg_prefix = 1; prefix_base = (I.sregs[2] << 4); next = fetchop(); CLK(2); break; + case 0x3e: seg_prefix = 1; prefix_base = (I.sregs[3] << 4); next = fetchop(); CLK(2); break; + } + switch (next) + { + case 0x6c: CLK(2); if (c != 0) do { i_insb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100);/*I.regs.w[1] = c;*/ break; + case 0x6d: CLK(2); if (c != 0) do { i_insw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6e: CLK(2); if (c != 0) do { i_outsb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0x6f: CLK(2); if (c != 0) do { i_outsw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa4: CLK(2); if (c != 0) do { i_movsb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa5: CLK(2); if (c != 0) do { i_movsw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa6: CLK(2); if (c != 0) do { i_cmpsb(); c--; } while (c > 0 && ZF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xa7: CLK(2); if (c != 0) do { i_cmpsw(); c--; } while (c > 0 && ZF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaa: CLK(2); if (c != 0) do { i_stosb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xab: CLK(2); if (c != 0) do { i_stosw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xac: CLK(2); if (c != 0) do { i_lodsb(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xad: CLK(2); if (c != 0) do { i_lodsw(); c--; } while (c > 0); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xae: CLK(2); if (c != 0) do { i_scasb(); c--; } while (c > 0 && ZF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + case 0xaf: CLK(2); if (c != 0) do { i_scasw(); c--; } while (c > 0 && ZF()); I.regs.b[2] = (byte)(c % 0x100); I.regs.b[3] = (byte)(c / 0x100); break; + default: nec_instruction[next](); break; + } + seg_prefix = 0; + } + void i_hlt() + { + pendingCycles = 0; + } + void i_cmc() + { + I.CarryVal = (uint)(CF() ? 0 : 1); + CLK(2); + } + void i_f6pre() + { + int ModRM; + uint tmp; + uint uresult, uresult2; + int result, result2; + ModRM = GetModRM(); + tmp = GetRMByte(ModRM); + switch (ModRM & 0x38) + { + case 0x00: tmp &= FETCH(); I.CarryVal = I.OverVal = 0; SetSZPF_Byte((int)tmp); pendingCycles -= (ModRM >= 0xc0) ? 4 : 11; break; + case 0x08: break; + case 0x10: PutbackRMByte(ModRM, (byte)(~tmp)); pendingCycles -= (ModRM >= 0xc0) ? 2 : 16; break; + case 0x18: I.CarryVal = (uint)((tmp != 0) ? 1 : 0); tmp = (~tmp) + 1; SetSZPF_Byte((int)tmp); PutbackRMByte(ModRM, (byte)(tmp & 0xff)); pendingCycles -= (ModRM >= 0xc0) ? 2 : 16; break; + case 0x20: + uresult = I.regs.b[0] * tmp; + //I.regs.w[0] = (ushort)uresult; + I.regs.b[0] = (byte)((ushort)uresult % 0x100); + I.regs.b[1] = (byte)((ushort)uresult / 0x100); + I.CarryVal = I.OverVal = (uint)((I.regs.b[1] != 0) ? 1 : 0); + pendingCycles -= (ModRM >= 0xc0) ? 30 : 36; + break; + case 0x28: + result = (short)((sbyte)I.regs.b[0]) * (short)((sbyte)tmp); + //I.regs.w[0] = (ushort)result; + I.regs.b[0] = (byte)((ushort)result % 0x100); + I.regs.b[1] = (byte)((ushort)result / 0x100); + I.CarryVal = I.OverVal = (uint)((I.regs.b[1] != 0) ? 1 : 0); + pendingCycles -= (ModRM >= 0xc0) ? 30 : 36; + break; + case 0x30: + if (tmp != 0) + { + bool b1; + DIVUB((int)tmp, out b1); + if (b1) + { + break; + } + } + else + { + nec_interrupt(0, false); + } + pendingCycles -= (ModRM >= 0xc0) ? 43 : 53; + break; + case 0x38: + if (tmp != 0) + { + bool b1; + DIVB((int)tmp, out b1); + if (b1) + { + break; + } + } + else + { + nec_interrupt(0, false); + } + pendingCycles -= (ModRM >= 0xc0) ? 43 : 53; + break; + } + } + void i_f7pre() + { + int ModRM; + uint tmp, tmp2; + uint uresult, uresult2; + int result, result2; + ModRM = GetModRM(); + tmp = GetRMWord(ModRM); + switch (ModRM & 0x38) + { + case 0x00: tmp2 = FETCHWORD(); tmp &= tmp2; I.CarryVal = I.OverVal = 0; SetSZPF_Word((int)tmp); pendingCycles -= (ModRM >= 0xc0) ? 4 : 11; break; + case 0x08: break; + case 0x10: PutbackRMWord(ModRM, (ushort)(~tmp)); pendingCycles -= (ModRM >= 0xc0) ? 2 : 16; break; + case 0x18: I.CarryVal = (uint)((tmp != 0) ? 1 : 0); tmp = (~tmp) + 1; SetSZPF_Word((int)tmp); PutbackRMWord(ModRM, (ushort)(tmp & 0xffff)); pendingCycles -= (ModRM >= 0xc0) ? 2 : 16; break; + case 0x20: + uresult = (uint)((I.regs.b[0] + I.regs.b[1] * 0x100) * tmp); + //I.regs.w[0] = (ushort)(uresult & 0xffff); + //I.regs.w[2] = (ushort)(uresult >> 16); + I.regs.b[0] = (byte)((ushort)(uresult & 0xffff) % 0x100); + I.regs.b[1] = (byte)((ushort)(uresult & 0xffff) / 0x100); + I.regs.b[4] = (byte)((ushort)(uresult >> 16) % 0x100); + I.regs.b[5] = (byte)((ushort)(uresult >> 16) / 0x100); + I.CarryVal = I.OverVal = (uint)(((I.regs.b[4] + I.regs.b[5] * 0x100) != 0) ? 1 : 0); + pendingCycles -= (ModRM >= 0xc0) ? 30 : 36; + break; + case 0x28: + result = (int)((short)(I.regs.b[0] + I.regs.b[1] * 0x100)) * (int)((short)tmp); + //I.regs.w[0] = (ushort)(result & 0xffff); + //I.regs.w[2] = (ushort)(result >> 16); + I.regs.b[0] = (byte)((ushort)(result & 0xffff) % 0x100); + I.regs.b[1] = (byte)((ushort)(result & 0xffff) / 0x100); + I.regs.b[4] = (byte)((ushort)(result >> 16) % 0x100); + I.regs.b[5] = (byte)((ushort)(result >> 16) / 0x100); + I.CarryVal = I.OverVal = (uint)(((I.regs.b[4] + I.regs.b[5] * 0x100) != 0) ? 1 : 0); + pendingCycles -= (ModRM >= 0xc0) ? 30 : 36; + break; + case 0x30: + if (tmp != 0) + { + bool b1; + DIVUW((int)tmp, out b1); + if (b1) + { + break; + } + } + else + { + nec_interrupt(0, false); + } + pendingCycles -= (ModRM >= 0xc0) ? 43 : 53; + break; + case 0x38: + if (tmp != 0) + { + bool b1; + DIVW((int)tmp, out b1); + if (b1) + { + break; + } + } + else + { + nec_interrupt(0, false); + } + pendingCycles -= (ModRM >= 0xc0) ? 43 : 53; + break; + } + } + void i_clc() + { + I.CarryVal = 0; + CLK(2); + } + void i_stc() + { + I.CarryVal = 1; + CLK(2); + } + void i_di() + { + I.IF = false; + CLK(2); + } + void i_ei() + { + I.IF = true; + CLK(2); + } + void i_cld() + { + I.DF = false; + CLK(2); + } + void i_std() + { + I.DF = true; + CLK(2); + } + void i_fepre() + { + int ModRM; + byte tmp, tmp1; + ModRM = GetModRM(); + tmp = GetRMByte(ModRM); + switch (ModRM & 0x38) + { + case 0x00: tmp1 = (byte)(tmp + 1); I.OverVal = (uint)((tmp == 0x7f) ? 1 : 0); SetAF(tmp1, tmp, 1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM, (byte)tmp1); CLKM(ModRM, 2, 2, 2, 16, 16, 7); break; + case 0x08: tmp1 = (byte)(tmp - 1); I.OverVal = (uint)((tmp == 0x80) ? 1 : 0); SetAF(tmp1, tmp, 1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM, (byte)tmp1); CLKM(ModRM, 2, 2, 2, 16, 16, 7); break; + default: break; + } + } + void i_ffpre() + { + int ModRM; + ushort tmp, tmp1; + ModRM = GetModRM(); + tmp = GetRMWord(ModRM); + switch (ModRM & 0x38) + { + case 0x00: tmp1 = (ushort)(tmp + 1); I.OverVal = (uint)((tmp == 0x7fff) ? 1 : 0); SetAF(tmp1, tmp, 1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM, (ushort)tmp1); CLKM(ModRM, 2, 2, 2, 24, 16, 7); break; + case 0x08: tmp1 = (ushort)(tmp - 1); I.OverVal = (uint)((tmp == 0x8000) ? 1 : 0); SetAF(tmp1, tmp, 1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM, (ushort)tmp1); CLKM(ModRM, 2, 2, 2, 24, 16, 7); break; + case 0x10: + PUSH(I.ip); + I.ip = (ushort)tmp; + //CHANGE_PC; + pendingCycles -= (ModRM >= 0xc0) ? 16 : 20; + break; + case 0x18: + tmp1 = I.sregs[1]; + I.sregs[1] = GetnextRMWord(); + PUSH(tmp1); + PUSH(I.ip); + I.ip = tmp; + //CHANGE_PC; + pendingCycles -= (ModRM >= 0xc0) ? 16 : 26; + break; + case 0x20: + I.ip = tmp; + //CHANGE_PC; + pendingCycles -= 13; + break; + case 0x28: + I.ip = tmp; + I.sregs[1] = GetnextRMWord(); + //CHANGE_PC; + pendingCycles -= 15; + break; + case 0x30: PUSH(tmp); pendingCycles -= 4; break; + default: break; + } + } + void i_invalid() + { + pendingCycles -= 10; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecInstr.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecInstr.cs.meta new file mode 100644 index 00000000..2247ee59 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecInstr.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1dd5cd4e2bf67fa4b9221127b7fca5be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecModrm.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecModrm.cs new file mode 100644 index 00000000..4f4eb6e5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecModrm.cs @@ -0,0 +1,138 @@ +namespace cpu.nec +{ + partial class Nec + { + ushort RegWord(int ModRM) + { + return (ushort)(I.regs.b[mod_RM.regw[ModRM] * 2] + I.regs.b[mod_RM.regw[ModRM] * 2 + 1] * 0x100);// I.regs.w[mod_RM.regw[ModRM]]; + } + byte RegByte(int ModRM) + { + return I.regs.b[mod_RM.regb[ModRM]]; + } + ushort GetRMWord(int ModRM) + { + return (ushort)(ModRM >= 0xc0 ? I.regs.b[mod_RM.RMw[ModRM] * 2] + I.regs.b[mod_RM.RMw[ModRM] * 2 + 1] * 0x100 : ReadWord(GetEA[ModRM]())); + } + void PutbackRMWord(int ModRM, ushort val) + { + if (ModRM >= 0xc0) + { + //I.regs.w[mod_RM.RMw[ModRM]] = val; + I.regs.b[mod_RM.RMw[ModRM] * 2] = (byte)(val % 0x100); + I.regs.b[mod_RM.RMw[ModRM] * 2 + 1] = (byte)(val / 0x100); + } + else + { + WriteWord(EA, val); + } + } + ushort GetnextRMWord() + { + return ReadWord((EA & 0xf0000) | ((EA + 2) & 0xffff)); + } + void PutRMWord(int ModRM, ushort val) + { + if (ModRM >= 0xc0) + { + //I.regs.w[mod_RM.RMw[ModRM]] = val; + I.regs.b[mod_RM.RMw[ModRM] * 2] = (byte)(val % 0x100); + I.regs.b[mod_RM.RMw[ModRM] * 2 + 1] = (byte)(val / 0x100); + } + else + { + WriteWord(GetEA[ModRM](), val); + } + } + void PutImmRMWord(int ModRM) + { + ushort val; + if (ModRM >= 0xc0) + { + //I.regs.w[mod_RM.RMw[ModRM]] = FETCHWORD(); + ushort w = FETCHWORD(); + I.regs.b[mod_RM.RMw[ModRM] * 2] = (byte)(w % 0x100); + I.regs.b[mod_RM.RMw[ModRM] * 2 + 1] = (byte)(w / 0x100); + } + else + { + EA = GetEA[ModRM](); + val = FETCHWORD(); + WriteWord(EA, val); + } + } + byte GetRMByte(int ModRM) + { + return ((ModRM) >= 0xc0 ? I.regs.b[mod_RM.RMb[ModRM]] : ReadByte(GetEA[ModRM]())); + } + void PutRMByte(int ModRM, byte val) + { + if (ModRM >= 0xc0) + { + I.regs.b[mod_RM.RMb[ModRM]] = val; + } + else + { + WriteByte(GetEA[ModRM](), val); + } + } + void PutImmRMByte(int ModRM) + { + if (ModRM >= 0xc0) + { + I.regs.b[mod_RM.RMb[ModRM]] = FETCH(); + } + else + { + EA = GetEA[ModRM](); + WriteByte(EA, FETCH()); + } + } + void PutbackRMByte(int ModRM, byte val) + { + if (ModRM >= 0xc0) + { + I.regs.b[mod_RM.RMb[ModRM]] = val; + } + else + { + WriteByte(EA, val); + } + } + void DEF_br8(out int ModRM, out byte src, out byte dst) + { + ModRM = FETCH(); + src = RegByte(ModRM); + dst = GetRMByte(ModRM); + } + void DEF_wr16(out int ModRM, out ushort src, out ushort dst) + { + ModRM = FETCH(); + src = RegWord(ModRM); + dst = GetRMWord(ModRM); + } + void DEF_r8b(out int ModRM, out byte src, out byte dst) + { + ModRM = FETCH(); + dst = RegByte(ModRM); + src = GetRMByte(ModRM); + } + void DEF_r16w(out int ModRM, out ushort src, out ushort dst) + { + ModRM = FETCH(); + dst = RegWord(ModRM); + src = GetRMWord(ModRM); + } + void DEF_ald8(out byte src, out byte dst) + { + src = FETCH(); + dst = I.regs.b[0]; + } + void DEF_axd16(out ushort src, out ushort dst) + { + src = FETCH(); + dst = (ushort)(I.regs.b[0] + I.regs.b[1] * 0x100);// I.regs.w[0]; + src += (ushort)(FETCH() << 8); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecModrm.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecModrm.cs.meta new file mode 100644 index 00000000..6b595397 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/nec/NecModrm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20de18d94833a3f43bbeceac70edcc66 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80.meta new file mode 100644 index 00000000..7c51733f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 330693b766ebedc47a340cdcf561859d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Execute.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Execute.cs new file mode 100644 index 00000000..0c62b4e6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Execute.cs @@ -0,0 +1,11707 @@ +namespace cpu.z80 +{ + public partial class Z80A + { + public ushort PPC = 0; + public ushort OP; + /// + /// Runs the CPU for a particular number of clock cycles. + /// + /// The number of cycles to run the CPU emulator for. Specify -1 to run for a single instruction. + public override int ExecuteCycles(int cycles) + { + pendingCycles = cycles; + sbyte Displacement; + + bool TBOOL; byte TB; byte TBH; byte TBL; byte TB1; byte TB2; sbyte TSB; ushort TUS; int TI1; int TI2; int TIR; + + // Process interrupt requests. + if (nonMaskableInterruptPending) + { + if (halted) + { + halted = false; + RegPC.Word++; + } + totalExecutedCycles += 11; pendingCycles -= 11; + nonMaskableInterruptPending = false; + //iff2 = iff1; + iff1 = false; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x66; + RegWZ.Word = RegPC.Word; + NMICallback(); + } + do + { + if (interrupt && iff1 && Interruptable) //Z80.irq_state iff1 !Z80.after_ei + { + if (halted) + { + Halted = false; + RegPC.Word++; + } + iff1 = iff2 = false; + int irq_vector = IRQCallback(); + switch (interruptMode) + { + case 0: + switch (irq_vector & 0xff0000) + { + case 0xcd0000: + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = (ushort)(irq_vector & 0xffff); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xc30000: + RegPC.Word = (ushort)(irq_vector & 0xffff); + totalExecutedCycles += 12; pendingCycles -= 12; + break; + default: + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = (ushort)(irq_vector & 0x0038); + totalExecutedCycles += (ulong)(cc_op[RegPC.Low] + cc_ex[RegPC.Low]); pendingCycles -= cc_op[RegPC.Low] + cc_ex[RegPC.Low]; + break; + } + break; + case 1: + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x38; + totalExecutedCycles += 13; pendingCycles -= 13; + break; + case 2: + TUS = (ushort)(RegI * 256 + irq_vector); + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Low = ReadMemory(TUS++); RegPC.High = ReadMemory(TUS); + totalExecutedCycles += 17; pendingCycles -= 17; + break; + } + RegWZ.Word = RegPC.Word; + } + + { + Interruptable = true; + + ++RegR; + + PPC = RegPC.Word; + OP = ReadOp(PPC); + RegPC.Word++; + switch (OP)//ReadMemory(RegPC.Word++)) + { + case 0x00: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x01: // LD BC, nn + RegBC.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x02: // LD (BC), A + WriteMemory(RegBC.Word, RegAF.High); + RegWZ.Low = (byte)((RegBC.Word + 1) & 0xFF); + RegWZ.High = RegAF.High; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x03: // INC BC + ++RegBC.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x04: // INC B + RegAF.Low = (byte)(TableInc[++RegBC.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x05: // DEC B + RegAF.Low = (byte)(TableDec[--RegBC.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x06: // LD B, n + RegBC.High = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x07: // RLCA + RegAF.Word = TableRotShift[0, 0, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x08: // EX AF, AF' + TUS = RegAF.Word; RegAF.Word = RegAltAF.Word; RegAltAF.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x09: // ADD HL, BC + TI1 = (short)RegHL.Word; TI2 = (short)RegBC.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0x0A: // LD A, (BC) + RegAF.High = ReadMemory(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word + 1); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x0B: // DEC BC + --RegBC.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x0C: // INC C + RegAF.Low = (byte)(TableInc[++RegBC.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0D: // DEC C + RegAF.Low = (byte)(TableDec[--RegBC.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0E: // LD C, n + RegBC.Low = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x0F: // RRCA + RegAF.Word = TableRotShift[0, 1, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x10: // DJNZ d + TSB = (sbyte)ReadOpArg(RegPC.Word++); + if (--RegBC.High != 0) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 13; pendingCycles -= 13; + } + else + { + totalExecutedCycles += 8; pendingCycles -= 8; + } + break; + case 0x11: // LD DE, nn + RegDE.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x12: // LD (DE), A + WriteMemory(RegDE.Word, RegAF.High); + RegWZ.Low = (byte)((RegDE.Word + 1) & 0xFF); + RegWZ.High = RegAF.High; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x13: // INC DE + ++RegDE.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x14: // INC D + RegAF.Low = (byte)(TableInc[++RegDE.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x15: // DEC D + RegAF.Low = (byte)(TableDec[--RegDE.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x16: // LD D, n + RegDE.High = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x17: // RLA + RegAF.Word = TableRotShift[0, 2, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x18: // JR d + TSB = (sbyte)ReadOpArg(RegPC.Word++); + RegPC.Word = (ushort)(RegPC.Word + TSB); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x19: // ADD HL, DE + TI1 = (short)RegHL.Word; TI2 = (short)RegDE.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0x1A: // LD A, (DE) + RegAF.High = ReadMemory(RegDE.Word); + RegWZ.Word = (ushort)(RegDE.Word + 1); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x1B: // DEC DE + --RegDE.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x1C: // INC E + RegAF.Low = (byte)(TableInc[++RegDE.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1D: // DEC E + RegAF.Low = (byte)(TableDec[--RegDE.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1E: // LD E, n + RegDE.Low = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x1F: // RRA + RegAF.Word = TableRotShift[0, 3, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x20: // JR NZ, d + TSB = (sbyte)ReadOpArg(RegPC.Word++); + if (!RegFlagZ) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x21: // LD HL, nn + RegHL.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x22: // LD (nn), HL + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegHL.Low); + WriteMemory(TUS, RegHL.High); + RegWZ.Word = TUS; + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0x23: // INC HL + ++RegHL.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x24: // INC H + RegAF.Low = (byte)(TableInc[++RegHL.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x25: // DEC H + RegAF.Low = (byte)(TableDec[--RegHL.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x26: // LD H, n + RegHL.High = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x27: // DAA + RegAF.Word = TableDaa[RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x28: // JR Z, d + TSB = (sbyte)ReadOpArg(RegPC.Word++); + if (RegFlagZ) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x29: // ADD HL, HL + TI1 = (short)RegHL.Word; TI2 = (short)RegHL.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0x2A: // LD HL, (nn) + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegHL.Low = ReadMemory(TUS++); RegHL.High = ReadMemory(TUS); + RegWZ.Word = TUS; + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0x2B: // DEC HL + --RegHL.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x2C: // INC L + RegAF.Low = (byte)(TableInc[++RegHL.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2D: // DEC L + RegAF.Low = (byte)(TableDec[--RegHL.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2E: // LD L, n + RegHL.Low = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x2F: // CPL + RegAF.High ^= 0xFF; RegFlagH = true; RegFlagN = true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x30: // JR NC, d + TSB = (sbyte)ReadOpArg(RegPC.Word++); + if (!RegFlagC) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x31: // LD SP, nn + RegSP.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x32: // LD (nn), A + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS, RegAF.High); + RegWZ.Low = (byte)((TUS + 1) & 0xFF); + RegWZ.High = RegAF.High; + totalExecutedCycles += 13; pendingCycles -= 13; + break; + case 0x33: // INC SP + ++RegSP.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x34: // INC (HL) + TB = ReadMemory(RegHL.Word); RegAF.Low = (byte)(TableInc[++TB] | (RegAF.Low & 1)); WriteMemory(RegHL.Word, TB); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0x35: // DEC (HL) + TB = ReadMemory(RegHL.Word); RegAF.Low = (byte)(TableDec[--TB] | (RegAF.Low & 1)); WriteMemory(RegHL.Word, TB); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0x36: // LD (HL), n + WriteMemory(RegHL.Word, ReadOpArg(RegPC.Word++)); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x37: // SCF + RegFlagH = false; RegFlagN = false; RegFlagC = true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x38: // JR C, d + TSB = (sbyte)ReadOpArg(RegPC.Word++); + if (RegFlagC) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x39: // ADD HL, SP + TI1 = (short)RegHL.Word; TI2 = (short)RegSP.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0x3A: // LD A, (nn) + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegAF.High = ReadMemory(TUS); + RegWZ.Word = (ushort)(TUS + 1); + totalExecutedCycles += 13; pendingCycles -= 13;// + break; + case 0x3B: // DEC SP + --RegSP.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x3C: // INC A + RegAF.Low = (byte)(TableInc[++RegAF.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3D: // DEC A + RegAF.Low = (byte)(TableDec[--RegAF.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3E: // LD A, n + RegAF.High = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x3F: // CCF + RegFlagH = RegFlagC; RegFlagN = false; RegFlagC ^= true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x40: // LD B, B + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x41: // LD B, C + RegBC.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x42: // LD B, D + RegBC.High = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x43: // LD B, E + RegBC.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x44: // LD B, H + RegBC.High = RegHL.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x45: // LD B, L + RegBC.High = RegHL.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x46: // LD B, (HL) + RegBC.High = ReadMemory(RegHL.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x47: // LD B, A + RegBC.High = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x48: // LD C, B + RegBC.Low = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x49: // LD C, C + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4A: // LD C, D + RegBC.Low = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4B: // LD C, E + RegBC.Low = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4C: // LD C, H + RegBC.Low = RegHL.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4D: // LD C, L + RegBC.Low = RegHL.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4E: // LD C, (HL) + RegBC.Low = ReadMemory(RegHL.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x4F: // LD C, A + RegBC.Low = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x50: // LD D, B + RegDE.High = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x51: // LD D, C + RegDE.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x52: // LD D, D + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x53: // LD D, E + RegDE.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x54: // LD D, H + RegDE.High = RegHL.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x55: // LD D, L + RegDE.High = RegHL.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x56: // LD D, (HL) + RegDE.High = ReadMemory(RegHL.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x57: // LD D, A + RegDE.High = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x58: // LD E, B + RegDE.Low = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x59: // LD E, C + RegDE.Low = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5A: // LD E, D + RegDE.Low = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5B: // LD E, E + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5C: // LD E, H + RegDE.Low = RegHL.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5D: // LD E, L + RegDE.Low = RegHL.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5E: // LD E, (HL) + RegDE.Low = ReadMemory(RegHL.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x5F: // LD E, A + RegDE.Low = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x60: // LD H, B + RegHL.High = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x61: // LD H, C + RegHL.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x62: // LD H, D + RegHL.High = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x63: // LD H, E + RegHL.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x64: // LD H, H + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x65: // LD H, L + RegHL.High = RegHL.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x66: // LD H, (HL) + RegHL.High = ReadMemory(RegHL.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x67: // LD H, A + RegHL.High = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x68: // LD L, B + RegHL.Low = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x69: // LD L, C + RegHL.Low = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x6A: // LD L, D + RegHL.Low = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x6B: // LD L, E + RegHL.Low = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x6C: // LD L, H + RegHL.Low = RegHL.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x6D: // LD L, L + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x6E: // LD L, (HL) + RegHL.Low = ReadMemory(RegHL.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x6F: // LD L, A + RegHL.Low = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x70: // LD (HL), B + WriteMemory(RegHL.Word, RegBC.High); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x71: // LD (HL), C + WriteMemory(RegHL.Word, RegBC.Low); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x72: // LD (HL), D + WriteMemory(RegHL.Word, RegDE.High); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x73: // LD (HL), E + WriteMemory(RegHL.Word, RegDE.Low); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x74: // LD (HL), H + WriteMemory(RegHL.Word, RegHL.High); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x75: // LD (HL), L + WriteMemory(RegHL.Word, RegHL.Low); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x76: // HALT + Halt(); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x77: // LD (HL), A + WriteMemory(RegHL.Word, RegAF.High); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x78: // LD A, B + RegAF.High = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x79: // LD A, C + RegAF.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7A: // LD A, D + RegAF.High = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7B: // LD A, E + RegAF.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7C: // LD A, H + RegAF.High = RegHL.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7D: // LD A, L + RegAF.High = RegHL.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7E: // LD A, (HL) + RegAF.High = ReadMemory(RegHL.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x7F: // LD A, A + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x80: // ADD A, B + RegAF.Word = TableALU[0, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x81: // ADD A, C + RegAF.Word = TableALU[0, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x82: // ADD A, D + RegAF.Word = TableALU[0, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x83: // ADD A, E + RegAF.Word = TableALU[0, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x84: // ADD A, H + RegAF.Word = TableALU[0, RegAF.High, RegHL.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x85: // ADD A, L + RegAF.Word = TableALU[0, RegAF.High, RegHL.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x86: // ADD A, (HL) + RegAF.Word = TableALU[0, RegAF.High, ReadMemory(RegHL.Word), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x87: // ADD A, A + RegAF.Word = TableALU[0, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x88: // ADC A, B + RegAF.Word = TableALU[1, RegAF.High, RegBC.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x89: // ADC A, C + RegAF.Word = TableALU[1, RegAF.High, RegBC.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8A: // ADC A, D + RegAF.Word = TableALU[1, RegAF.High, RegDE.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8B: // ADC A, E + RegAF.Word = TableALU[1, RegAF.High, RegDE.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8C: // ADC A, H + RegAF.Word = TableALU[1, RegAF.High, RegHL.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8D: // ADC A, L + RegAF.Word = TableALU[1, RegAF.High, RegHL.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8E: // ADC A, (HL) + RegAF.Word = TableALU[1, RegAF.High, ReadMemory(RegHL.Word), RegFlagC ? 1 : 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x8F: // ADC A, A + RegAF.Word = TableALU[1, RegAF.High, RegAF.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x90: // SUB B + RegAF.Word = TableALU[2, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x91: // SUB C + RegAF.Word = TableALU[2, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x92: // SUB D + RegAF.Word = TableALU[2, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x93: // SUB E + RegAF.Word = TableALU[2, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x94: // SUB H + RegAF.Word = TableALU[2, RegAF.High, RegHL.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x95: // SUB L + RegAF.Word = TableALU[2, RegAF.High, RegHL.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x96: // SUB (HL) + RegAF.Word = TableALU[2, RegAF.High, ReadMemory(RegHL.Word), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x97: // SUB A, A + RegAF.Word = TableALU[2, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x98: // SBC A, B + RegAF.Word = TableALU[3, RegAF.High, RegBC.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x99: // SBC A, C + RegAF.Word = TableALU[3, RegAF.High, RegBC.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9A: // SBC A, D + RegAF.Word = TableALU[3, RegAF.High, RegDE.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9B: // SBC A, E + RegAF.Word = TableALU[3, RegAF.High, RegDE.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9C: // SBC A, H + RegAF.Word = TableALU[3, RegAF.High, RegHL.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9D: // SBC A, L + RegAF.Word = TableALU[3, RegAF.High, RegHL.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9E: // SBC A, (HL) + RegAF.Word = TableALU[3, RegAF.High, ReadMemory(RegHL.Word), RegFlagC ? 1 : 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x9F: // SBC A, A + RegAF.Word = TableALU[3, RegAF.High, RegAF.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA0: // AND B + RegAF.Word = TableALU[4, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA1: // AND C + RegAF.Word = TableALU[4, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA2: // AND D + RegAF.Word = TableALU[4, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA3: // AND E + RegAF.Word = TableALU[4, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA4: // AND H + RegAF.Word = TableALU[4, RegAF.High, RegHL.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA5: // AND L + RegAF.Word = TableALU[4, RegAF.High, RegHL.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA6: // AND (HL) + RegAF.Word = TableALU[4, RegAF.High, ReadMemory(RegHL.Word), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xA7: // AND A + RegAF.Word = TableALU[4, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA8: // XOR B + RegAF.Word = TableALU[5, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA9: // XOR C + RegAF.Word = TableALU[5, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAA: // XOR D + RegAF.Word = TableALU[5, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAB: // XOR E + RegAF.Word = TableALU[5, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAC: // XOR H + RegAF.Word = TableALU[5, RegAF.High, RegHL.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAD: // XOR L + RegAF.Word = TableALU[5, RegAF.High, RegHL.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAE: // XOR (HL) + RegAF.Word = TableALU[5, RegAF.High, ReadMemory(RegHL.Word), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xAF: // XOR A + RegAF.Word = TableALU[5, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB0: // OR B + RegAF.Word = TableALU[6, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB1: // OR C + RegAF.Word = TableALU[6, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB2: // OR D + RegAF.Word = TableALU[6, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB3: // OR E + RegAF.Word = TableALU[6, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB4: // OR H + RegAF.Word = TableALU[6, RegAF.High, RegHL.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB5: // OR L + RegAF.Word = TableALU[6, RegAF.High, RegHL.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB6: // OR (HL) + RegAF.Word = TableALU[6, RegAF.High, ReadMemory(RegHL.Word), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xB7: // OR A + RegAF.Word = TableALU[6, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB8: // CP B + RegAF.Word = TableALU[7, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB9: // CP C + RegAF.Word = TableALU[7, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBA: // CP D + RegAF.Word = TableALU[7, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBB: // CP E + RegAF.Word = TableALU[7, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBC: // CP H + RegAF.Word = TableALU[7, RegAF.High, RegHL.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBD: // CP L + RegAF.Word = TableALU[7, RegAF.High, RegHL.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBE: // CP (HL) + RegAF.Word = TableALU[7, RegAF.High, ReadMemory(RegHL.Word), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xBF: // CP A + RegAF.Word = TableALU[7, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC0: // RET NZ + if (!RegFlagZ) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xC1: // POP BC + RegBC.Low = ReadMemory(RegSP.Word++); RegBC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC2: // JP NZ, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (!RegFlagZ) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC3: // JP nn + RegPC.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC4: // CALL NZ, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (!RegFlagZ) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xC5: // PUSH BC + WriteMemory(--RegSP.Word, RegBC.High); WriteMemory(--RegSP.Word, RegBC.Low); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xC6: // ADD A, n + RegAF.Word = TableALU[0, RegAF.High, ReadOpArg(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xC7: // RST $00 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x00; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xC8: // RET Z + if (RegFlagZ) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xC9: // RET + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xCA: // JP Z, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagZ) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xCB: // (Prefix) + ++RegR; + switch (ReadOp(RegPC.Word++)) + { + case 0x00: // RLC B + TUS = TableRotShift[1, 0, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x01: // RLC C + TUS = TableRotShift[1, 0, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x02: // RLC D + TUS = TableRotShift[1, 0, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x03: // RLC E + TUS = TableRotShift[1, 0, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x04: // RLC H + totalExecutedCycles += 8; pendingCycles -= 8; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + break; + case 0x05: // RLC L + totalExecutedCycles += 8; pendingCycles -= 8; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + break; + case 0x06: // RLC (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x07: // RLC A + TUS = TableRotShift[1, 0, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x08: // RRC B + TUS = TableRotShift[1, 1, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x09: // RRC C + TUS = TableRotShift[1, 1, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x0A: // RRC D + TUS = TableRotShift[1, 1, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x0B: // RRC E + TUS = TableRotShift[1, 1, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x0C: // RRC H + TUS = TableRotShift[1, 1, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x0D: // RRC L + TUS = TableRotShift[1, 1, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x0E: // RRC (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x0F: // RRC A + TUS = TableRotShift[1, 1, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x10: // RL B + TUS = TableRotShift[1, 2, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x11: // RL C + TUS = TableRotShift[1, 2, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x12: // RL D + TUS = TableRotShift[1, 2, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x13: // RL E + TUS = TableRotShift[1, 2, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x14: // RL H + TUS = TableRotShift[1, 2, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x15: // RL L + TUS = TableRotShift[1, 2, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x16: // RL (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x17: // RL A + TUS = TableRotShift[1, 2, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x18: // RR B + TUS = TableRotShift[1, 3, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x19: // RR C + TUS = TableRotShift[1, 3, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x1A: // RR D + TUS = TableRotShift[1, 3, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x1B: // RR E + TUS = TableRotShift[1, 3, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x1C: // RR H + TUS = TableRotShift[1, 3, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x1D: // RR L + TUS = TableRotShift[1, 3, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x1E: // RR (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1F: // RR A + TUS = TableRotShift[1, 3, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x20: // SLA B + TUS = TableRotShift[1, 4, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x21: // SLA C + TUS = TableRotShift[1, 4, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x22: // SLA D + TUS = TableRotShift[1, 4, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x23: // SLA E + TUS = TableRotShift[1, 4, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x24: // SLA H + TUS = TableRotShift[1, 4, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x25: // SLA L + TUS = TableRotShift[1, 4, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x26: // SLA (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x27: // SLA A + TUS = TableRotShift[1, 4, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x28: // SRA B + TUS = TableRotShift[1, 5, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x29: // SRA C + TUS = TableRotShift[1, 5, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x2A: // SRA D + TUS = TableRotShift[1, 5, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x2B: // SRA E + TUS = TableRotShift[1, 5, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x2C: // SRA H + TUS = TableRotShift[1, 5, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x2D: // SRA L + TUS = TableRotShift[1, 5, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x2E: // SRA (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2F: // SRA A + TUS = TableRotShift[1, 5, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x30: // SL1 B + TUS = TableRotShift[1, 6, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x31: // SL1 C + TUS = TableRotShift[1, 6, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x32: // SL1 D + TUS = TableRotShift[1, 6, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x33: // SL1 E + TUS = TableRotShift[1, 6, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x34: // SL1 H + TUS = TableRotShift[1, 6, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x35: // SL1 L + TUS = TableRotShift[1, 6, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x36: // SL1 (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x37: // SL1 A + TUS = TableRotShift[1, 6, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x38: // SRL B + TUS = TableRotShift[1, 7, RegAF.Low + 256 * RegBC.High]; + RegBC.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x39: // SRL C + TUS = TableRotShift[1, 7, RegAF.Low + 256 * RegBC.Low]; + RegBC.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x3A: // SRL D + TUS = TableRotShift[1, 7, RegAF.Low + 256 * RegDE.High]; + RegDE.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x3B: // SRL E + TUS = TableRotShift[1, 7, RegAF.Low + 256 * RegDE.Low]; + RegDE.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x3C: // SRL H + TUS = TableRotShift[1, 7, RegAF.Low + 256 * RegHL.High]; + RegHL.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x3D: // SRL L + TUS = TableRotShift[1, 7, RegAF.Low + 256 * RegHL.Low]; + RegHL.Low = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x3E: // SRL (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegHL.Word)]; + WriteMemory(RegHL.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3F: // SRL A + TUS = TableRotShift[1, 7, RegAF.Low + 256 * RegAF.High]; + RegAF.High = (byte)(TUS >> 8); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x40: // BIT 0, B + RegFlagZ = (RegBC.High & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x41: // BIT 0, C + RegFlagZ = (RegBC.Low & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x42: // BIT 0, D + RegFlagZ = (RegDE.High & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x43: // BIT 0, E + RegFlagZ = (RegDE.Low & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x44: // BIT 0, H + RegFlagZ = (RegHL.High & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x45: // BIT 0, L + RegFlagZ = (RegHL.Low & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x46: // BIT 0, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x47: // BIT 0, A + RegFlagZ = (RegAF.High & 0x01) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x48: // BIT 1, B + RegFlagZ = (RegBC.High & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x49: // BIT 1, C + RegFlagZ = (RegBC.Low & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4A: // BIT 1, D + RegFlagZ = (RegDE.High & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4B: // BIT 1, E + RegFlagZ = (RegDE.Low & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4C: // BIT 1, H + RegFlagZ = (RegHL.High & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4D: // BIT 1, L + RegFlagZ = (RegHL.Low & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4E: // BIT 1, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x4F: // BIT 1, A + RegFlagZ = (RegAF.High & 0x02) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x50: // BIT 2, B + RegFlagZ = (RegBC.High & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x51: // BIT 2, C + RegFlagZ = (RegBC.Low & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x52: // BIT 2, D + RegFlagZ = (RegDE.High & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x53: // BIT 2, E + RegFlagZ = (RegDE.Low & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x54: // BIT 2, H + RegFlagZ = (RegHL.High & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x55: // BIT 2, L + RegFlagZ = (RegHL.Low & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x56: // BIT 2, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x57: // BIT 2, A + RegFlagZ = (RegAF.High & 0x04) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x58: // BIT 3, B + RegFlagZ = (RegBC.High & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = !RegFlagZ; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x59: // BIT 3, C + RegFlagZ = (RegBC.Low & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = !RegFlagZ; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5A: // BIT 3, D + RegFlagZ = (RegDE.High & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = !RegFlagZ; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5B: // BIT 3, E + RegFlagZ = (RegDE.Low & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = !RegFlagZ; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5C: // BIT 3, H + RegFlagZ = (RegHL.High & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = !RegFlagZ; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5D: // BIT 3, L + RegFlagZ = (RegHL.Low & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = !RegFlagZ; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5E: // BIT 3, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x5F: // BIT 3, A + RegFlagZ = (RegAF.High & 0x08) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = !RegFlagZ; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x60: // BIT 4, B + RegFlagZ = (RegBC.High & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x61: // BIT 4, C + RegFlagZ = (RegBC.Low & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x62: // BIT 4, D + RegFlagZ = (RegDE.High & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x63: // BIT 4, E + RegFlagZ = (RegDE.Low & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x64: // BIT 4, H + RegFlagZ = (RegHL.High & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x65: // BIT 4, L + RegFlagZ = (RegHL.Low & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x66: // BIT 4, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x67: // BIT 4, A + RegFlagZ = (RegAF.High & 0x10) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x68: // BIT 5, B + RegFlagZ = (RegBC.High & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = !RegFlagZ; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x69: // BIT 5, C + RegFlagZ = (RegBC.Low & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = !RegFlagZ; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6A: // BIT 5, D + RegFlagZ = (RegDE.High & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = !RegFlagZ; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6B: // BIT 5, E + RegFlagZ = (RegDE.Low & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = !RegFlagZ; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6C: // BIT 5, H + RegFlagZ = (RegHL.High & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = !RegFlagZ; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6D: // BIT 5, L + RegFlagZ = (RegHL.Low & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = !RegFlagZ; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6E: // BIT 5, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x6F: // BIT 5, A + RegFlagZ = (RegAF.High & 0x20) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = !RegFlagZ; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x70: // BIT 6, B + RegFlagZ = (RegBC.High & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x71: // BIT 6, C + RegFlagZ = (RegBC.Low & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x72: // BIT 6, D + RegFlagZ = (RegDE.High & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x73: // BIT 6, E + RegFlagZ = (RegDE.Low & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x74: // BIT 6, H + RegFlagZ = (RegHL.High & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x75: // BIT 6, L + RegFlagZ = (RegHL.Low & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x76: // BIT 6, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x77: // BIT 6, A + RegFlagZ = (RegAF.High & 0x40) == 0; + RegFlagP = RegFlagZ; + RegFlagS = false; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x78: // BIT 7, B + RegFlagZ = (RegBC.High & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x79: // BIT 7, C + RegFlagZ = (RegBC.Low & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7A: // BIT 7, D + RegFlagZ = (RegDE.High & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7B: // BIT 7, E + RegFlagZ = (RegDE.Low & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7C: // BIT 7, H + RegFlagZ = (RegHL.High & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7D: // BIT 7, L + RegFlagZ = (RegHL.Low & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7E: // BIT 7, (HL) + RegFlagZ = (ReadMemory(RegHL.Word) & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = (RegWZ.High & 0x08) != 0; + RegFlag5 = (RegWZ.High & 0x20) != 0; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x7F: // BIT 7, A + RegFlagZ = (RegAF.High & 0x80) == 0; + RegFlagP = RegFlagZ; + RegFlagS = !RegFlagZ; + RegFlag3 = false; + RegFlag5 = false; + RegFlagH = true; + RegFlagN = false; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x80: // RES 0, B + RegBC.High &= unchecked((byte)~0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x81: // RES 0, C + RegBC.Low &= unchecked((byte)~0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x82: // RES 0, D + RegDE.High &= unchecked((byte)~0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x83: // RES 0, E + RegDE.Low &= unchecked((byte)~0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x84: // RES 0, H + RegHL.High &= unchecked((byte)~0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x85: // RES 0, L + RegHL.Low &= unchecked((byte)~0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x86: // RES 0, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x01))); + break; + case 0x87: // RES 0, A + RegAF.High &= unchecked((byte)~0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x88: // RES 1, B + RegBC.High &= unchecked((byte)~0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x89: // RES 1, C + RegBC.Low &= unchecked((byte)~0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x8A: // RES 1, D + RegDE.High &= unchecked((byte)~0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x8B: // RES 1, E + RegDE.Low &= unchecked((byte)~0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x8C: // RES 1, H + RegHL.High &= unchecked((byte)~0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x8D: // RES 1, L + RegHL.Low &= unchecked((byte)~0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x8E: // RES 1, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x02))); + break; + case 0x8F: // RES 1, A + RegAF.High &= unchecked((byte)~0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x90: // RES 2, B + RegBC.High &= unchecked((byte)~0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x91: // RES 2, C + RegBC.Low &= unchecked((byte)~0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x92: // RES 2, D + RegDE.High &= unchecked((byte)~0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x93: // RES 2, E + RegDE.Low &= unchecked((byte)~0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x94: // RES 2, H + RegHL.High &= unchecked((byte)~0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x95: // RES 2, L + RegHL.Low &= unchecked((byte)~0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x96: // RES 2, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x04))); + break; + case 0x97: // RES 2, A + RegAF.High &= unchecked((byte)~0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x98: // RES 3, B + RegBC.High &= unchecked((byte)~0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x99: // RES 3, C + RegBC.Low &= unchecked((byte)~0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x9A: // RES 3, D + RegDE.High &= unchecked((byte)~0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x9B: // RES 3, E + RegDE.Low &= unchecked((byte)~0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x9C: // RES 3, H + RegHL.High &= unchecked((byte)~0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x9D: // RES 3, L + RegHL.Low &= unchecked((byte)~0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x9E: // RES 3, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x08))); + break; + case 0x9F: // RES 3, A + RegAF.High &= unchecked((byte)~0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA0: // RES 4, B + RegBC.High &= unchecked((byte)~0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA1: // RES 4, C + RegBC.Low &= unchecked((byte)~0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA2: // RES 4, D + RegDE.High &= unchecked((byte)~0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA3: // RES 4, E + RegDE.Low &= unchecked((byte)~0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA4: // RES 4, H + RegHL.High &= unchecked((byte)~0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA5: // RES 4, L + RegHL.Low &= unchecked((byte)~0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA6: // RES 4, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x10))); + break; + case 0xA7: // RES 4, A + RegAF.High &= unchecked((byte)~0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA8: // RES 5, B + RegBC.High &= unchecked((byte)~0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xA9: // RES 5, C + RegBC.Low &= unchecked((byte)~0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xAA: // RES 5, D + RegDE.High &= unchecked((byte)~0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xAB: // RES 5, E + RegDE.Low &= unchecked((byte)~0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xAC: // RES 5, H + RegHL.High &= unchecked((byte)~0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xAD: // RES 5, L + RegHL.Low &= unchecked((byte)~0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xAE: // RES 5, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x20))); + break; + case 0xAF: // RES 5, A + RegAF.High &= unchecked((byte)~0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB0: // RES 6, B + RegBC.High &= unchecked((byte)~0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB1: // RES 6, C + RegBC.Low &= unchecked((byte)~0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB2: // RES 6, D + RegDE.High &= unchecked((byte)~0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB3: // RES 6, E + RegDE.Low &= unchecked((byte)~0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB4: // RES 6, H + RegHL.High &= unchecked((byte)~0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB5: // RES 6, L + RegHL.Low &= unchecked((byte)~0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB6: // RES 6, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x40))); + break; + case 0xB7: // RES 6, A + RegAF.High &= unchecked((byte)~0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB8: // RES 7, B + RegBC.High &= unchecked((byte)~0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xB9: // RES 7, C + RegBC.Low &= unchecked((byte)~0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xBA: // RES 7, D + RegDE.High &= unchecked((byte)~0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xBB: // RES 7, E + RegDE.Low &= unchecked((byte)~0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xBC: // RES 7, H + RegHL.High &= unchecked((byte)~0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xBD: // RES 7, L + RegHL.Low &= unchecked((byte)~0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xBE: // RES 7, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) & unchecked((byte)~0x80))); + break; + case 0xBF: // RES 7, A + RegAF.High &= unchecked((byte)~0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC0: // SET 0, B + RegBC.High |= unchecked((byte)0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC1: // SET 0, C + RegBC.Low |= unchecked((byte)0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC2: // SET 0, D + RegDE.High |= unchecked((byte)0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC3: // SET 0, E + RegDE.Low |= unchecked((byte)0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC4: // SET 0, H + RegHL.High |= unchecked((byte)0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC5: // SET 0, L + RegHL.Low |= unchecked((byte)0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC6: // SET 0, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x01))); + break; + case 0xC7: // SET 0, A + RegAF.High |= unchecked((byte)0x01); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC8: // SET 1, B + RegBC.High |= unchecked((byte)0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xC9: // SET 1, C + RegBC.Low |= unchecked((byte)0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xCA: // SET 1, D + RegDE.High |= unchecked((byte)0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xCB: // SET 1, E + RegDE.Low |= unchecked((byte)0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xCC: // SET 1, H + RegHL.High |= unchecked((byte)0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xCD: // SET 1, L + RegHL.Low |= unchecked((byte)0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xCE: // SET 1, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x02))); + break; + case 0xCF: // SET 1, A + RegAF.High |= unchecked((byte)0x02); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD0: // SET 2, B + RegBC.High |= unchecked((byte)0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD1: // SET 2, C + RegBC.Low |= unchecked((byte)0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD2: // SET 2, D + RegDE.High |= unchecked((byte)0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD3: // SET 2, E + RegDE.Low |= unchecked((byte)0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD4: // SET 2, H + RegHL.High |= unchecked((byte)0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD5: // SET 2, L + RegHL.Low |= unchecked((byte)0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD6: // SET 2, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x04))); + break; + case 0xD7: // SET 2, A + RegAF.High |= unchecked((byte)0x04); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD8: // SET 3, B + RegBC.High |= unchecked((byte)0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xD9: // SET 3, C + RegBC.Low |= unchecked((byte)0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xDA: // SET 3, D + RegDE.High |= unchecked((byte)0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xDB: // SET 3, E + RegDE.Low |= unchecked((byte)0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xDC: // SET 3, H + RegHL.High |= unchecked((byte)0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xDD: // SET 3, L + RegHL.Low |= unchecked((byte)0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xDE: // SET 3, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x08))); + break; + case 0xDF: // SET 3, A + RegAF.High |= unchecked((byte)0x08); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE0: // SET 4, B + RegBC.High |= unchecked((byte)0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE1: // SET 4, C + RegBC.Low |= unchecked((byte)0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE2: // SET 4, D + RegDE.High |= unchecked((byte)0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE3: // SET 4, E + RegDE.Low |= unchecked((byte)0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE4: // SET 4, H + RegHL.High |= unchecked((byte)0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE5: // SET 4, L + RegHL.Low |= unchecked((byte)0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE6: // SET 4, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x10))); + break; + case 0xE7: // SET 4, A + RegAF.High |= unchecked((byte)0x10); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE8: // SET 5, B + RegBC.High |= unchecked((byte)0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xE9: // SET 5, C + RegBC.Low |= unchecked((byte)0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xEA: // SET 5, D + RegDE.High |= unchecked((byte)0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xEB: // SET 5, E + RegDE.Low |= unchecked((byte)0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xEC: // SET 5, H + RegHL.High |= unchecked((byte)0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xED: // SET 5, L + RegHL.Low |= unchecked((byte)0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xEE: // SET 5, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x20))); + break; + case 0xEF: // SET 5, A + RegAF.High |= unchecked((byte)0x20); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF0: // SET 6, B + RegBC.High |= unchecked((byte)0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF1: // SET 6, C + RegBC.Low |= unchecked((byte)0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF2: // SET 6, D + RegDE.High |= unchecked((byte)0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF3: // SET 6, E + RegDE.Low |= unchecked((byte)0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF4: // SET 6, H + RegHL.High |= unchecked((byte)0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF5: // SET 6, L + RegHL.Low |= unchecked((byte)0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF6: // SET 6, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x40))); + break; + case 0xF7: // SET 6, A + RegAF.High |= unchecked((byte)0x40); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF8: // SET 7, B + RegBC.High |= unchecked((byte)0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xF9: // SET 7, C + RegBC.Low |= unchecked((byte)0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xFA: // SET 7, D + RegDE.High |= unchecked((byte)0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xFB: // SET 7, E + RegDE.Low |= unchecked((byte)0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xFC: // SET 7, H + RegHL.High |= unchecked((byte)0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xFD: // SET 7, L + RegHL.Low |= unchecked((byte)0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xFE: // SET 7, (HL) + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(RegHL.Word, (byte)(ReadMemory(RegHL.Word) | unchecked((byte)0x80))); + break; + case 0xFF: // SET 7, A + RegAF.High |= unchecked((byte)0x80); + totalExecutedCycles += 8; pendingCycles -= 8; + break; + } + break; + case 0xCC: // CALL Z, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagZ) + { + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xCD: // CALL nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + break; + case 0xCE: // ADC A, n + RegAF.Word = TableALU[1, RegAF.High, ReadOpArg(RegPC.Word++), RegFlagC ? 1 : 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xCF: // RST $08 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x08; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xD0: // RET NC + if (!RegFlagC) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xD1: // POP DE + RegDE.Low = ReadMemory(RegSP.Word++); RegDE.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xD2: // JP NC, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (!RegFlagC) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xD3: // OUT n, A + TUS = (ushort)(ReadOpArg(RegPC.Word++) | (RegAF.High << 8)); + WriteHardware(TUS, RegAF.High); + RegWZ.Low = (byte)(((TUS & 0xFF) + 1) & 0xFF); + RegWZ.High = RegAF.High; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xD4: // CALL NC, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (!RegFlagC) + { + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xD5: // PUSH DE + WriteMemory(--RegSP.Word, RegDE.High); WriteMemory(--RegSP.Word, RegDE.Low); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xD6: // SUB n + RegAF.Word = TableALU[2, RegAF.High, ReadOpArg(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xD7: // RST $10 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x10; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xD8: // RET C + if (RegFlagC) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xD9: // EXX + TUS = RegBC.Word; RegBC.Word = RegAltBC.Word; RegAltBC.Word = TUS; + TUS = RegDE.Word; RegDE.Word = RegAltDE.Word; RegAltDE.Word = TUS; + TUS = RegHL.Word; RegHL.Word = RegAltHL.Word; RegAltHL.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDA: // JP C, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagC) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xDB: // IN A, n + TUS = (ushort)(ReadOpArg(RegPC.Word++) | (RegAF.High << 8)); + RegAF.High = ReadHardware(TUS); + RegWZ.Word = (ushort)(TUS + 1); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xDC: // CALL C, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagC) + { + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xDD: // (Prefix) + ++RegR; + switch (ReadOp(RegPC.Word++)) + { + case 0x00: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x01: // LD BC, nn + RegBC.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x02: // LD (BC), A + totalExecutedCycles += 7; pendingCycles -= 7; + WriteMemory(RegBC.Word, RegAF.High); + break; + case 0x03: // INC BC + ++RegBC.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x04: // INC B + RegAF.Low = (byte)(TableInc[++RegBC.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x05: // DEC B + RegAF.Low = (byte)(TableDec[--RegBC.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x06: // LD B, n + RegBC.High = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x07: // RLCA + RegAF.Word = TableRotShift[0, 0, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x08: // EX AF, AF' + TUS = RegAF.Word; RegAF.Word = RegAltAF.Word; RegAltAF.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x09: // ADD IX, BC + TI1 = (short)RegIX.Word; TI2 = (short)RegBC.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIX.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIX.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x0A: // LD A, (BC) + RegAF.High = ReadMemory(RegBC.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x0B: // DEC BC + --RegBC.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x0C: // INC C + RegAF.Low = (byte)(TableInc[++RegBC.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0D: // DEC C + RegAF.Low = (byte)(TableDec[--RegBC.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0E: // LD C, n + RegBC.Low = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x0F: // RRCA + RegAF.Word = TableRotShift[0, 1, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x10: // DJNZ d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (--RegBC.High != 0) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 13; pendingCycles -= 13; + } + else + { + totalExecutedCycles += 8; pendingCycles -= 8; + } + break; + case 0x11: // LD DE, nn + RegDE.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x12: // LD (DE), A + totalExecutedCycles += 7; pendingCycles -= 7; + WriteMemory(RegDE.Word, RegAF.High); + break; + case 0x13: // INC DE + ++RegDE.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x14: // INC D + RegAF.Low = (byte)(TableInc[++RegDE.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x15: // DEC D + RegAF.Low = (byte)(TableDec[--RegDE.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x16: // LD D, n + RegDE.High = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x17: // RLA + RegAF.Word = TableRotShift[0, 2, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x18: // JR d + TSB = (sbyte)ReadMemory(RegPC.Word++); + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x19: // ADD IX, DE + TI1 = (short)RegIX.Word; TI2 = (short)RegDE.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIX.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIX.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x1A: // LD A, (DE) + RegAF.High = ReadMemory(RegDE.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x1B: // DEC DE + --RegDE.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x1C: // INC E + RegAF.Low = (byte)(TableInc[++RegDE.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1D: // DEC E + RegAF.Low = (byte)(TableDec[--RegDE.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1E: // LD E, n + RegDE.Low = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x1F: // RRA + RegAF.Word = TableRotShift[0, 3, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x20: // JR NZ, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (!RegFlagZ) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x21: // LD IX, nn + RegIX.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x22: // LD (nn), IX + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegIX.Low); + WriteMemory(TUS, RegIX.High); + RegWZ.Word = TUS; + break; + case 0x23: // INC IX + ++RegIX.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x24: // INC IXH + RegAF.Low = (byte)(TableInc[++RegIX.High] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x25: // DEC IXH + RegAF.Low = (byte)(TableDec[--RegIX.High] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x26: // LD IXH, n + RegIX.High = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x27: // DAA + RegAF.Word = TableDaa[RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x28: // JR Z, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (RegFlagZ) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x29: // ADD IX, IX + TI1 = (short)RegIX.Word; TI2 = (short)RegIX.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIX.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIX.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x2A: // LD IX, (nn) + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegIX.Low = ReadMemory(TUS++); RegIX.High = ReadMemory(TUS); + RegWZ.Word = TUS; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x2B: // DEC IX + --RegIX.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x2C: // INC IXL + RegAF.Low = (byte)(TableInc[++RegIX.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x2D: // DEC IXL + RegAF.Low = (byte)(TableDec[--RegIX.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x2E: // LD IXL, n + RegIX.Low = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x2F: // CPL + RegAF.High ^= 0xFF; RegFlagH = true; RegFlagN = true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x30: // JR NC, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (!RegFlagC) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x31: // LD SP, nn + RegSP.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x32: // LD (nn), A + totalExecutedCycles += 13; pendingCycles -= 13; + WriteMemory((ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256), RegAF.High); + break; + case 0x33: // INC SP + ++RegSP.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x34: // INC (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + TB = ReadMemory(RegWZ.Word); RegAF.Low = (byte)(TableInc[++TB] | (RegAF.Low & 1)); WriteMemory(RegWZ.Word, TB); + break; + case 0x35: // DEC (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + TB = ReadMemory(RegWZ.Word); RegAF.Low = (byte)(TableDec[--TB] | (RegAF.Low & 1)); WriteMemory(RegWZ.Word, TB); + break; + case 0x36: // LD (IX+d), n + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, ReadOpArg(RegPC.Word++)); + break; + case 0x37: // SCF + RegFlagH = false; RegFlagN = false; RegFlagC = true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x38: // JR C, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (RegFlagC) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x39: // ADD IX, SP + TI1 = (short)RegIX.Word; TI2 = (short)RegSP.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIX.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIX.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x3A: // LD A, (nn) + RegAF.High = ReadMemory((ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256)); + totalExecutedCycles += 13; pendingCycles -= 13; + break; + case 0x3B: // DEC SP + --RegSP.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x3C: // INC A + RegAF.Low = (byte)(TableInc[++RegAF.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3D: // DEC A + RegAF.Low = (byte)(TableDec[--RegAF.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3E: // LD A, n + RegAF.High = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x3F: // CCF + RegFlagH = RegFlagC; RegFlagN = false; RegFlagC ^= true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x40: // LD B, B + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x41: // LD B, C + RegBC.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x42: // LD B, D + RegBC.High = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x43: // LD B, E + RegBC.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x44: // LD B, IXH + RegBC.High = RegIX.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x45: // LD B, IXL + RegBC.High = RegIX.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x46: // LD B, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegBC.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x47: // LD B, A + RegBC.High = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x48: // LD C, B + RegBC.Low = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x49: // LD C, C + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4A: // LD C, D + RegBC.Low = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4B: // LD C, E + RegBC.Low = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4C: // LD C, IXH + RegBC.Low = RegIX.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x4D: // LD C, IXL + RegBC.Low = RegIX.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x4E: // LD C, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegBC.Low = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x4F: // LD C, A + RegBC.Low = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x50: // LD D, B + RegDE.High = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x51: // LD D, C + RegDE.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x52: // LD D, D + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x53: // LD D, E + RegDE.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x54: // LD D, IXH + RegDE.High = RegIX.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x55: // LD D, IXL + RegDE.High = RegIX.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x56: // LD D, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegDE.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x57: // LD D, A + RegDE.High = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x58: // LD E, B + RegDE.Low = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x59: // LD E, C + RegDE.Low = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5A: // LD E, D + RegDE.Low = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5B: // LD E, E + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5C: // LD E, IXH + RegDE.Low = RegIX.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x5D: // LD E, IXL + RegDE.Low = RegIX.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x5E: // LD E, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegDE.Low = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x5F: // LD E, A + RegDE.Low = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x60: // LD IXH, B + RegIX.High = RegBC.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x61: // LD IXH, C + RegIX.High = RegBC.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x62: // LD IXH, D + RegIX.High = RegDE.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x63: // LD IXH, E + RegIX.High = RegDE.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x64: // LD IXH, IXH + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x65: // LD IXH, IXL + RegIX.High = RegIX.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x66: // LD H, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegHL.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x67: // LD IXH, A + RegIX.High = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x68: // LD IXL, B + RegIX.Low = RegBC.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x69: // LD IXL, C + RegIX.Low = RegBC.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6A: // LD IXL, D + RegIX.Low = RegDE.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6B: // LD IXL, E + RegIX.Low = RegDE.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6C: // LD IXL, IXH + RegIX.Low = RegIX.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6D: // LD IXL, IXL + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6E: // LD L, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegHL.Low = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x6F: // LD IXL, A + RegIX.Low = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x70: // LD (IX+d), B + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0x71: // LD (IX+d), C + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0x72: // LD (IX+d), D + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0x73: // LD (IX+d), E + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0x74: // LD (IX+d), H + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0x75: // LD (IX+d), L + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0x76: // HALT + Halt(); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x77: // LD (IX+d), A + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0x78: // LD A, B + RegAF.High = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x79: // LD A, C + RegAF.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7A: // LD A, D + RegAF.High = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7B: // LD A, E + RegAF.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7C: // LD A, IXH + RegAF.High = RegIX.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x7D: // LD A, IXL + RegAF.High = RegIX.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x7E: // LD A, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x7F: // LD A, A + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x80: // ADD A, B + RegAF.Word = TableALU[0, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x81: // ADD A, C + RegAF.Word = TableALU[0, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x82: // ADD A, D + RegAF.Word = TableALU[0, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x83: // ADD A, E + RegAF.Word = TableALU[0, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x84: // ADD A, IXH + RegAF.Word = TableALU[0, RegAF.High, RegIX.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x85: // ADD A, IXL + RegAF.Word = TableALU[0, RegAF.High, RegIX.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x86: // ADD A, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[0, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19;//modify 16 to 19 + break; + case 0x87: // ADD A, A + RegAF.Word = TableALU[0, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x88: // ADC A, B + RegAF.Word = TableALU[1, RegAF.High, RegBC.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x89: // ADC A, C + RegAF.Word = TableALU[1, RegAF.High, RegBC.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8A: // ADC A, D + RegAF.Word = TableALU[1, RegAF.High, RegDE.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8B: // ADC A, E + RegAF.Word = TableALU[1, RegAF.High, RegDE.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8C: // ADC A, IXH + RegAF.Word = TableALU[1, RegAF.High, RegIX.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x8D: // ADC A, IXL + RegAF.Word = TableALU[1, RegAF.High, RegIX.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x8E: // ADC A, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[1, RegAF.High, ReadMemory(RegWZ.Word), RegFlagC ? 1 : 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x8F: // ADC A, A + RegAF.Word = TableALU[1, RegAF.High, RegAF.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x90: // SUB B + RegAF.Word = TableALU[2, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x91: // SUB C + RegAF.Word = TableALU[2, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x92: // SUB D + RegAF.Word = TableALU[2, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x93: // SUB E + RegAF.Word = TableALU[2, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x94: // SUB IXH + RegAF.Word = TableALU[2, RegAF.High, RegIX.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x95: // SUB IXL + RegAF.Word = TableALU[2, RegAF.High, RegIX.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x96: // SUB (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[2, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x97: // SUB A, A + RegAF.Word = TableALU[2, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x98: // SBC A, B + RegAF.Word = TableALU[3, RegAF.High, RegBC.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x99: // SBC A, C + RegAF.Word = TableALU[3, RegAF.High, RegBC.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9A: // SBC A, D + RegAF.Word = TableALU[3, RegAF.High, RegDE.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9B: // SBC A, E + RegAF.Word = TableALU[3, RegAF.High, RegDE.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9C: // SBC A, IXH + RegAF.Word = TableALU[3, RegAF.High, RegIX.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x9D: // SBC A, IXL + RegAF.Word = TableALU[3, RegAF.High, RegIX.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x9E: // SBC A, (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[3, RegAF.High, ReadMemory(RegWZ.Word), RegFlagC ? 1 : 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x9F: // SBC A, A + RegAF.Word = TableALU[3, RegAF.High, RegAF.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA0: // AND B + RegAF.Word = TableALU[4, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA1: // AND C + RegAF.Word = TableALU[4, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA2: // AND D + RegAF.Word = TableALU[4, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA3: // AND E + RegAF.Word = TableALU[4, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA4: // AND IXH + RegAF.Word = TableALU[4, RegAF.High, RegIX.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xA5: // AND IXL + RegAF.Word = TableALU[4, RegAF.High, RegIX.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xA6: // AND (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[4, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xA7: // AND A + RegAF.Word = TableALU[4, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA8: // XOR B + RegAF.Word = TableALU[5, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA9: // XOR C + RegAF.Word = TableALU[5, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAA: // XOR D + RegAF.Word = TableALU[5, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAB: // XOR E + RegAF.Word = TableALU[5, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAC: // XOR IXH + RegAF.Word = TableALU[5, RegAF.High, RegIX.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xAD: // XOR IXL + RegAF.Word = TableALU[5, RegAF.High, RegIX.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xAE: // XOR (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[5, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xAF: // XOR A + RegAF.Word = TableALU[5, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB0: // OR B + RegAF.Word = TableALU[6, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB1: // OR C + RegAF.Word = TableALU[6, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB2: // OR D + RegAF.Word = TableALU[6, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB3: // OR E + RegAF.Word = TableALU[6, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB4: // OR IXH + RegAF.Word = TableALU[6, RegAF.High, RegIX.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xB5: // OR IXL + RegAF.Word = TableALU[6, RegAF.High, RegIX.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xB6: // OR (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[6, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xB7: // OR A + RegAF.Word = TableALU[6, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB8: // CP B + RegAF.Word = TableALU[7, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB9: // CP C + RegAF.Word = TableALU[7, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBA: // CP D + RegAF.Word = TableALU[7, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBB: // CP E + RegAF.Word = TableALU[7, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBC: // CP IXH + RegAF.Word = TableALU[7, RegAF.High, RegIX.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xBD: // CP IXL + RegAF.Word = TableALU[7, RegAF.High, RegIX.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xBE: // CP (IX+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + RegAF.Word = TableALU[7, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xBF: // CP A + RegAF.Word = TableALU[7, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC0: // RET NZ + if (!RegFlagZ) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xC1: // POP BC + RegBC.Low = ReadMemory(RegSP.Word++); RegBC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC2: // JP NZ, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagZ) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC3: // JP nn + RegPC.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC4: // CALL NZ, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagZ) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xC5: // PUSH BC + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegBC.High); WriteMemory(--RegSP.Word, RegBC.Low); + break; + case 0xC6: // ADD A, n + RegAF.Word = TableALU[0, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xC7: // RST $00 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x00; + break; + case 0xC8: // RET Z + if (RegFlagZ) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xC9: // RET + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xCA: // JP Z, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagZ) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xCB: // (Prefix) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + //++RegR; + RegWZ.Word = (ushort)(RegIX.Word + Displacement); + switch (ReadOpArg(RegPC.Word++)) + { + case 0x00: // RLC (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x01: // RLC (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x02: // RLC (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x03: // RLC (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x04: // RLC (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x05: // RLC (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x06: // RLC (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x07: // RLC (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x08: // RRC (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x09: // RRC (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x0A: // RRC (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x0B: // RRC (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x0C: // RRC (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x0D: // RRC (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x0E: // RRC (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x0F: // RRC (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x10: // RL (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x11: // RL (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x12: // RL (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x13: // RL (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x14: // RL (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x15: // RL (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x16: // RL (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x17: // RL (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x18: // RR (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x19: // RR (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x1A: // RR (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x1B: // RR (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x1C: // RR (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x1D: // RR (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x1E: // RR (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1F: // RR (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x20: // SLA (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x21: // SLA (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x22: // SLA (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x23: // SLA (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x24: // SLA (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x25: // SLA (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x26: // SLA (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x27: // SLA (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x28: // SRA (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x29: // SRA (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x2A: // SRA (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x2B: // SRA (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x2C: // SRA (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x2D: // SRA (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x2E: // SRA (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2F: // SRA (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x30: // SL1 (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x31: // SL1 (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x32: // SL1 (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x33: // SL1 (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x34: // SL1 (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x35: // SL1 (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x36: // SL1 (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x37: // SL1 (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x38: // SRL (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.High = (byte)TUS; + break; + case 0x39: // SRL (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegBC.Low = (byte)TUS; + break; + case 0x3A: // SRL (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.High = (byte)TUS; + break; + case 0x3B: // SRL (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegDE.Low = (byte)TUS; + break; + case 0x3C: // SRL (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.High = (byte)TUS; + break; + case 0x3D: // SRL (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegHL.Low = (byte)TUS; + break; + case 0x3E: // SRL (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3F: // SRL (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + RegAF.High = (byte)TUS; + break; + case 0x40: // BIT 0, (IX+d) + case 0x41: // BIT 0, (IX+d) + case 0x42: // BIT 0, (IX+d) + case 0x43: // BIT 0, (IX+d) + case 0x44: // BIT 0, (IX+d) + case 0x45: // BIT 0, (IX+d) + case 0x46: // BIT 0, (IX+d) + case 0x47: // BIT 0, (IX+d) + totalExecutedCycles += 20; pendingCycles -= 20; + TBOOL = (ReadMemory(RegWZ.Word) & 0x01) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + break; + case 0x48: // BIT 1, (IX+d) + case 0x49: // BIT 1, (IX+d) + case 0x4A: // BIT 1, (IX+d) + case 0x4B: // BIT 1, (IX+d) + case 0x4C: // BIT 1, (IX+d) + case 0x4D: // BIT 1, (IX+d) + case 0x4E: // BIT 1, (IX+d) + case 0x4F: // BIT 1, (IX+d) + totalExecutedCycles += 20; pendingCycles -= 20; + TBOOL = (ReadMemory(RegWZ.Word) & 0x02) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + break; + case 0x50: // BIT 2, (IX+d) + case 0x51: // BIT 2, (IX+d) + case 0x52: // BIT 2, (IX+d) + case 0x53: // BIT 2, (IX+d) + case 0x54: // BIT 2, (IX+d) + case 0x55: // BIT 2, (IX+d) + case 0x56: // BIT 2, (IX+d) + case 0x57: // BIT 2, (IX+d) + totalExecutedCycles += 20; pendingCycles -= 20; + TBOOL = (ReadMemory(RegWZ.Word) & 0x04) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + break; + case 0x58: // BIT 3, (IX+d) + case 0x59: // BIT 3, (IX+d) + case 0x5A: // BIT 3, (IX+d) + case 0x5B: // BIT 3, (IX+d) + case 0x5C: // BIT 3, (IX+d) + case 0x5D: // BIT 3, (IX+d) + case 0x5E: // BIT 3, (IX+d) + case 0x5F: // BIT 3, (IX+d) + totalExecutedCycles += 20; pendingCycles -= 20; + TBOOL = (ReadMemory(RegWZ.Word) & 0x08) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + break; + case 0x60: // BIT 4, (IX+d) + case 0x61: // BIT 4, (IX+d) + case 0x62: // BIT 4, (IX+d) + case 0x63: // BIT 4, (IX+d) + case 0x64: // BIT 4, (IX+d) + case 0x65: // BIT 4, (IX+d) + case 0x66: // BIT 4, (IX+d) + case 0x67: // BIT 4, (IX+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x10) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x68: // BIT 5, (IX+d) + case 0x69: // BIT 5, (IX+d) + case 0x6A: // BIT 5, (IX+d) + case 0x6B: // BIT 5, (IX+d) + case 0x6C: // BIT 5, (IX+d) + case 0x6D: // BIT 5, (IX+d) + case 0x6E: // BIT 5, (IX+d) + case 0x6F: // BIT 5, (IX+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x20) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x70: // BIT 6, (IX+d) + case 0x71: // BIT 6, (IX+d) + case 0x72: // BIT 6, (IX+d) + case 0x73: // BIT 6, (IX+d) + case 0x74: // BIT 6, (IX+d) + case 0x75: // BIT 6, (IX+d) + case 0x76: // BIT 6, (IX+d) + case 0x77: // BIT 6, (IX+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x40) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x78: // BIT 7, (IX+d) + case 0x79: // BIT 7, (IX+d) + case 0x7A: // BIT 7, (IX+d) + case 0x7B: // BIT 7, (IX+d) + case 0x7C: // BIT 7, (IX+d) + case 0x7D: // BIT 7, (IX+d) + case 0x7E: // BIT 7, (IX+d) + case 0x7F: // BIT 7, (IX+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x80) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = !TBOOL; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x80: // RES 0, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0x81: // RES 0, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0x82: // RES 0, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0x83: // RES 0, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0x84: // RES 0, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0x85: // RES 0, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0x86: // RES 0, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x87: // RES 0, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0x88: // RES 1, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0x89: // RES 1, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0x8A: // RES 1, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0x8B: // RES 1, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0x8C: // RES 1, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0x8D: // RES 1, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0x8E: // RES 1, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x8F: // RES 1, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0x90: // RES 2, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0x91: // RES 2, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0x92: // RES 2, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0x93: // RES 2, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0x94: // RES 2, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0x95: // RES 2, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0x96: // RES 2, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x97: // RES 2, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0x98: // RES 3, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0x99: // RES 3, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0x9A: // RES 3, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0x9B: // RES 3, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0x9C: // RES 3, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0x9D: // RES 3, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0x9E: // RES 3, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x9F: // RES 3, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xA0: // RES 4, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xA1: // RES 4, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xA2: // RES 4, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xA3: // RES 4, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xA4: // RES 4, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xA5: // RES 4, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xA6: // RES 4, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA7: // RES 4, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xA8: // RES 5, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xA9: // RES 5, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xAA: // RES 5, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xAB: // RES 5, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xAC: // RES 5, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xAD: // RES 5, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xAE: // RES 5, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xAF: // RES 5, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xB0: // RES 6, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xB1: // RES 6, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xB2: // RES 6, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xB3: // RES 6, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xB4: // RES 6, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xB5: // RES 6, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xB6: // RES 6, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB7: // RES 6, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xB8: // RES 7, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xB9: // RES 7, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xBA: // RES 7, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xBB: // RES 7, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xBC: // RES 7, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xBD: // RES 7, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xBE: // RES 7, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xBF: // RES 7, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xC0: // SET 0, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xC1: // SET 0, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xC2: // SET 0, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xC3: // SET 0, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xC4: // SET 0, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xC5: // SET 0, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xC6: // SET 0, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC7: // SET 0, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xC8: // SET 1, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xC9: // SET 1, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xCA: // SET 1, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xCB: // SET 1, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xCC: // SET 1, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xCD: // SET 1, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xCE: // SET 1, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xCF: // SET 1, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xD0: // SET 2, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xD1: // SET 2, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xD2: // SET 2, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xD3: // SET 2, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xD4: // SET 2, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xD5: // SET 2, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xD6: // SET 2, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD7: // SET 2, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xD8: // SET 3, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xD9: // SET 3, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xDA: // SET 3, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xDB: // SET 3, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xDC: // SET 3, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xDD: // SET 3, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xDE: // SET 3, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xDF: // SET 3, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xE0: // SET 4, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xE1: // SET 4, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xE2: // SET 4, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xE3: // SET 4, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xE4: // SET 4, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xE5: // SET 4, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xE6: // SET 4, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE7: // SET 4, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xE8: // SET 5, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xE9: // SET 5, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xEA: // SET 5, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xEB: // SET 5, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xEC: // SET 5, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xED: // SET 5, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xEE: // SET 5, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xEF: // SET 5, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xF0: // SET 6, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xF1: // SET 6, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xF2: // SET 6, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xF3: // SET 6, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xF4: // SET 6, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xF5: // SET 6, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xF6: // SET 6, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF7: // SET 6, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0xF8: // SET 7, (IX+d)→B + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80)); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0xF9: // SET 7, (IX+d)→C + totalExecutedCycles += 23; pendingCycles -= 23; + RegBC.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80)); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0xFA: // SET 7, (IX+d)→D + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80)); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0xFB: // SET 7, (IX+d)→E + totalExecutedCycles += 23; pendingCycles -= 23; + RegDE.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80)); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0xFC: // SET 7, (IX+d)→H + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80)); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0xFD: // SET 7, (IX+d)→L + totalExecutedCycles += 23; pendingCycles -= 23; + RegHL.Low = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80)); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0xFE: // SET 7, (IX+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xFF: // SET 7, (IX+d)→A + totalExecutedCycles += 23; pendingCycles -= 23; + RegAF.High = (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80)); + WriteMemory(RegWZ.Word, RegAF.High); + break; + } + break; + case 0xCC: // CALL Z, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagZ) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xCD: // CALL nn + totalExecutedCycles += 17; pendingCycles -= 17; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + break; + case 0xCE: // ADC A, n + totalExecutedCycles += 7; pendingCycles -= 7; + RegAF.Word = TableALU[1, RegAF.High, ReadMemory(RegPC.Word++), RegFlagC ? 1 : 0]; + break; + case 0xCF: // RST $08 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x08; + break; + case 0xD0: // RET NC + if (!RegFlagC) + { + totalExecutedCycles += 11; pendingCycles -= 11; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xD1: // POP DE + RegDE.Low = ReadMemory(RegSP.Word++); RegDE.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xD2: // JP NC, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagC) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xD3: // OUT n, A + totalExecutedCycles += 11; pendingCycles -= 11; + WriteHardware(ReadMemory(RegPC.Word++), RegAF.High); + break; + case 0xD4: // CALL NC, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagC) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xD5: // PUSH DE + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegDE.High); WriteMemory(--RegSP.Word, RegDE.Low); + break; + case 0xD6: // SUB n + totalExecutedCycles += 7; pendingCycles -= 7; + RegAF.Word = TableALU[2, RegAF.High, ReadMemory(RegPC.Word++), 0]; + break; + case 0xD7: // RST $10 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x10; + break; + case 0xD8: // RET C + if (RegFlagC) + { + totalExecutedCycles += 11; pendingCycles -= 11; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xD9: // EXX + totalExecutedCycles += 4; pendingCycles -= 4; + TUS = RegBC.Word; RegBC.Word = RegAltBC.Word; RegAltBC.Word = TUS; + TUS = RegDE.Word; RegDE.Word = RegAltDE.Word; RegAltDE.Word = TUS; + TUS = RegHL.Word; RegHL.Word = RegAltHL.Word; RegAltHL.Word = TUS; + break; + case 0xDA: // JP C, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagC) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xDB: // IN A, n + totalExecutedCycles += 11; pendingCycles -= 11; + TUS = (ushort)(ReadMemory(RegPC.Word++) | (RegAF.High << 8)); + RegAF.High = ReadHardware(TUS); + RegWZ.Word = (ushort)(TUS + 1); + break; + case 0xDC: // CALL C, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagC) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xDD: // <- + // Invalid sequence. + totalExecutedCycles += 1337; pendingCycles -= 1337; + break; + case 0xDE: // SBC A, n + RegAF.Word = TableALU[3, RegAF.High, ReadMemory(RegPC.Word++), RegFlagC ? 1 : 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xDF: // RST $18 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x18; + break; + case 0xE0: // RET PO + if (!RegFlagP) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xE1: // POP IX + RegIX.Low = ReadMemory(RegSP.Word++); RegIX.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0xE2: // JP PO, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagP) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xE3: // EX (SP), IX + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = RegSP.Word; TBL = ReadMemory(TUS++); TBH = ReadMemory(TUS--); + WriteMemory(TUS++, RegIX.Low); WriteMemory(TUS, RegIX.High); + RegIX.Low = TBL; RegIX.High = TBH; + RegWZ.Word = RegIX.Word; + break; + case 0xE4: // CALL C, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagC) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xE5: // PUSH IX + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(--RegSP.Word, RegIX.High); WriteMemory(--RegSP.Word, RegIX.Low); + break; + case 0xE6: // AND n + totalExecutedCycles += 7; pendingCycles -= 7; + RegAF.Word = TableALU[4, RegAF.High, ReadMemory(RegPC.Word++), 0]; + break; + case 0xE7: // RST $20 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x20; + break; + case 0xE8: // RET PE + if (RegFlagP) + { + totalExecutedCycles += 11; pendingCycles -= 11; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xE9: // JP IX + RegPC.Word = RegIX.Word; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xEA: // JP PE, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagP) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xEB: // EX DE, HL + TUS = RegDE.Word; RegDE.Word = RegHL.Word; RegHL.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEC: // CALL PE, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagP) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xED: // (Prefix) + ++RegR; + switch (ReadOp(RegPC.Word++)) + { + case 0x00: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x01: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x02: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x03: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x04: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x05: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x06: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x07: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x08: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x09: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x10: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x11: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x12: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x13: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x14: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x15: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x16: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x17: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x18: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x19: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x20: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x21: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x22: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x23: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x24: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x25: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x26: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x27: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x28: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x29: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x30: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x31: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x32: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x33: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x34: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x35: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x36: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x37: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x38: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x39: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x40: // IN B, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegBC.High = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegBC.High > 127; + RegFlagZ = RegBC.High == 0; + RegFlag5 = (RegBC.High & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegBC.High & 0x08) != 0; + RegFlagP = TableParity[RegBC.High]; + RegFlagN = false; + break; + case 0x41: // OUT C, B + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegBC.High); + break; + case 0x42: // SBC HL, BC + TI1 = (short)RegHL.Word; TI2 = (short)RegBC.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((RegHL.Word ^ RegBC.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegBC.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x43: // LD (nn), BC + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(TUS++, RegBC.Low); + WriteMemory(TUS, RegBC.High); + break; + case 0x44: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x45: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x46: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x47: // LD I, A + RegI = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x48: // IN C, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegBC.Low = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegBC.Low > 127; + RegFlagZ = RegBC.Low == 0; + RegFlag5 = (RegBC.Low & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegBC.Low & 0x08) != 0; + RegFlagP = TableParity[RegBC.Low]; + RegFlagN = false; + break; + case 0x49: // OUT C, C + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegBC.Low); + break; + case 0x4A: // ADC HL, BC + TI1 = (short)RegHL.Word; TI2 = (short)RegBC.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x4B: // LD BC, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegBC.Low = ReadMemory(TUS++); RegBC.High = ReadMemory(TUS); + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x4C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x4E: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4F: // LD R, A + RegR = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x50: // IN D, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegDE.High = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegDE.High > 127; + RegFlagZ = RegDE.High == 0; + RegFlag5 = (RegDE.High & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegDE.High & 0x08) != 0; + RegFlagP = TableParity[RegDE.High]; + RegFlagN = false; + break; + case 0x51: // OUT C, D + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegDE.High); + break; + case 0x52: // SBC HL, DE + TI1 = (short)RegHL.Word; TI2 = (short)RegDE.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((RegHL.Word ^ RegDE.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegDE.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x53: // LD (nn), DE + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(TUS++, RegDE.Low); + WriteMemory(TUS, RegDE.High); + break; + case 0x54: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x55: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x56: // IM $1 + interruptMode = 1; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x57: // LD A, I + RegAF.High = RegI; + RegFlagS = RegI > 127; + RegFlagZ = RegI == 0; + RegFlag5 = ((RegI & 0x20) != 0); + RegFlagH = false; + RegFlag3 = ((RegI & 0x08) != 0); + RegFlagN = false; + RegFlagP = IFF2; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x58: // IN E, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegDE.Low = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegDE.Low > 127; + RegFlagZ = RegDE.Low == 0; + RegFlag5 = (RegDE.Low & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegDE.Low & 0x08) != 0; + RegFlagP = TableParity[RegDE.Low]; + RegFlagN = false; + break; + case 0x59: // OUT C, E + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegDE.Low); + break; + case 0x5A: // ADC HL, DE + TI1 = (short)RegHL.Word; TI2 = (short)RegDE.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x5B: // LD DE, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegDE.Low = ReadMemory(TUS++); RegDE.High = ReadMemory(TUS); + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x5C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x5E: // IM $2 + interruptMode = 2; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5F: // LD A, R + RegAF.High = (byte)((RegR & 0x7F) | RegR2); + RegFlagS = (RegR2 == 0x80); + RegFlagZ = (byte)((RegR & 0x7F) | RegR2) == 0; + RegFlagH = false; + RegFlag5 = ((RegR & 0x20) != 0); + RegFlagN = false; + RegFlag3 = ((RegR & 0x08) != 0); + RegFlagP = IFF2; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x60: // IN H, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegHL.High = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegHL.High > 127; + RegFlagZ = RegHL.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegHL.High]; + RegFlagN = false; + RegFlag3 = (RegHL.High & 0x08) != 0; + RegFlag5 = (RegHL.High & 0x20) != 0; + break; + case 0x61: // OUT C, H + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegHL.High); + break; + case 0x62: // SBC HL, HL + TI1 = (short)RegHL.Word; TI2 = (short)RegHL.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((RegHL.Word ^ RegHL.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegHL.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x63: // LD (nn), HL + totalExecutedCycles += 16; pendingCycles -= 16; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(TUS++, RegHL.Low); + WriteMemory(TUS, RegHL.High); + break; + case 0x64: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x65: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x66: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x67: // RRD + totalExecutedCycles += 18; pendingCycles -= 18; + TB1 = RegAF.High; TB2 = ReadMemory(RegHL.Word); + WriteMemory(RegHL.Word, (byte)((TB2 >> 4) + (TB1 << 4))); + RegAF.High = (byte)((TB1 & 0xF0) + (TB2 & 0x0F)); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + break; + case 0x68: // IN L, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegHL.Low = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegHL.Low > 127; + RegFlagZ = RegHL.Low == 0; + RegFlagH = false; + RegFlagP = TableParity[RegHL.Low]; + RegFlagN = false; + RegFlag3 = (RegHL.Low & 0x08) != 0; + RegFlag5 = (RegHL.Low & 0x20) != 0; + break; + case 0x69: // OUT C, L + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegHL.Low); + break; + case 0x6A: // ADC HL, HL + TI1 = (short)RegHL.Word; TI2 = (short)RegHL.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x6B: // LD HL, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegHL.Low = ReadMemory(TUS++); RegHL.High = ReadMemory(TUS); + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0x6C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x6E: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6F: // RLD + totalExecutedCycles += 18; pendingCycles -= 18; + TB1 = RegAF.High; TB2 = ReadMemory(RegHL.Word); + WriteMemory(RegHL.Word, (byte)((TB1 & 0x0F) + (TB2 << 4))); + RegAF.High = (byte)((TB1 & 0xF0) + (TB2 >> 4)); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + break; + case 0x70: // IN 0, C + totalExecutedCycles += 12; pendingCycles -= 12; + TB = ReadHardware((ushort)RegBC.Word); + RegFlagS = TB > 127; + RegFlagZ = TB == 0; + RegFlagH = false; + RegFlagP = TableParity[TB]; + RegFlagN = false; + RegFlag3 = (TB & 0x08) != 0; + RegFlag5 = (TB & 0x20) != 0; + break; + case 0x71: // OUT C, 0 + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, 0); + break; + case 0x72: // SBC HL, SP + TI1 = (short)RegHL.Word; TI2 = (short)RegSP.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((RegHL.Word ^ RegSP.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegSP.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x73: // LD (nn), SP + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegSP.Low); + WriteMemory(TUS, RegSP.High); + break; + case 0x74: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x75: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x76: // IM $1 + interruptMode = 1; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x77: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x78: // IN A, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegAF.High = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + RegWZ.Word = (ushort)(RegBC.Word + 1); + break; + case 0x79: // OUT C, A + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegAF.High); + break; + case 0x7A: // ADC HL, SP + TI1 = (short)RegHL.Word; TI2 = (short)RegSP.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x7B: // LD SP, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegSP.Low = ReadMemory(TUS++); RegSP.High = ReadMemory(TUS); + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x7C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x7E: // IM $2 + interruptMode = 2; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x80: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x81: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x82: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x83: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x84: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x85: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x86: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x87: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x88: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x89: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x90: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x91: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x92: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x93: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x94: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x95: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x96: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x97: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x98: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x99: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA0: // LDI + totalExecutedCycles += 16; pendingCycles -= 16; + WriteMemory(RegDE.Word++, TB1 = ReadMemory(RegHL.Word++)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + break; + case 0xA1: // CPI + TB1 = ReadMemory(RegHL.Word++); TB2 = (byte)(RegAF.High - TB1); + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0xA2: // INI + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word + 1); + --RegBC.High; + WriteMemory(RegHL.Word++, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low + 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xA3: // OUTI + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word++); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word + 1); + WriteHardware(RegBC.Word, TB); + RegFlagC = false; + RegFlagN = false; + RegFlag3 = IsX(RegBC.High); + RegFlagH = false; + RegFlag5 = IsY(RegBC.High); + RegFlagZ = RegBC.High == 0; + RegFlagS = IsS(RegBC.High); + TUS = (ushort)(RegHL.Low + TB); + if (IsS(TB)) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagC = true; + RegFlagH = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xA4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA8: // LDD + totalExecutedCycles += 16; pendingCycles -= 16; + WriteMemory(RegDE.Word--, TB1 = ReadMemory(RegHL.Word--)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + break; + case 0xA9: // CPD + TB1 = ReadMemory(RegHL.Word--); TB2 = (byte)(RegAF.High - TB1); + RegWZ.Word--; + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0xAA: // IND + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word - 1); + --RegBC.High; + WriteMemory(RegHL.Word--, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low - 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xAB: // OUTD + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word--); + WriteHardware(RegBC.Word, TB); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word - 1); + TUS = (ushort)(RegHL.Low + TB); + RegFlagZ = RegBC.High == 0; + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xAC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB0: // LDIR + WriteMemory(RegDE.Word++, TB1 = ReadMemory(RegHL.Word++)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + if (RegBC.Word != 0) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB1: // CPIR + TB1 = ReadMemory(RegHL.Word++); TB2 = (byte)(RegAF.High - TB1); + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + if (RegBC.Word != 0 && !RegFlagZ) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB2: // INIR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word + 1); + --RegBC.High; + WriteMemory(RegHL.Word++, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low + 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xB3: // OTIR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word++); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word + 1); + WriteHardware(RegBC.Word, TB); + RegFlagC = false; + RegFlagN = false; + RegFlag3 = IsX(RegBC.High); + RegFlagH = false; + RegFlag5 = IsY(RegBC.High); + RegFlagZ = RegBC.High == 0; + RegFlagS = IsS(RegBC.High); + TUS = (ushort)(RegHL.Low + TB); + if (IsS(TB)) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagC = true; + RegFlagH = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xB4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB8: // LDDR + WriteMemory(RegDE.Word--, TB1 = ReadMemory(RegHL.Word--)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + if (RegBC.Word != 0) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB9: // CPDR + TB1 = ReadMemory(RegHL.Word--); TB2 = (byte)(RegAF.High - TB1); + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + if (RegBC.Word != 0 && !RegFlagZ) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xBA: // INDR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word - 1); + --RegBC.High; + WriteMemory(RegHL.Word--, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low - 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xBB: // OTDR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word--); + WriteHardware(RegBC.Word, TB); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word - 1); + TUS = (ushort)(RegHL.Low + TB); + RegFlagZ = RegBC.High == 0; + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xBC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xED: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + } + break; + case 0xEE: // XOR n + RegAF.Word = TableALU[5, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xEF: // RST $28 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x28; + break; + case 0xF0: // RET P + if (!RegFlagS) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xF1: // POP AF + RegAF.Low = ReadMemory(RegSP.Word++); RegAF.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xF2: // JP P, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagS) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xF3: // DI + IFF1 = IFF2 = false; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF4: // CALL P, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagS) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xF5: // PUSH AF + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegAF.High); WriteMemory(--RegSP.Word, RegAF.Low); + break; + case 0xF6: // OR n + RegAF.Word = TableALU[6, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xF7: // RST $30 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x30; + break; + case 0xF8: // RET M + if (RegFlagS) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xF9: // LD SP, IX + RegSP.Word = RegIX.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xFA: // JP M, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagS) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xFB: // EI + IFF1 = IFF2 = true; + Interruptable = false; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFC: // CALL M, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagS) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xFD: // <- + // Invalid sequence. + totalExecutedCycles += 1337; pendingCycles -= 1337; + break; + case 0xFE: // CP n + RegAF.Word = TableALU[7, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xFF: // RST $38 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x38; + break; + } + break; + case 0xDE: // SBC A, n + RegAF.Word = TableALU[3, RegAF.High, ReadOpArg(RegPC.Word++), RegFlagC ? 1 : 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xDF: // RST $18 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x18; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xE0: // RET PO + if (!RegFlagP) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xE1: // POP HL + RegHL.Low = ReadMemory(RegSP.Word++); RegHL.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xE2: // JP PO, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (!RegFlagP) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xE3: // EX (SP), HL + TUS = RegSP.Word; TBL = ReadMemory(TUS++); TBH = ReadMemory(TUS--); + WriteMemory(TUS++, RegHL.Low); WriteMemory(TUS, RegHL.High); + RegHL.Low = TBL; RegHL.High = TBH; + RegWZ.Word = RegHL.Word; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xE4: // CALL C, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagC) + { + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xE5: // PUSH HL + WriteMemory(--RegSP.Word, RegHL.High); WriteMemory(--RegSP.Word, RegHL.Low); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xE6: // AND n + RegAF.Word = TableALU[4, RegAF.High, ReadOpArg(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xE7: // RST $20 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x20; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xE8: // RET PE + if (RegFlagP) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xE9: // JP HL + RegPC.Word = RegHL.Word; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEA: // JP PE, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagP) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xEB: // EX DE, HL + TUS = RegDE.Word; RegDE.Word = RegHL.Word; RegHL.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEC: // CALL PE, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagP) + { + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xED: // (Prefix) + ++RegR; + switch (ReadOp(RegPC.Word++)) + { + case 0x00: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x01: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x02: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x03: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x04: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x05: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x06: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x07: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x08: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x09: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x10: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x11: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x12: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x13: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x14: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x15: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x16: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x17: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x18: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x19: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x20: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x21: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x22: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x23: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x24: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x25: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x26: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x27: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x28: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x29: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x30: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x31: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x32: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x33: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x34: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x35: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x36: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x37: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x38: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x39: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x40: // IN B, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegBC.High = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegBC.High > 127; + RegFlagZ = RegBC.High == 0; + RegFlag5 = (RegBC.High & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegBC.High & 0x08) != 0; + RegFlagP = TableParity[RegBC.High]; + RegFlagN = false; + break; + case 0x41: // OUT C, B + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, RegBC.High); + break; + case 0x42: // SBC HL, BC + totalExecutedCycles += 15; pendingCycles -= 15; + TI1 = (short)RegHL.Word; TI2 = (short)RegBC.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((RegHL.Word ^ RegBC.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegBC.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + break; + case 0x43: // LD (nn), BC + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegBC.Low); + WriteMemory(TUS, RegBC.High); + RegWZ.Word = TUS; + break; + case 0x44: // NEG + totalExecutedCycles += 8; pendingCycles -= 8; + RegAF.Word = TableNeg[RegAF.Word]; + break; + case 0x45: // RETN + totalExecutedCycles += 14; pendingCycles -= 14; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + break; + case 0x46: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x47: // LD I, A + RegI = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x48: // IN C, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegBC.Low = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegBC.Low > 127; + RegFlagZ = RegBC.Low == 0; + RegFlag5 = (RegBC.Low & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegBC.Low & 0x08) != 0; + RegFlagP = TableParity[RegBC.Low]; + RegFlagN = false; + break; + case 0x49: // OUT C, C + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, RegBC.Low); + break; + case 0x4A: // ADC HL, BC + totalExecutedCycles += 15; pendingCycles -= 15; + TI1 = (short)RegHL.Word; TI2 = (short)RegBC.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + break; + case 0x4B: // LD BC, (nn) + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegBC.Low = ReadMemory(TUS++); RegBC.High = ReadMemory(TUS); + RegWZ.Word = TUS; + break; + case 0x4C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4D: // RETI + totalExecutedCycles += 14; pendingCycles -= 14; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + break; + case 0x4E: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4F: // LD R, A + RegR = RegAF.High; + RegR2 = (byte)(RegAF.High & 0x80); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x50: // IN D, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegDE.High = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegDE.High > 127; + RegFlagZ = RegDE.High == 0; + RegFlag5 = (RegDE.High & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegDE.High & 0x08) != 0; + RegFlagP = TableParity[RegDE.High]; + RegFlagN = false; + break; + case 0x51: // OUT C, D + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, RegDE.High); + break; + case 0x52: // SBC HL, DE + totalExecutedCycles += 15; pendingCycles -= 15; + TI1 = (short)RegHL.Word; TI2 = (short)RegDE.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((RegHL.Word ^ RegDE.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegDE.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + break; + case 0x53: // LD (nn), DE + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegDE.Low); + WriteMemory(TUS, RegDE.High); + RegWZ.Word = TUS; + break; + case 0x54: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x55: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x56: // IM $1 + interruptMode = 1; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x57: // LD A, I + RegAF.High = RegI; + RegFlagS = RegI > 127; + RegFlagZ = RegI == 0; + RegFlag5 = ((RegI & 0x20) != 0); + RegFlagH = false; + RegFlag3 = ((RegI & 0x08) != 0); + RegFlagN = false; + RegFlagP = IFF2; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x58: // IN E, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegDE.Low = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegDE.Low > 127; + RegFlagZ = RegDE.Low == 0; + RegFlag5 = (RegDE.Low & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegDE.Low & 0x08) != 0; + RegFlagP = TableParity[RegDE.Low]; + RegFlagN = false; + break; + case 0x59: // OUT C, E + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, RegDE.Low); + break; + case 0x5A: // ADC HL, DE + TI1 = (short)RegHL.Word; TI2 = (short)RegDE.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x5B: // LD DE, (nn) + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegDE.Low = ReadMemory(TUS++); RegDE.High = ReadMemory(TUS); + RegWZ.Word = TUS; + break; + case 0x5C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5D: // RETI + totalExecutedCycles += 14; pendingCycles -= 14; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + break; + case 0x5E: // IM $2 + interruptMode = 2; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5F: // LD A, R + totalExecutedCycles += 9; pendingCycles -= 9; + RegAF.High = (byte)((RegR & 0x7F) | RegR2); + RegFlagS = (RegR2 == 0x80); + RegFlagZ = (byte)((RegR & 0x7F) | RegR2) == 0; + RegFlagH = false; + RegFlag5 = ((RegR & 0x20) != 0); + RegFlagN = false; + RegFlag3 = ((RegR & 0x08) != 0); + RegFlagP = IFF2; + break; + case 0x60: // IN H, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegHL.High = ReadHardware(RegBC.Word); + RegFlagS = RegHL.High > 127; + RegFlagZ = RegHL.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegHL.High]; + RegFlagN = false; + RegFlag3 = (RegHL.High & 0x08) != 0; + RegFlag5 = (RegHL.High & 0x20) != 0; + break; + case 0x61: // OUT C, H + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, RegHL.High); + break; + case 0x62: // SBC HL, HL + totalExecutedCycles += 15; pendingCycles -= 15; + TI1 = (short)RegHL.Word; TI2 = (short)RegHL.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((RegHL.Word ^ RegHL.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegHL.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + break; + case 0x63: // LD (nn), HL + totalExecutedCycles += 16; pendingCycles -= 16; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegHL.Low); + WriteMemory(TUS, RegHL.High); + RegWZ.Word = TUS; + break; + case 0x64: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x65: // RETN + totalExecutedCycles += 14; pendingCycles -= 14; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + break; + case 0x66: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x67: // RRD + totalExecutedCycles += 18; pendingCycles -= 18; + TB1 = RegAF.High; TB2 = ReadMemory(RegHL.Word); + RegWZ.Word = (ushort)(RegHL.Word + 1); + WriteMemory(RegHL.Word, (byte)((TB2 >> 4) + (TB1 << 4))); + RegAF.High = (byte)((TB1 & 0xF0) + (TB2 & 0x0F)); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + break; + case 0x68: // IN L, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegHL.Low = ReadHardware((ushort)RegBC.Word); + RegFlagS = RegHL.Low > 127; + RegFlagZ = RegHL.Low == 0; + RegFlagH = false; + RegFlagP = TableParity[RegHL.Low]; + RegFlagN = false; + RegFlag3 = (RegHL.Low & 0x08) != 0; + RegFlag5 = (RegHL.Low & 0x20) != 0; + break; + case 0x69: // OUT C, L + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, RegHL.Low); + break; + case 0x6A: // ADC HL, HL + totalExecutedCycles += 15; pendingCycles -= 15; + TI1 = (short)RegHL.Word; TI2 = (short)RegHL.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + break; + case 0x6B: // LD HL, (nn) + totalExecutedCycles += 16; pendingCycles -= 16; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegHL.Low = ReadMemory(TUS++); RegHL.High = ReadMemory(TUS); + RegWZ.Word = TUS; + break; + case 0x6C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6D: // RETI + totalExecutedCycles += 14; pendingCycles -= 14; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + break; + case 0x6E: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6F: // RLD + totalExecutedCycles += 18; pendingCycles -= 18; + TB1 = RegAF.High; TB2 = ReadMemory(RegHL.Word); + RegWZ.Word = (ushort)(RegHL.Word + 1); + WriteMemory(RegHL.Word, (byte)((TB1 & 0x0F) + (TB2 << 4))); + RegAF.High = (byte)((TB1 & 0xF0) + (TB2 >> 4)); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + break; + case 0x70: // IN 0, C + totalExecutedCycles += 12; pendingCycles -= 12; + TB = ReadHardware((ushort)RegBC.Word); + RegFlagS = TB > 127; + RegFlagZ = TB == 0; + RegFlagH = false; + RegFlagP = TableParity[TB]; + RegFlagN = false; + RegFlag3 = (TB & 0x08) != 0; + RegFlag5 = (TB & 0x20) != 0; + break; + case 0x71: // OUT C, 0 + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, 0); + break; + case 0x72: // SBC HL, SP + totalExecutedCycles += 15; pendingCycles -= 15; + TI1 = (short)RegHL.Word; TI2 = (short)RegSP.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((RegHL.Word ^ RegSP.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegSP.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + break; + case 0x73: // LD (nn), SP + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegSP.Low); + WriteMemory(TUS, RegSP.High); + RegWZ.Word = TUS; + break; + case 0x74: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x75: // RETN + totalExecutedCycles += 14; pendingCycles -= 14; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + break; + case 0x76: // IM $1 + interruptMode = 1; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x77: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x78: // IN A, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegAF.High = ReadHardware(RegBC.Word); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + RegWZ.Word = (ushort)(RegBC.Word + 1); + break; + case 0x79: // OUT C, A + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Word, RegAF.High); + RegWZ.Word = (ushort)(RegBC.Word + 1); + break; + case 0x7A: // ADC HL, SP + totalExecutedCycles += 15; pendingCycles -= 15; + TI1 = (short)RegHL.Word; TI2 = (short)RegSP.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + break; + case 0x7B: // LD SP, (nn) + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegSP.Low = ReadMemory(TUS++); RegSP.High = ReadMemory(TUS); + RegWZ.Word = TUS; + break; + case 0x7C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7D: // RETI + totalExecutedCycles += 14; pendingCycles -= 14; + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + break; + case 0x7E: // IM $2 + interruptMode = 2; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x80: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x81: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x82: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x83: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x84: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x85: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x86: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x87: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x88: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x89: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x90: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x91: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x92: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x93: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x94: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x95: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x96: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x97: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x98: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x99: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA0: // LDI + totalExecutedCycles += 16; pendingCycles -= 16; + WriteMemory(RegDE.Word++, TB1 = ReadMemory(RegHL.Word++)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + break; + case 0xA1: // CPI + totalExecutedCycles += 16; pendingCycles -= 16; + TB1 = ReadMemory(RegHL.Word++); TB2 = (byte)(RegAF.High - TB1); + RegWZ.Word++; + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + break; + case 0xA2: // INI + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word + 1); + --RegBC.High; + WriteMemory(RegHL.Word++, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low + 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xA3: // OUTI + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word++); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word + 1); + WriteHardware(RegBC.Word, TB); + RegFlagC = false; + RegFlagN = false; + RegFlag3 = IsX(RegBC.High); + RegFlagH = false; + RegFlag5 = IsY(RegBC.High); + RegFlagZ = RegBC.High == 0; + RegFlagS = IsS(RegBC.High); + TUS = (ushort)(RegHL.Low + TB); + if (IsS(TB)) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagC = true; + RegFlagH = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xA4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA8: // LDD + totalExecutedCycles += 16; pendingCycles -= 16; + WriteMemory(RegDE.Word--, TB1 = ReadMemory(RegHL.Word--)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + break; + case 0xA9: // CPD + totalExecutedCycles += 16; pendingCycles -= 16; + TB1 = ReadMemory(RegHL.Word--); TB2 = (byte)(RegAF.High - TB1); + RegWZ.Word--; + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + break; + case 0xAA: // IND + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word - 1); + --RegBC.High; + WriteMemory(RegHL.Word--, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low - 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xAB: // OUTD + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word--); + WriteHardware(RegBC.Word, TB); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word - 1); + TUS = (ushort)(RegHL.Low + TB); + RegFlagZ = RegBC.High == 0; + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xAC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB0: // LDIR + WriteMemory(RegDE.Word++, TB1 = ReadMemory(RegHL.Word++)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + if (RegBC.Word != 0) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB1: // CPIR + TB1 = ReadMemory(RegHL.Word++); TB2 = (byte)(RegAF.High - TB1); + RegWZ.Word++; + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + if (RegBC.Word != 0 && !RegFlagZ) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB2: // INIR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word + 1); + --RegBC.High; + WriteMemory(RegHL.Word++, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low + 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xB3: // OTIR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word++); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word + 1); + WriteHardware(RegBC.Word, TB); + RegFlagC = false; + RegFlagN = false; + RegFlag3 = IsX(RegBC.High); + RegFlagH = false; + RegFlag5 = IsY(RegBC.High); + RegFlagZ = RegBC.High == 0; + RegFlagS = IsS(RegBC.High); + TUS = (ushort)(RegHL.Low + TB); + if (IsS(TB)) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagC = true; + RegFlagH = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xB4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB8: // LDDR + WriteMemory(RegDE.Word--, TB1 = ReadMemory(RegHL.Word--)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + if (RegBC.Word != 0) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB9: // CPDR + TB1 = ReadMemory(RegHL.Word--); TB2 = (byte)(RegAF.High - TB1); + RegWZ.Word--; + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + if (RegBC.Word != 0 && !RegFlagZ) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xBA: // INDR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word - 1); + --RegBC.High; + WriteMemory(RegHL.Word--, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low - 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xBB: // OTDR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word--); + WriteHardware(RegBC.Word, TB); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word - 1); + TUS = (ushort)(RegHL.Low + TB); + RegFlagZ = RegBC.High == 0; + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xBC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xED: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + } + break; + case 0xEE: // XOR n + RegAF.Word = TableALU[5, RegAF.High, ReadOpArg(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xEF: // RST $28 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x28; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xF0: // RET P + if (!RegFlagS) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xF1: // POP AF + RegAF.Low = ReadMemory(RegSP.Word++); RegAF.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xF2: // JP P, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (!RegFlagS) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xF3: // DI + IFF1 = IFF2 = false; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF4: // CALL P, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (!RegFlagS) + { + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xF5: // PUSH AF + WriteMemory(--RegSP.Word, RegAF.High); WriteMemory(--RegSP.Word, RegAF.Low); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xF6: // OR n + RegAF.Word = TableALU[6, RegAF.High, ReadOpArg(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xF7: // RST $30 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x30; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xF8: // RET M + if (RegFlagS) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xF9: // LD SP, HL + RegSP.Word = RegHL.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0xFA: // JP M, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagS) + { + RegPC.Word = RegWZ.Word; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xFB: // EI + IFF1 = IFF2 = true; + Interruptable = false; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFC: // CALL M, nn + RegWZ.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + if (RegFlagS) + { + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = RegWZ.Word; + totalExecutedCycles += 17; pendingCycles -= 17; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xFD: // (Prefix) + ++RegR; + switch (ReadOp(RegPC.Word++)) + { + case 0x00: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x01: // LD BC, nn + totalExecutedCycles += 10; pendingCycles -= 10; + RegBC.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + break; + case 0x02: // LD (BC), A + totalExecutedCycles += 7; pendingCycles -= 7; + WriteMemory(RegBC.Word, RegAF.High); + break; + case 0x03: // INC BC + ++RegBC.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x04: // INC B + RegAF.Low = (byte)(TableInc[++RegBC.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x05: // DEC B + RegAF.Low = (byte)(TableDec[--RegBC.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x06: // LD B, n + RegBC.High = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x07: // RLCA + RegAF.Word = TableRotShift[0, 0, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x08: // EX AF, AF' + TUS = RegAF.Word; RegAF.Word = RegAltAF.Word; RegAltAF.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x09: // ADD IY, BC + TI1 = (short)RegIY.Word; TI2 = (short)RegBC.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIY.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIY.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x0A: // LD A, (BC) + totalExecutedCycles += 7; pendingCycles -= 7; + RegAF.High = ReadMemory(RegBC.Word); + break; + case 0x0B: // DEC BC + --RegBC.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x0C: // INC C + RegAF.Low = (byte)(TableInc[++RegBC.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0D: // DEC C + RegAF.Low = (byte)(TableDec[--RegBC.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0E: // LD C, n + totalExecutedCycles += 7; pendingCycles -= 7; + RegBC.Low = ReadMemory(RegPC.Word++); + break; + case 0x0F: // RRCA + RegAF.Word = TableRotShift[0, 1, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x10: // DJNZ d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (--RegBC.High != 0) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 13; pendingCycles -= 13; + } + else + { + totalExecutedCycles += 8; pendingCycles -= 8; + } + break; + case 0x11: // LD DE, nn + totalExecutedCycles += 10; pendingCycles -= 10; + RegDE.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + break; + case 0x12: // LD (DE), A + totalExecutedCycles += 7; pendingCycles -= 7; + WriteMemory(RegDE.Word, RegAF.High); + break; + case 0x13: // INC DE + ++RegDE.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x14: // INC D + RegAF.Low = (byte)(TableInc[++RegDE.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x15: // DEC D + RegAF.Low = (byte)(TableDec[--RegDE.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x16: // LD D, n + totalExecutedCycles += 7; pendingCycles -= 7; + RegDE.High = ReadMemory(RegPC.Word++); + break; + case 0x17: // RLA + RegAF.Word = TableRotShift[0, 2, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x18: // JR d + TSB = (sbyte)ReadMemory(RegPC.Word++); + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + break; + case 0x19: // ADD IY, DE + TI1 = (short)RegIY.Word; TI2 = (short)RegDE.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIY.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIY.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x1A: // LD A, (DE) + RegAF.High = ReadMemory(RegDE.Word); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x1B: // DEC DE + --RegDE.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x1C: // INC E + RegAF.Low = (byte)(TableInc[++RegDE.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1D: // DEC E + RegAF.Low = (byte)(TableDec[--RegDE.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1E: // LD E, n + RegDE.Low = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x1F: // RRA + RegAF.Word = TableRotShift[0, 3, RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x20: // JR NZ, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (!RegFlagZ) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x21: // LD IY, nn + RegIY.Word = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x22: // LD (nn), IY + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + WriteMemory(TUS++, RegIY.Low); + WriteMemory(TUS, RegIY.High); + RegWZ.Word = TUS; + break; + case 0x23: // INC IY + ++RegIY.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x24: // INC IYH + RegAF.Low = (byte)(TableInc[++RegIY.High] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x25: // DEC IYH + RegAF.Low = (byte)(TableDec[--RegIY.High] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x26: // LD IYH, n + RegIY.High = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x27: // DAA + RegAF.Word = TableDaa[RegAF.Word]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x28: // JR Z, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (RegFlagZ) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x29: // ADD IY, IY + TI1 = (short)RegIY.Word; TI2 = (short)RegIY.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIY.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIY.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x2A: // LD IY, (nn) + TUS = (ushort)(ReadOpArg(RegPC.Word++) + ReadOpArg(RegPC.Word++) * 256); + RegIY.Low = ReadMemory(TUS++); RegIY.High = ReadMemory(TUS); + RegWZ.Word = TUS; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x2B: // DEC IY + --RegIY.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x2C: // INC IYL + RegAF.Low = (byte)(TableInc[++RegIY.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x2D: // DEC IYL + RegAF.Low = (byte)(TableDec[--RegIY.Low] | (RegAF.Low & 1)); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x2E: // LD IYL, n + RegIY.Low = ReadOpArg(RegPC.Word++); + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x2F: // CPL + RegAF.High ^= 0xFF; RegFlagH = true; RegFlagN = true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x30: // JR NC, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (!RegFlagC) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x31: // LD SP, nn + RegSP.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0x32: // LD (nn), A + totalExecutedCycles += 13; pendingCycles -= 13; + WriteMemory((ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256), RegAF.High); + break; + case 0x33: // INC SP + ++RegSP.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x34: // INC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + TB = ReadMemory(RegWZ.Word); RegAF.Low = (byte)(TableInc[++TB] | (RegAF.Low & 1)); WriteMemory(RegWZ.Word, TB); + break; + case 0x35: // DEC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + TB = ReadMemory(RegWZ.Word); RegAF.Low = (byte)(TableDec[--TB] | (RegAF.Low & 1)); WriteMemory(RegWZ.Word, TB); + break; + case 0x36: // LD (IY+d), n + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, ReadOpArg(RegPC.Word++)); + break; + case 0x37: // SCF + RegFlagH = false; RegFlagN = false; RegFlagC = true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x38: // JR C, d + TSB = (sbyte)ReadMemory(RegPC.Word++); + if (RegFlagC) + { + RegPC.Word = (ushort)(RegPC.Word + TSB); + totalExecutedCycles += 12; pendingCycles -= 12; + } + else + { + totalExecutedCycles += 7; pendingCycles -= 7; + } + break; + case 0x39: // ADD IY, SP + TI1 = (short)RegIY.Word; TI2 = (short)RegSP.Word; TIR = TI1 + TI2; + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegIY.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegIY.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x3A: // LD A, (nn) + RegAF.High = ReadMemory((ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256)); + totalExecutedCycles += 13; pendingCycles -= 13; + break; + case 0x3B: // DEC SP + --RegSP.Word; + totalExecutedCycles += 6; pendingCycles -= 6; + break; + case 0x3C: // INC A + RegAF.Low = (byte)(TableInc[++RegAF.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3D: // DEC A + RegAF.Low = (byte)(TableDec[--RegAF.High] | (RegAF.Low & 1)); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3E: // LD A, n + RegAF.High = ReadMemory(RegPC.Word++); + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0x3F: // CCF + RegFlagH = RegFlagC; RegFlagN = false; RegFlagC ^= true; RegFlag3 = (RegAF.High & 0x08) != 0; RegFlag5 = (RegAF.High & 0x20) != 0; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x40: // LD B, B + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x41: // LD B, C + RegBC.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x42: // LD B, D + RegBC.High = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x43: // LD B, E + RegBC.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x44: // LD B, IYH + RegBC.High = RegIY.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x45: // LD B, IYL + RegBC.High = RegIY.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x46: // LD B, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegBC.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x47: // LD B, A + RegBC.High = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x48: // LD C, B + RegBC.Low = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x49: // LD C, C + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4A: // LD C, D + RegBC.Low = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4B: // LD C, E + RegBC.Low = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x4C: // LD C, IYH + RegBC.Low = RegIY.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x4D: // LD C, IYL + RegBC.Low = RegIY.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x4E: // LD C, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegBC.Low = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x4F: // LD C, A + RegBC.Low = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x50: // LD D, B + RegDE.High = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x51: // LD D, C + RegDE.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x52: // LD D, D + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x53: // LD D, E + RegDE.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x54: // LD D, IYH + RegDE.High = RegIY.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x55: // LD D, IYL + RegDE.High = RegIY.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x56: // LD D, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegDE.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x57: // LD D, A + RegDE.High = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x58: // LD E, B + RegDE.Low = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x59: // LD E, C + RegDE.Low = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5A: // LD E, D + RegDE.Low = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5B: // LD E, E + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x5C: // LD E, IYH + RegDE.Low = RegIY.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x5D: // LD E, IYL + RegDE.Low = RegIY.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x5E: // LD E, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegDE.Low = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x5F: // LD E, A + RegDE.Low = RegAF.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x60: // LD IYH, B + RegIY.High = RegBC.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x61: // LD IYH, C + RegIY.High = RegBC.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x62: // LD IYH, D + RegIY.High = RegDE.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x63: // LD IYH, E + RegIY.High = RegDE.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x64: // LD IYH, IYH + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x65: // LD IYH, IYL + RegIY.High = RegIY.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x66: // LD H, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegHL.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x67: // LD IYH, A + RegIY.High = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x68: // LD IYL, B + RegIY.Low = RegBC.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x69: // LD IYL, C + RegIY.Low = RegBC.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6A: // LD IYL, D + RegIY.Low = RegDE.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6B: // LD IYL, E + RegIY.Low = RegDE.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6C: // LD IYL, IYH + RegIY.Low = RegIY.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6D: // LD IYL, IYL + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x6E: // LD L, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegHL.Low = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x6F: // LD IYL, A + RegIY.Low = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x70: // LD (IY+d), B + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, RegBC.High); + break; + case 0x71: // LD (IY+d), C + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, RegBC.Low); + break; + case 0x72: // LD (IY+d), D + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, RegDE.High); + break; + case 0x73: // LD (IY+d), E + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, RegDE.Low); + break; + case 0x74: // LD (IY+d), H + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, RegHL.High); + break; + case 0x75: // LD (IY+d), L + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, RegHL.Low); + break; + case 0x76: // HALT + Halt(); + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x77: // LD (IY+d), A + totalExecutedCycles += 19; pendingCycles -= 19; + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + WriteMemory(RegWZ.Word, RegAF.High); + break; + case 0x78: // LD A, B + RegAF.High = RegBC.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x79: // LD A, C + RegAF.High = RegBC.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7A: // LD A, D + RegAF.High = RegDE.High; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7B: // LD A, E + RegAF.High = RegDE.Low; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x7C: // LD A, IYH + RegAF.High = RegIY.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x7D: // LD A, IYL + RegAF.High = RegIY.Low; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x7E: // LD A, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.High = ReadMemory(RegWZ.Word); + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x7F: // LD A, A + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x80: // ADD A, B + RegAF.Word = TableALU[0, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x81: // ADD A, C + RegAF.Word = TableALU[0, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x82: // ADD A, D + RegAF.Word = TableALU[0, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x83: // ADD A, E + RegAF.Word = TableALU[0, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x84: // ADD A, IYH + RegAF.Word = TableALU[0, RegAF.High, RegIY.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x85: // ADD A, IYL + RegAF.Word = TableALU[0, RegAF.High, RegIY.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x86: // ADD A, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[0, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19;//16 + break; + case 0x87: // ADD A, A + RegAF.Word = TableALU[0, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x88: // ADC A, B + RegAF.Word = TableALU[1, RegAF.High, RegBC.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x89: // ADC A, C + RegAF.Word = TableALU[1, RegAF.High, RegBC.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8A: // ADC A, D + RegAF.Word = TableALU[1, RegAF.High, RegDE.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8B: // ADC A, E + RegAF.Word = TableALU[1, RegAF.High, RegDE.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8C: // ADC A, IYH + RegAF.Word = TableALU[1, RegAF.High, RegIY.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x8D: // ADC A, IYL + RegAF.Word = TableALU[1, RegAF.High, RegIY.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x8E: // ADC A, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[1, RegAF.High, ReadMemory(RegWZ.Word), RegFlagC ? 1 : 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x8F: // ADC A, A + RegAF.Word = TableALU[1, RegAF.High, RegAF.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x90: // SUB B + RegAF.Word = TableALU[2, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x91: // SUB C + RegAF.Word = TableALU[2, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x92: // SUB D + RegAF.Word = TableALU[2, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x93: // SUB E + RegAF.Word = TableALU[2, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x94: // SUB IYH + RegAF.Word = TableALU[2, RegAF.High, RegIY.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x95: // SUB IYL + RegAF.Word = TableALU[2, RegAF.High, RegIY.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x96: // SUB (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[2, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x97: // SUB A, A + RegAF.Word = TableALU[2, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x98: // SBC A, B + RegAF.Word = TableALU[3, RegAF.High, RegBC.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x99: // SBC A, C + RegAF.Word = TableALU[3, RegAF.High, RegBC.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9A: // SBC A, D + RegAF.Word = TableALU[3, RegAF.High, RegDE.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9B: // SBC A, E + RegAF.Word = TableALU[3, RegAF.High, RegDE.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9C: // SBC A, IYH + RegAF.Word = TableALU[3, RegAF.High, RegIY.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x9D: // SBC A, IYL + RegAF.Word = TableALU[3, RegAF.High, RegIY.Low, RegFlagC ? 1 : 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x9E: // SBC A, (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[3, RegAF.High, ReadMemory(RegWZ.Word), RegFlagC ? 1 : 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0x9F: // SBC A, A + RegAF.Word = TableALU[3, RegAF.High, RegAF.High, RegFlagC ? 1 : 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA0: // AND B + RegAF.Word = TableALU[4, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA1: // AND C + RegAF.Word = TableALU[4, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA2: // AND D + RegAF.Word = TableALU[4, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA3: // AND E + RegAF.Word = TableALU[4, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA4: // AND IYH + RegAF.Word = TableALU[4, RegAF.High, RegIY.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xA5: // AND IYL + RegAF.Word = TableALU[4, RegAF.High, RegIY.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xA6: // AND (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[4, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xA7: // AND A + RegAF.Word = TableALU[4, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA8: // XOR B + RegAF.Word = TableALU[5, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA9: // XOR C + RegAF.Word = TableALU[5, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAA: // XOR D + RegAF.Word = TableALU[5, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAB: // XOR E + RegAF.Word = TableALU[5, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAC: // XOR IYH + RegAF.Word = TableALU[5, RegAF.High, RegIY.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xAD: // XOR IYL + RegAF.Word = TableALU[5, RegAF.High, RegIY.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xAE: // XOR (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[5, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xAF: // XOR A + RegAF.Word = TableALU[5, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB0: // OR B + RegAF.Word = TableALU[6, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB1: // OR C + RegAF.Word = TableALU[6, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB2: // OR D + RegAF.Word = TableALU[6, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB3: // OR E + RegAF.Word = TableALU[6, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB4: // OR IYH + RegAF.Word = TableALU[6, RegAF.High, RegIY.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xB5: // OR IYL + RegAF.Word = TableALU[6, RegAF.High, RegIY.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xB6: // OR (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[6, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xB7: // OR A + RegAF.Word = TableALU[6, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB8: // CP B + RegAF.Word = TableALU[7, RegAF.High, RegBC.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB9: // CP C + RegAF.Word = TableALU[7, RegAF.High, RegBC.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBA: // CP D + RegAF.Word = TableALU[7, RegAF.High, RegDE.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBB: // CP E + RegAF.Word = TableALU[7, RegAF.High, RegDE.Low, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBC: // CP IYH + RegAF.Word = TableALU[7, RegAF.High, RegIY.High, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xBD: // CP IYL + RegAF.Word = TableALU[7, RegAF.High, RegIY.Low, 0]; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0xBE: // CP (IY+d) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + RegAF.Word = TableALU[7, RegAF.High, ReadMemory(RegWZ.Word), 0]; + totalExecutedCycles += 19; pendingCycles -= 19; + break; + case 0xBF: // CP A + RegAF.Word = TableALU[7, RegAF.High, RegAF.High, 0]; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC0: // RET NZ + if (!RegFlagZ) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xC1: // POP BC + RegBC.Low = ReadMemory(RegSP.Word++); RegBC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC2: // JP NZ, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagZ) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC3: // JP nn + RegPC.Word = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xC4: // CALL NZ, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagZ) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xC5: // PUSH BC + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegBC.High); WriteMemory(--RegSP.Word, RegBC.Low); + break; + case 0xC6: // ADD A, n + RegAF.Word = TableALU[0, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xC7: // RST $00 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x00; + break; + case 0xC8: // RET Z + if (RegFlagZ) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xC9: // RET + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xCA: // JP Z, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagZ) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xCB: // (Prefix) + Displacement = (sbyte)ReadOpArg(RegPC.Word++); + //++RegR; + RegWZ.Word = (ushort)(RegIY.Word + Displacement); + switch (ReadOpArg(RegPC.Word++)) + { + case 0x00: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x01: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x02: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x03: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x04: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x05: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x06: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x07: // RLC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 0, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x08: // RRC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x09: // RRC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x0A: // RRC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x0B: // RRC (IY+d) + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + totalExecutedCycles += 23; pendingCycles -= 23; + break; + case 0x0C: // RRC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x0D: // RRC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x0E: // RRC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x0F: // RRC (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 1, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x10: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x11: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x12: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x13: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x14: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x15: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x16: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x17: // RL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 2, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x18: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x19: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1A: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1B: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1C: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1D: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1E: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x1F: // RR (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 3, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x20: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x21: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x22: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x23: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x24: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x25: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x26: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x27: // SLA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 4, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x28: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x29: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2A: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2B: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2C: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2D: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2E: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x2F: // SRA (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 5, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x30: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x31: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x32: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x33: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x34: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x35: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x36: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x37: // SL1 (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 6, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x38: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x39: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3A: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3B: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3C: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3D: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3E: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x3F: // SRL (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = TableRotShift[1, 7, RegAF.Low + 256 * ReadMemory(RegWZ.Word)]; + WriteMemory(RegWZ.Word, (byte)(TUS >> 8)); + RegAF.Low = (byte)TUS; + break; + case 0x40: // BIT 0, (IY+d) + case 0x41: // BIT 0, (IY+d) + case 0x42: // BIT 0, (IY+d) + case 0x43: // BIT 0, (IY+d) + case 0x44: // BIT 0, (IY+d) + case 0x45: // BIT 0, (IY+d) + case 0x46: // BIT 0, (IY+d) + case 0x47: // BIT 0, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x01) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x48: // BIT 1, (IY+d) + case 0x49: // BIT 1, (IY+d) + case 0x4A: // BIT 1, (IY+d) + case 0x4B: // BIT 1, (IY+d) + case 0x4C: // BIT 1, (IY+d) + case 0x4D: // BIT 1, (IY+d) + case 0x4E: // BIT 1, (IY+d) + case 0x4F: // BIT 1, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x02) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x50: // BIT 2, (IY+d) + case 0x51: // BIT 2, (IY+d) + case 0x52: // BIT 2, (IY+d) + case 0x53: // BIT 2, (IY+d) + case 0x54: // BIT 2, (IY+d) + case 0x55: // BIT 2, (IY+d) + case 0x56: // BIT 2, (IY+d) + case 0x57: // BIT 2, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x04) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x58: // BIT 3, (IY+d) + case 0x59: // BIT 3, (IY+d) + case 0x5A: // BIT 3, (IY+d) + case 0x5B: // BIT 3, (IY+d) + case 0x5C: // BIT 3, (IY+d) + case 0x5D: // BIT 3, (IY+d) + case 0x5E: // BIT 3, (IY+d) + case 0x5F: // BIT 3, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x08) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x60: // BIT 4, (IY+d) + case 0x61: // BIT 4, (IY+d) + case 0x62: // BIT 4, (IY+d) + case 0x63: // BIT 4, (IY+d) + case 0x64: // BIT 4, (IY+d) + case 0x65: // BIT 4, (IY+d) + case 0x66: // BIT 4, (IY+d) + case 0x67: // BIT 4, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x10) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x68: // BIT 5, (IY+d) + case 0x69: // BIT 5, (IY+d) + case 0x6A: // BIT 5, (IY+d) + case 0x6B: // BIT 5, (IY+d) + case 0x6C: // BIT 5, (IY+d) + case 0x6D: // BIT 5, (IY+d) + case 0x6E: // BIT 5, (IY+d) + case 0x6F: // BIT 5, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x20) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x70: // BIT 6, (IY+d) + case 0x71: // BIT 6, (IY+d) + case 0x72: // BIT 6, (IY+d) + case 0x73: // BIT 6, (IY+d) + case 0x74: // BIT 6, (IY+d) + case 0x75: // BIT 6, (IY+d) + case 0x76: // BIT 6, (IY+d) + case 0x77: // BIT 6, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x40) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = false; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x78: // BIT 7, (IY+d) + case 0x79: // BIT 7, (IY+d) + case 0x7A: // BIT 7, (IY+d) + case 0x7B: // BIT 7, (IY+d) + case 0x7C: // BIT 7, (IY+d) + case 0x7D: // BIT 7, (IY+d) + case 0x7E: // BIT 7, (IY+d) + case 0x7F: // BIT 7, (IY+d) + TBOOL = (ReadMemory(RegWZ.Word) & 0x80) == 0; + RegFlagN = false; + RegFlagP = TBOOL; + RegFlag3 = ((RegWZ.Word >> 8) & 0x08) != 0; + RegFlagH = true; + RegFlag5 = ((RegWZ.Word >> 8) & 0x20) != 0; + RegFlagZ = TBOOL; + RegFlagS = !TBOOL; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x80: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x81: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x82: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x83: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x84: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x85: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x86: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x87: // RES 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x01))); + break; + case 0x88: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x89: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x8A: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x8B: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x8C: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x8D: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x8E: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x8F: // RES 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x02))); + break; + case 0x90: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x91: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x92: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x93: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x94: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x95: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x96: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x97: // RES 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x04))); + break; + case 0x98: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x99: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x9A: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x9B: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x9C: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x9D: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x9E: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0x9F: // RES 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x08))); + break; + case 0xA0: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA1: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA2: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA3: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA4: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA5: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA6: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA7: // RES 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x10))); + break; + case 0xA8: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xA9: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xAA: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xAB: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xAC: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xAD: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xAE: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xAF: // RES 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x20))); + break; + case 0xB0: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB1: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB2: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB3: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB4: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB5: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB6: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB7: // RES 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x40))); + break; + case 0xB8: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xB9: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xBA: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xBB: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xBC: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xBD: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xBE: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xBF: // RES 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) & unchecked((byte)~0x80))); + break; + case 0xC0: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC1: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC2: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC3: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC4: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC5: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC6: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC7: // SET 0, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x01))); + break; + case 0xC8: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xC9: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xCA: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xCB: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xCC: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xCD: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xCE: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xCF: // SET 1, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x02))); + break; + case 0xD0: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD1: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD2: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD3: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD4: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD5: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD6: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD7: // SET 2, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x04))); + break; + case 0xD8: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xD9: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xDA: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xDB: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xDC: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xDD: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xDE: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xDF: // SET 3, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x08))); + break; + case 0xE0: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE1: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE2: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE3: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE4: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE5: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE6: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE7: // SET 4, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x10))); + break; + case 0xE8: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xE9: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xEA: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xEB: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xEC: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xED: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xEE: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xEF: // SET 5, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x20))); + break; + case 0xF0: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF1: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF2: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF3: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF4: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF5: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF6: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF7: // SET 6, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x40))); + break; + case 0xF8: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xF9: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xFA: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xFB: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xFC: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xFD: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xFE: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + case 0xFF: // SET 7, (IY+d) + totalExecutedCycles += 23; pendingCycles -= 23; + WriteMemory(RegWZ.Word, (byte)(ReadMemory(RegWZ.Word) | unchecked((byte)0x80))); + break; + } + break; + case 0xCC: // CALL Z, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagZ) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xCD: // CALL nn + totalExecutedCycles += 17; pendingCycles -= 17; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + break; + case 0xCE: // ADC A, n + RegAF.Word = TableALU[1, RegAF.High, ReadMemory(RegPC.Word++), RegFlagC ? 1 : 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xCF: // RST $08 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x08; + break; + case 0xD0: // RET NC + if (!RegFlagC) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xD1: // POP DE + RegDE.Low = ReadMemory(RegSP.Word++); RegDE.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xD2: // JP NC, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagC) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xD3: // OUT n, A + totalExecutedCycles += 11; pendingCycles -= 11; + WriteHardware(ReadMemory(RegPC.Word++), RegAF.High); + break; + case 0xD4: // CALL NC, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagC) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xD5: // PUSH DE + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegDE.High); WriteMemory(--RegSP.Word, RegDE.Low); + break; + case 0xD6: // SUB n + RegAF.Word = TableALU[2, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xD7: // RST $10 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x10; + break; + case 0xD8: // RET C + if (RegFlagC) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xD9: // EXX + TUS = RegBC.Word; RegBC.Word = RegAltBC.Word; RegAltBC.Word = TUS; + TUS = RegDE.Word; RegDE.Word = RegAltDE.Word; RegAltDE.Word = TUS; + TUS = RegHL.Word; RegHL.Word = RegAltHL.Word; RegAltHL.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDA: // JP C, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagC) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xDB: // IN A, n + TUS = (ushort)(ReadOpArg(RegPC.Word++) | (RegAF.High << 8)); + RegAF.High = ReadHardware(TUS); + RegWZ.Word = (ushort)(TUS + 1); + totalExecutedCycles += 11; pendingCycles -= 11; + break; + case 0xDC: // CALL C, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagC) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xDD: // <- + // Invalid sequence. + totalExecutedCycles += 1337; pendingCycles -= 1337; + break; + case 0xDE: // SBC A, n + RegAF.Word = TableALU[3, RegAF.High, ReadMemory(RegPC.Word++), RegFlagC ? 1 : 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xDF: // RST $18 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x18; + break; + case 0xE0: // RET PO + if (!RegFlagP) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xE1: // POP IY + RegIY.Low = ReadMemory(RegSP.Word++); RegIY.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0xE2: // JP PO, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagP) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xE3: // EX (SP), IY + totalExecutedCycles += 23; pendingCycles -= 23; + TUS = RegSP.Word; TBL = ReadMemory(TUS++); TBH = ReadMemory(TUS--); + WriteMemory(TUS++, RegIY.Low); WriteMemory(TUS, RegIY.High); + RegIY.Low = TBL; RegIY.High = TBH; + RegWZ.Word = RegIY.Word; + break; + case 0xE4: // CALL C, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagC) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xE5: // PUSH IY + totalExecutedCycles += 15; pendingCycles -= 15; + WriteMemory(--RegSP.Word, RegIY.High); WriteMemory(--RegSP.Word, RegIY.Low); + break; + case 0xE6: // AND n + RegAF.Word = TableALU[4, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xE7: // RST $20 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x20; + break; + case 0xE8: // RET PE + if (RegFlagP) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xE9: // JP IY + RegPC.Word = RegIY.Word; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0xEA: // JP PE, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagP) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xEB: // EX DE, HL + TUS = RegDE.Word; RegDE.Word = RegHL.Word; RegHL.Word = TUS; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEC: // CALL PE, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagP) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xED: // (Prefix) + ++RegR; + switch (ReadOp(RegPC.Word++)) + { + case 0x00: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x01: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x02: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x03: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x04: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x05: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x06: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x07: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x08: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x09: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x0F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x10: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x11: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x12: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x13: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x14: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x15: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x16: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x17: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x18: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x19: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x1F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x20: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x21: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x22: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x23: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x24: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x25: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x26: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x27: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x28: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x29: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x2F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x30: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x31: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x32: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x33: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x34: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x35: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x36: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x37: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x38: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x39: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x3F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x40: // IN B, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegBC.High = ReadHardware(RegBC.Word); + RegFlagS = RegBC.High > 127; + RegFlagZ = RegBC.High == 0; + RegFlag5 = (RegBC.High & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegBC.High & 0x08) != 0; + RegFlagP = TableParity[RegBC.High]; + RegFlagN = false; + break; + case 0x41: // OUT C, B + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegBC.High); + break; + case 0x42: // SBC HL, BC + TI1 = (short)RegHL.Word; TI2 = (short)RegBC.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((RegHL.Word ^ RegBC.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegBC.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x43: // LD (nn), BC + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(TUS++, RegBC.Low); + WriteMemory(TUS, RegBC.High); + RegWZ.Word = TUS; + break; + case 0x44: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x45: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x46: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x47: // LD I, A + RegI = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x48: // IN C, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegBC.Low = ReadHardware(RegBC.Word); + RegFlagS = RegBC.Low > 127; + RegFlagZ = RegBC.Low == 0; + RegFlag5 = (RegBC.Low & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegBC.Low & 0x08) != 0; + RegFlagP = TableParity[RegBC.Low]; + RegFlagN = false; + break; + case 0x49: // OUT C, C + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegBC.Low); + break; + case 0x4A: // ADC HL, BC + TI1 = (short)RegHL.Word; TI2 = (short)RegBC.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x4B: // LD BC, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegBC.Low = ReadMemory(TUS++); RegBC.High = ReadMemory(TUS); + RegWZ.Word = TUS; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x4C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x4E: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x4F: // LD R, A + RegR = RegAF.High; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x50: // IN D, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegDE.High = ReadHardware(RegBC.Word); + RegFlagS = RegDE.High > 127; + RegFlagZ = RegDE.High == 0; + RegFlag5 = (RegDE.High & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegDE.High & 0x08) != 0; + RegFlagP = TableParity[RegDE.High]; + RegFlagN = false; + break; + case 0x51: // OUT C, D + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegDE.High); + break; + case 0x52: // SBC HL, DE + TI1 = (short)RegHL.Word; TI2 = (short)RegDE.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((RegHL.Word ^ RegDE.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegDE.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x53: // LD (nn), DE + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(TUS++, RegDE.Low); + WriteMemory(TUS, RegDE.High); + RegWZ.Word = TUS; + break; + case 0x54: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x55: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x56: // IM $1 + interruptMode = 1; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x57: // LD A, I + RegAF.High = RegI; + RegFlagS = RegI > 127; + RegFlagZ = RegI == 0; + RegFlag5 = ((RegI & 0x20) != 0); + RegFlagH = false; + RegFlag3 = ((RegI & 0x08) != 0); + RegFlagN = false; + RegFlagP = IFF2; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x58: // IN E, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegDE.Low = ReadHardware(RegBC.Word); + RegFlagS = RegDE.Low > 127; + RegFlagZ = RegDE.Low == 0; + RegFlag5 = (RegDE.Low & 0x20) != 0; + RegFlagH = false; + RegFlag3 = (RegDE.Low & 0x08) != 0; + RegFlagP = TableParity[RegDE.Low]; + RegFlagN = false; + break; + case 0x59: // OUT C, E + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegDE.Low); + break; + case 0x5A: // ADC HL, DE + TI1 = (short)RegHL.Word; TI2 = (short)RegDE.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x5B: // LD DE, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegDE.Low = ReadMemory(TUS++); RegDE.High = ReadMemory(TUS); + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x5C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x5E: // IM $2 + interruptMode = 2; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x5F: // LD A, R + RegAF.High = (byte)((RegR & 0x7F) | RegR2); + RegFlagS = (RegR2 == 0x80); + RegFlagZ = (byte)((RegR & 0x7F) | RegR2) == 0; + RegFlagH = false; + RegFlag5 = ((RegR & 0x20) != 0); + RegFlagN = false; + RegFlag3 = ((RegR & 0x08) != 0); + RegFlagP = IFF2; + totalExecutedCycles += 9; pendingCycles -= 9; + break; + case 0x60: // IN H, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegHL.High = ReadHardware(RegBC.Word); + RegFlagS = RegHL.High > 127; + RegFlagZ = RegHL.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegHL.High]; + RegFlagN = false; + RegFlag3 = (RegHL.High & 0x08) != 0; + RegFlag5 = (RegHL.High & 0x20) != 0; + break; + case 0x61: // OUT C, H + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegHL.High); + break; + case 0x62: // SBC HL, HL + TI1 = (short)RegHL.Word; TI2 = (short)RegHL.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((RegHL.Word ^ RegHL.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegHL.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x63: // LD (nn), HL + totalExecutedCycles += 16; pendingCycles -= 16; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(TUS++, RegHL.Low); + WriteMemory(TUS, RegHL.High); + break; + case 0x64: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x65: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x66: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x67: // RRD + totalExecutedCycles += 18; pendingCycles -= 18; + TB1 = RegAF.High; TB2 = ReadMemory(RegHL.Word); + WriteMemory(RegHL.Word, (byte)((TB2 >> 4) + (TB1 << 4))); + RegAF.High = (byte)((TB1 & 0xF0) + (TB2 & 0x0F)); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + break; + case 0x68: // IN L, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegHL.Low = ReadHardware(RegBC.Word); + RegFlagS = RegHL.Low > 127; + RegFlagZ = RegHL.Low == 0; + RegFlagH = false; + RegFlagP = TableParity[RegHL.Low]; + RegFlagN = false; + RegFlag3 = (RegHL.Low & 0x08) != 0; + RegFlag5 = (RegHL.Low & 0x20) != 0; + break; + case 0x69: // OUT C, L + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegHL.Low); + break; + case 0x6A: // ADC HL, HL + TI1 = (short)RegHL.Word; TI2 = (short)RegHL.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x6B: // LD HL, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegHL.Low = ReadMemory(TUS++); RegHL.High = ReadMemory(TUS); + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0x6C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x6E: // IM $0 + interruptMode = 0; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x6F: // RLD + totalExecutedCycles += 18; pendingCycles -= 18; + TB1 = RegAF.High; TB2 = ReadMemory(RegHL.Word); + WriteMemory(RegHL.Word, (byte)((TB1 & 0x0F) + (TB2 << 4))); + RegAF.High = (byte)((TB1 & 0xF0) + (TB2 >> 4)); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + break; + case 0x70: // IN 0, C + totalExecutedCycles += 12; pendingCycles -= 12; + TB = ReadHardware(RegBC.Word); + RegFlagS = TB > 127; + RegFlagZ = TB == 0; + RegFlagH = false; + RegFlagP = TableParity[TB]; + RegFlagN = false; + RegFlag3 = (TB & 0x08) != 0; + RegFlag5 = (TB & 0x20) != 0; + break; + case 0x71: // OUT C, 0 + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, 0); + break; + case 0x72: // SBC HL, SP + TI1 = (short)RegHL.Word; TI2 = (short)RegSP.Word; TIR = TI1 - TI2; + if (RegFlagC) { --TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((RegHL.Word ^ RegSP.Word ^ TUS) & 0x1000) != 0; + RegFlagN = true; + RegFlagC = (((int)RegHL.Word - (int)RegSP.Word - (RegFlagC ? 1 : 0)) & 0x10000) != 0; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x73: // LD (nn), SP + totalExecutedCycles += 20; pendingCycles -= 20; + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + WriteMemory(TUS++, RegSP.Low); + WriteMemory(TUS, RegSP.High); + RegWZ.Word = TUS; + break; + case 0x74: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x75: // RETN + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + IFF1 = IFF2; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x76: // IM $1 + interruptMode = 1; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x77: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x78: // IN A, C + totalExecutedCycles += 12; pendingCycles -= 12; + RegAF.High = ReadHardware(RegBC.Word); + RegFlagS = RegAF.High > 127; + RegFlagZ = RegAF.High == 0; + RegFlagH = false; + RegFlagP = TableParity[RegAF.High]; + RegFlagN = false; + RegFlag3 = (RegAF.High & 0x08) != 0; + RegFlag5 = (RegAF.High & 0x20) != 0; + RegWZ.Word = (ushort)(RegBC.Word + 1); + break; + case 0x79: // OUT C, A + totalExecutedCycles += 12; pendingCycles -= 12; + WriteHardware(RegBC.Low, RegAF.High); + RegWZ.Word = (ushort)(RegBC.Word + 1); + break; + case 0x7A: // ADC HL, SP + TI1 = (short)RegHL.Word; TI2 = (short)RegSP.Word; TIR = TI1 + TI2; + if (RegFlagC) { ++TIR; ++TI2; } + TUS = (ushort)TIR; + RegWZ.Word = (ushort)(RegHL.Word + 1); + RegFlagH = ((TI1 & 0xFFF) + (TI2 & 0xFFF)) > 0xFFF; + RegFlagN = false; + RegFlagC = ((ushort)TI1 + (ushort)TI2) > 0xFFFF; + RegFlagP = TIR > 32767 || TIR < -32768; + RegFlagS = TUS > 32767; + RegFlagZ = TUS == 0; + RegHL.Word = TUS; + RegFlag3 = (TUS & 0x0800) != 0; + RegFlag5 = (TUS & 0x2000) != 0; + totalExecutedCycles += 15; pendingCycles -= 15; + break; + case 0x7B: // LD SP, (nn) + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + RegSP.Low = ReadMemory(TUS++); RegSP.High = ReadMemory(TUS); + RegWZ.Word = TUS; + totalExecutedCycles += 20; pendingCycles -= 20; + break; + case 0x7C: // NEG + RegAF.Word = TableNeg[RegAF.Word]; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7D: // RETI + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + RegWZ.Word = RegPC.Word; + totalExecutedCycles += 14; pendingCycles -= 14; + break; + case 0x7E: // IM $2 + interruptMode = 2; + totalExecutedCycles += 8; pendingCycles -= 8; + break; + case 0x7F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x80: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x81: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x82: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x83: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x84: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x85: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x86: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x87: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x88: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x89: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x8F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x90: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x91: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x92: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x93: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x94: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x95: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x96: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x97: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x98: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x99: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9A: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9B: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9C: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9D: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9E: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0x9F: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA0: // LDI + totalExecutedCycles += 16; pendingCycles -= 16; + WriteMemory(RegDE.Word++, TB1 = ReadMemory(RegHL.Word++)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + break; + case 0xA1: // CPI + TB1 = ReadMemory(RegHL.Word++); TB2 = (byte)(RegAF.High - TB1); + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0xA2: // INI + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word + 1); + --RegBC.High; + WriteMemory(RegHL.Word++, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low + 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xA3: // OUTI + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word++); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word + 1); + WriteHardware(RegBC.Word, TB); + RegFlagC = false; + RegFlagN = false; + RegFlag3 = IsX(RegBC.High); + RegFlagH = false; + RegFlag5 = IsY(RegBC.High); + RegFlagZ = RegBC.High == 0; + RegFlagS = IsS(RegBC.High); + TUS = (ushort)(RegHL.Low + TB); + if (IsS(TB)) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagC = true; + RegFlagH = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xA4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xA8: // LDD + totalExecutedCycles += 16; pendingCycles -= 16; + WriteMemory(RegDE.Word--, TB1 = ReadMemory(RegHL.Word--)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + break; + case 0xA9: // CPD + TB1 = ReadMemory(RegHL.Word--); TB2 = (byte)(RegAF.High - TB1); + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + totalExecutedCycles += 16; pendingCycles -= 16; + break; + case 0xAA: // IND + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word - 1); + --RegBC.High; + WriteMemory(RegHL.Word--, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low - 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xAB: // OUTD + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word--); + WriteHardware(RegBC.Word, TB); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word - 1); + TUS = (ushort)(RegHL.Low + TB); + RegFlagZ = RegBC.High == 0; + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + break; + case 0xAC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xAF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB0: // LDIR + WriteMemory(RegDE.Word++, TB1 = ReadMemory(RegHL.Word++)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + if (RegBC.Word != 0) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB1: // CPIR + TB1 = ReadMemory(RegHL.Word++); TB2 = (byte)(RegAF.High - TB1); + RegWZ.Word++; + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + if (RegBC.Word != 0 && !RegFlagZ) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB2: // INIR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word + 1); + --RegBC.High; + WriteMemory(RegHL.Word++, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low + 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xB3: // OTIR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word++); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word + 1); + WriteHardware(RegBC.Word, TB); + RegFlagC = false; + RegFlagN = false; + RegFlag3 = IsX(RegBC.High); + RegFlagH = false; + RegFlag5 = IsY(RegBC.High); + RegFlagZ = RegBC.High == 0; + RegFlagS = IsS(RegBC.High); + TUS = (ushort)(RegHL.Low + TB); + if (IsS(TB)) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagC = true; + RegFlagH = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xB4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xB8: // LDDR + WriteMemory(RegDE.Word--, TB1 = ReadMemory(RegHL.Word--)); + TB1 += RegAF.High; RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + RegFlagH = false; + RegFlagN = false; + if (RegBC.Word != 0) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xB9: // CPDR + TB1 = ReadMemory(RegHL.Word--); TB2 = (byte)(RegAF.High - TB1); + RegWZ.Word--; + RegFlagN = true; + RegFlagH = TableHalfBorrow[RegAF.High, TB1]; + RegFlagZ = TB2 == 0; + RegFlagS = TB2 > 127; + TB1 = (byte)(RegAF.High - TB1 - (RegFlagH ? 1 : 0)); RegFlag5 = (TB1 & 0x02) != 0; RegFlag3 = (TB1 & 0x08) != 0; + --RegBC.Word; + RegFlagP = RegBC.Word != 0; + if (RegBC.Word != 0 && !RegFlagZ) + { + RegPC.Word -= 2; + RegWZ.Word = (ushort)(RegPC.Word + 1); + totalExecutedCycles += 21; pendingCycles -= 21; + } + else + { + totalExecutedCycles += 16; pendingCycles -= 16; + } + break; + case 0xBA: // INDR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadHardware(RegBC.Word); + RegWZ.Word = (ushort)(RegBC.Word - 1); + --RegBC.High; + WriteMemory(RegHL.Word--, TB); + RegFlagZ = RegBC.High == 0; + TUS = (ushort)(((RegBC.Low - 1) & 0xff) + TB); + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xBB: // OTDR + totalExecutedCycles += 16; pendingCycles -= 16; + TB = ReadMemory(RegHL.Word--); + WriteHardware(RegBC.Word, TB); + --RegBC.High; + RegWZ.Word = (ushort)(RegBC.Word - 1); + TUS = (ushort)(RegHL.Low + TB); + RegFlagZ = RegBC.High == 0; + if ((TB & 0x80) != 0) + { + RegFlagN = true; + } + if ((TUS & 0x100) != 0) + { + RegFlagH = RegFlagC = true; + } + RegFlagP = TableParity[(TUS & 0x07) ^ RegBC.High]; + if (RegBC.High != 0) + { + RegPC.Word -= 2; + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xBC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xBF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xC9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xCF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xD9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xDF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xE9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xED: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xEF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF0: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF1: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF2: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF3: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF4: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF5: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF6: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF7: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF8: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF9: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFA: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFB: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFC: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFD: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFE: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFF: // NOP + totalExecutedCycles += 4; pendingCycles -= 4; + break; + } + break; + case 0xEE: // XOR n + RegAF.Word = TableALU[5, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xEF: // RST $28 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x28; + break; + case 0xF0: // RET P + if (!RegFlagS) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xF1: // POP AF + RegAF.Low = ReadMemory(RegSP.Word++); RegAF.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xF2: // JP P, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagS) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xF3: // DI + IFF1 = IFF2 = false; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xF4: // CALL P, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (!RegFlagS) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xF5: // PUSH AF + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegAF.High); WriteMemory(--RegSP.Word, RegAF.Low); + break; + case 0xF6: // OR n + RegAF.Word = TableALU[6, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xF7: // RST $30 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x30; + break; + case 0xF8: // RET M + if (RegFlagS) + { + RegPC.Low = ReadMemory(RegSP.Word++); RegPC.High = ReadMemory(RegSP.Word++); + totalExecutedCycles += 11; pendingCycles -= 11; + } + else + { + totalExecutedCycles += 5; pendingCycles -= 5; + } + break; + case 0xF9: // LD SP, IY + RegSP.Word = RegIY.Word; + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xFA: // JP M, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagS) + { + RegPC.Word = TUS; + } + totalExecutedCycles += 10; pendingCycles -= 10; + break; + case 0xFB: // EI + IFF1 = IFF2 = true; + Interruptable = false; + totalExecutedCycles += 4; pendingCycles -= 4; + break; + case 0xFC: // CALL M, nn + TUS = (ushort)(ReadMemory(RegPC.Word++) + ReadMemory(RegPC.Word++) * 256); + if (RegFlagS) + { + totalExecutedCycles += 17; pendingCycles -= 17; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = TUS; + } + else + { + totalExecutedCycles += 10; pendingCycles -= 10; + } + break; + case 0xFD: // <- + // Invalid sequence. + totalExecutedCycles += 1337; pendingCycles -= 1337; + break; + case 0xFE: // CP n + RegAF.Word = TableALU[7, RegAF.High, ReadMemory(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xFF: // RST $38 + totalExecutedCycles += 11; pendingCycles -= 11; + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x38; + break; + } + break; + case 0xFE: // CP n + RegAF.Word = TableALU[7, RegAF.High, ReadOpArg(RegPC.Word++), 0]; + totalExecutedCycles += 7; pendingCycles -= 7; + break; + case 0xFF: // RST $38 + WriteMemory(--RegSP.Word, RegPC.High); WriteMemory(--RegSP.Word, RegPC.Low); + RegPC.Word = 0x38; + totalExecutedCycles += 11; pendingCycles -= 11; + break; + } + } + } + while (pendingCycles > 0); + return cycles - pendingCycles; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Execute.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Execute.cs.meta new file mode 100644 index 00000000..1808acb9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Execute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c09602ef08e6484da16a66054f9fcbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Interrupts.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Interrupts.cs new file mode 100644 index 00000000..574ccec4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Interrupts.cs @@ -0,0 +1,54 @@ +using System; + +namespace cpu.z80 +{ + public partial class Z80A + { + private bool iff1; + public bool IFF1 { get { return iff1; } set { iff1 = value; } } + + private bool iff2; + public bool IFF2 { get { return iff2; } set { iff2 = value; } } + + private bool interrupt; + public bool Interrupt { get { return interrupt; } set { interrupt = value; } } + + private bool nonMaskableInterrupt; + public bool NonMaskableInterrupt + { + get { return nonMaskableInterrupt; } + set { if (value && !nonMaskableInterrupt) NonMaskableInterruptPending = true; nonMaskableInterrupt = value; } + } + + private bool nonMaskableInterruptPending; + public bool NonMaskableInterruptPending { get { return nonMaskableInterruptPending; } set { nonMaskableInterruptPending = value; } } + + private int interruptMode; + public int InterruptMode + { + get { return interruptMode; } + set { if (value < 0 || value > 2) throw new ArgumentOutOfRangeException(); interruptMode = value; } + } + + private bool halted; + public bool Halted { get { return halted; } set { halted = value; } } + + public Func IRQCallback = delegate () { return 0; }; + public Action NMICallback = delegate () { }; + + private void ResetInterrupts() + { + Interrupt = false; + NonMaskableInterrupt = false; + NonMaskableInterruptPending = false; + Interruptable = true; + IFF1 = IFF2 = false; + } + + private void Halt() + { + RegPC.Word--; + Halted = true; + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Interrupts.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Interrupts.cs.meta new file mode 100644 index 00000000..70ed1b83 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Interrupts.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c96c195554ad5940b560fc6284134f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Registers.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Registers.cs new file mode 100644 index 00000000..be1cdac7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Registers.cs @@ -0,0 +1,254 @@ +using System; +using System.Runtime.InteropServices; + +namespace cpu.z80 +{ + public partial class Z80A + { + [StructLayout(LayoutKind.Explicit)] + [Serializable()] + public struct RegisterPair + { + [FieldOffset(0)] + public ushort Word; + + [FieldOffset(0)] + public byte Low; + + [FieldOffset(1)] + public byte High; + + public RegisterPair(ushort value) + { + Word = value; + Low = (byte)(Word); + High = (byte)(Word >> 8); + } + + public static implicit operator ushort(RegisterPair rp) + { + return rp.Word; + } + + public static implicit operator RegisterPair(ushort value) + { + return new RegisterPair(value); + } + } + public ushort PC + { + get + { + return RegPC.Word; + } + } + + private bool RegFlagC + { + get { return (RegAF.Low & 0x01) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x01) | (value ? 0x01 : 0x00)); } + } + + private bool RegFlagN + { + get { return (RegAF.Low & 0x02) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x02) | (value ? 0x02 : 0x00)); } + } + + private bool RegFlagP + { + get { return (RegAF.Low & 0x04) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x04) | (value ? 0x04 : 0x00)); } + } + + private bool RegFlag3 + { + get { return (RegAF.Low & 0x08) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x08) | (value ? 0x08 : 0x00)); } + } + + private bool RegFlagH + { + get { return (RegAF.Low & 0x10) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x10) | (value ? 0x10 : 0x00)); } + } + + private bool RegFlag5 + { + get { return (RegAF.Low & 0x20) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x20) | (value ? 0x20 : 0x00)); } + } + + private bool RegFlagZ + { + get { return (RegAF.Low & 0x40) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x40) | (value ? 0x40 : 0x00)); } + } + + private bool RegFlagS + { + get { return (RegAF.Low & 0x80) != 0; } + set { RegAF.Low = (byte)((RegAF.Low & ~0x80) | (value ? 0x80 : 0x00)); } + } + + private RegisterPair RegAF; + private RegisterPair RegBC; + private RegisterPair RegDE; + private RegisterPair RegHL; + + private RegisterPair RegAltAF; // Shadow for A and F + private RegisterPair RegAltBC; // Shadow for B and C + private RegisterPair RegAltDE; // Shadow for D and E + private RegisterPair RegAltHL; // Shadow for H and L + + private byte RegI; // I (interrupt vector) + private byte RegR; // R (memory refresh) + + private byte RegR2; + + private RegisterPair RegIX; // IX (index register x) + private RegisterPair RegIY; // IY (index register y) + private RegisterPair RegWZ; // WZ + + private RegisterPair RegSP; // SP (stack pointer) + private RegisterPair RegPC; // PC (program counter) + + private void ResetRegisters() + { + RegI = 0; RegR = 0; RegR2 = 0; + RegPC.Word = 0; + RegWZ.Word = 0; + } + + public byte RegisterA + { + get { return RegAF.High; } + set { RegAF.High = value; } + } + + public byte RegisterF + { + get { return RegAF.Low; } + set { RegAF.Low = value; } + } + + public ushort RegisterAF + { + get { return RegAF.Word; } + set { RegAF.Word = value; } + } + + public byte RegisterB + { + get { return RegBC.High; } + set { RegBC.High = value; } + } + + public byte RegisterC + { + get { return RegBC.Low; } + set { RegBC.Low = value; } + } + + public ushort RegisterBC + { + get { return RegBC.Word; } + set { RegBC.Word = value; } + } + + public byte RegisterD + { + get { return RegDE.High; } + set { RegDE.High = value; } + } + + public byte RegisterE + { + get { return RegDE.Low; } + set { RegDE.Low = value; } + } + public ushort RegisterDE + { + get { return RegDE.Word; } + set { RegDE.Word = value; } + } + + public byte RegisterH + { + get { return RegHL.High; } + set { RegHL.High = value; } + } + + public byte RegisterL + { + get { return RegHL.Low; } + set { RegHL.Low = value; } + } + public ushort RegisterHL + { + get { return RegHL.Word; } + set { RegHL.Word = value; } + } + + public ushort RegisterPC + { + get { return RegPC.Word; } + set { RegPC.Word = value; } + } + public ushort RegisterSP + { + get { return RegSP.Word; } + set { RegSP.Word = value; } + } + public ushort RegisterIX + { + get { return RegIX.Word; } + set { RegIX.Word = value; } + } + public ushort RegisterIY + { + get { return RegIY.Word; } + set { RegIY.Word = value; } + } + public ushort RegisterWZ + { + get { return RegWZ.Word; } + set { RegWZ.Word = value; } + } + public byte RegisterI + { + get { return RegI; } + set { RegI = value; } + } + public byte RegisterR + { + get { return RegR; } + set { RegR = value; } + } + public byte RegisterR2 + { + get { return RegR2; } + set { RegR2 = value; } + } + public ushort RegisterShadowAF + { + get { return RegAltAF.Word; } + set { RegAltAF.Word = value; } + } + public ushort RegisterShadowBC + { + get { return RegAltBC.Word; } + set { RegAltBC.Word = value; } + } + public ushort RegisterShadowDE + { + get { return RegAltDE.Word; } + set { RegAltDE.Word = value; } + } + public ushort RegisterShadowHL + { + get { return RegAltHL.Word; } + set { RegAltHL.Word = value; } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Registers.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Registers.cs.meta new file mode 100644 index 00000000..cee31ca5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Registers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 63e5e1ff77e9301458ec650c273796e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Tables.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Tables.cs new file mode 100644 index 00000000..4c57195b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Tables.cs @@ -0,0 +1,445 @@ +namespace cpu.z80 +{ + public partial class Z80A + { + private void InitialiseTables() + { + InitTableInc(); + InitTableDec(); + InitTableParity(); + InitTableALU(); + InitTableRotShift(); + InitTableHalfBorrow(); + InitTableHalfCarry(); + InitTableNeg(); + InitTableDaa(); + InitTableCc(); + } + + private byte[] TableInc; + private void InitTableInc() + { + TableInc = new byte[256]; + for (int i = 0; i < 256; ++i) + TableInc[i] = FlagByte(false, false, i == 0x80, UndocumentedX(i), (i & 0xF) == 0x0, UndocumentedY(i), i == 0, i > 127); + } + + private byte[] TableDec; + private void InitTableDec() + { + TableDec = new byte[256]; + for (int i = 0; i < 256; ++i) + TableDec[i] = FlagByte(false, true, i == 0x7F, UndocumentedX(i), (i & 0xF) == 0xF, UndocumentedY(i), i == 0, i > 127); + } + + private bool[] TableParity; + private void InitTableParity() + { + TableParity = new bool[256]; + for (int i = 0; i < 256; ++i) + { + int Bits = 0; + for (int j = 0; j < 8; ++j) + { + Bits += (i >> j) & 1; + } + TableParity[i] = (Bits & 1) == 0; + } + } + + private ushort[,,,] TableALU; + private void InitTableALU() + { + TableALU = new ushort[8, 256, 256, 2]; // Class, OP1, OP2, Carry + + for (int i = 0; i < 8; ++i) + { + for (int op1 = 0; op1 < 256; ++op1) + { + for (int op2 = 0; op2 < 256; ++op2) + { + for (int c = 0; c < 2; ++c) + { + + int ac = (i == 1 || i == 3) ? c : 0; + + bool S = false; + bool Z = false; + bool C = false; + bool H = false; + bool N = false; + bool P = false; + + byte result_b = 0; + int result_si = 0; + int result_ui = 0; + + // Fetch result + switch (i) + { + case 0: + case 1: + result_si = (sbyte)op1 + (sbyte)op2 + ac; + result_ui = op1 + op2 + ac; + break; + case 2: + case 3: + case 7: + result_si = (sbyte)op1 - (sbyte)op2 - ac; + result_ui = op1 - op2 - ac; + break; + case 4: + result_si = op1 & op2; + break; + case 5: + result_si = op1 ^ op2; + break; + case 6: + result_si = op1 | op2; + break; + } + + result_b = (byte)result_si; + + // Parity/Carry + + switch (i) + { + case 0: + case 1: + case 2: + case 3: + case 7: + P = result_si < -128 || result_si > 127; + C = result_ui < 0 || result_ui > 255; + break; + case 4: + case 5: + case 6: + P = TableParity[result_b]; + C = false; + break; + } + + // Subtraction + N = i == 2 || i == 3 || i == 7; + + // Half carry + switch (i) + { + case 0: + case 1: + H = ((op1 & 0xF) + (op2 & 0xF) + (ac & 0xF)) > 0xF; + break; + case 2: + case 3: + case 7: + H = ((op1 & 0xF) - (op2 & 0xF) - (ac & 0xF)) < 0x0; + break; + case 4: + H = true; + break; + case 5: + case 6: + H = false; + break; + } + + // Undocumented + byte UndocumentedFlags = (byte)(result_b & 0x28); + if (i == 7) UndocumentedFlags = (byte)(op2 & 0x28); + + S = result_b > 127; + Z = result_b == 0; + + if (i == 7) result_b = (byte)op1; + + TableALU[i, op1, op2, c] = (ushort)( + result_b * 256 + + ((C ? 0x01 : 0) + (N ? 0x02 : 0) + (P ? 0x04 : 0) + (H ? 0x10 : 0) + (Z ? 0x40 : 0) + (S ? 0x80 : 0)) + + (UndocumentedFlags)); + + } + } + } + } + } + + private bool[,] TableHalfBorrow; + private void InitTableHalfBorrow() + { + TableHalfBorrow = new bool[256, 256]; + for (int i = 0; i < 256; i++) + { + for (int j = 0; j < 256; j++) + { + TableHalfBorrow[i, j] = ((i & 0xF) - (j & 0xF)) < 0; + } + } + } + + private bool[,] TableHalfCarry; + private void InitTableHalfCarry() + { + TableHalfCarry = new bool[256, 256]; + for (int i = 0; i < 256; i++) + { + for (int j = 0; j < 256; j++) + { + TableHalfCarry[i, j] = ((i & 0xF) + (j & 0xF)) > 0xF; + } + } + } + + private ushort[,,] TableRotShift; + private void InitTableRotShift() + { + TableRotShift = new ushort[2, 8, 65536]; // All, operation, AF + for (int all = 0; all < 2; all++) + { + for (int y = 0; y < 8; ++y) + { + for (int af = 0; af < 65536; af++) + { + byte Old = (byte)(af >> 8); + bool OldCarry = (af & 0x01) != 0; + + ushort newAf = (ushort)(af & ~(0x13)); // Clear HALF-CARRY, SUBTRACT and CARRY flags + + byte New = Old; + if ((y & 1) == 0) + { + if ((Old & 0x80) != 0) ++newAf; + + New <<= 1; + + if ((y & 0x04) == 0) + { + if (((y & 0x02) == 0) ? ((newAf & 0x01) != 0) : OldCarry) New |= 0x01; + } + else + { + if ((y & 0x02) != 0) New |= 0x01; + } + + } + else + { + + if ((Old & 0x01) != 0) ++newAf; + + New >>= 1; + + if ((y & 0x04) == 0) + { + if (((y & 0x02) == 0) ? ((newAf & 0x01) != 0) : OldCarry) New |= 0x80; + } + else + { + if ((y & 0x02) == 0) New |= (byte)(Old & 0x80); + } + } + + newAf &= 0xFF; + newAf |= (ushort)(New * 256); + + if (all == 1) + { + newAf &= unchecked((ushort)~0xC4); // Clear S, Z, P + if (New > 127) newAf |= 0x80; + if (New == 0) newAf |= 0x40; + if (TableParity[New]) newAf |= 0x04; + } + + TableRotShift[all, y, af] = (ushort)((newAf & ~0x28) | ((newAf >> 8) & 0x28)); + } + } + } + } + + private ushort[] TableNeg; + private void InitTableNeg() + { + TableNeg = new ushort[65536]; + for (int af = 0; af < 65536; af++) + { + ushort raf = 0; + byte b = (byte)(af >> 8); + byte a = (byte)-b; + raf |= (ushort)(a * 256); + raf |= FlagByte(b != 0x00, true, b == 0x80, UndocumentedX(a), TableHalfCarry[a, b], UndocumentedY(a), a == 0, a > 127); + TableNeg[af] = raf; + } + } + + private ushort[] TableDaa; + private void InitTableDaa() + { + TableDaa = new ushort[65536]; + for (int af = 0; af < 65536; ++af) + { + byte a = (byte)(af >> 8); + byte tmp = a; + + if (IsN(af)) + { + if (IsH(af) || ((a & 0x0F) > 0x09)) tmp -= 0x06; + if (IsC(af) || a > 0x99) tmp -= 0x60; + } + else + { + if (IsH(af) || ((a & 0x0F) > 0x09)) tmp += 0x06; + if (IsC(af) || a > 0x99) tmp += 0x60; + } + + TableDaa[af] = (ushort)((tmp * 256) + FlagByte(IsC(af) || a > 0x99, IsN(af), TableParity[tmp], UndocumentedX(tmp), ((a ^ tmp) & 0x10) != 0, UndocumentedY(tmp), tmp == 0, tmp > 127)); + } + } + + private int[] cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex; + private void InitTableCc() + { + cc_op = new int[0x100]{ + 4,10, 7, 6, 4, 4, 7, 4, 4,11, 7, 6, 4, 4, 7, 4, + 8,10, 7, 6, 4, 4, 7, 4,12,11, 7, 6, 4, 4, 7, 4, + 7,10,16, 6, 4, 4, 7, 4, 7,11,16, 6, 4, 4, 7, 4, + 7,10,13, 6,11,11,10, 4, 7,11,13, 6, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 7, 7, 7, 7, 7, 7, 4, 7, 4, 4, 4, 4, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 5,10,10,10,10,11, 7,11, 5,10,10, 0,10,17, 7,11, + 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 0, 7,11, + 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 0, 7,11, + 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11 + }; + cc_cb = new int[0x100]{ + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8 + }; + cc_ed = new int[0x100]{ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 12,12,15,20, 8,14, 8, 9,12,12,15,20, 8,14, 8, 9, + 12,12,15,20, 8,14, 8, 9,12,12,15,20, 8,14, 8, 9, + 12,12,15,20, 8,14, 8,18,12,12,15,20, 8,14, 8,18, + 12,12,15,20, 8,14, 8, 8,12,12,15,20, 8,14, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 16,16,16,16, 8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, + 16,16,16,16, 8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 + }; + cc_xy = new int[0x100]{ + 4, 4, 4, 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, + 4,14,20,10, 9, 9, 9, 4, 4,15,20,10, 9, 9, 9, 4, + 4, 4, 4, 4,23,23,19, 4, 4,15, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 9, 9, 9, 9, 9, 9,19, 9, 9, 9, 9, 9, 9, 9,19, 9, + 19,19,19,19,19,19, 4,19, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4,14, 4,23, 4,15, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4 + }; + cc_xycb = new int[0x100]{ + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 + }; + cc_ex = new int[0x100]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2 + }; + } + + private byte FlagByte(bool C, bool N, bool P, bool X, bool H, bool Y, bool Z, bool S) + { + return (byte)( + (C ? 0x01 : 0) + + (N ? 0x02 : 0) + + (P ? 0x04 : 0) + + (X ? 0x08 : 0) + + (H ? 0x10 : 0) + + (Y ? 0x20 : 0) + + (Z ? 0x40 : 0) + + (S ? 0x80 : 0) + ); + } + + private bool UndocumentedX(int value) + { + return (value & 0x08) != 0; + } + + private bool UndocumentedY(int value) + { + return (value & 0x20) != 0; + } + + private bool IsC(int value) { return (value & 0x01) != 0; } + private bool IsN(int value) { return (value & 0x02) != 0; } + private bool IsP(int value) { return (value & 0x04) != 0; } + private bool IsX(int value) { return (value & 0x08) != 0; } + private bool IsH(int value) { return (value & 0x10) != 0; } + private bool IsY(int value) { return (value & 0x20) != 0; } + private bool IsZ(int value) { return (value & 0x40) != 0; } + private bool IsS(int value) { return (value & 0x80) != 0; } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Tables.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Tables.cs.meta new file mode 100644 index 00000000..8e8c40b0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Tables.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8aa162d7c8690a46b4dd0f9c6cf5eaa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Z80A.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Z80A.cs new file mode 100644 index 00000000..46712aa9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Z80A.cs @@ -0,0 +1,283 @@ +using MAME.Core; +using System; +using System.Globalization; +using System.IO; + +// This Z80 emulator is a modified version of Ben Ryves 'Brazil' emulator. +// It is MIT licensed. + +namespace cpu.z80 +{ + /// + /// ZiLOG Z80A CPU Emulator + /// + public sealed partial class Z80A : cpuexec_data + { + public static Z80A[] zz1; + public static int nZ80; + private bool Interruptable; + private ulong totalExecutedCycles; + private int pendingCycles; + public override ulong TotalExecutedCycles + { + get + { + return totalExecutedCycles; + } + set + { + totalExecutedCycles = value; + } + } + public override int PendingCycles + { + get + { + return pendingCycles; + } + set + { + pendingCycles = value; + } + } + /// + /// Creates an instance of the emulator class. + /// + public Z80A() + { + InitialiseTables(); + // Clear main registers + PPC = 0; + RegAF = 0x0040; RegBC = 0; RegDE = 0; RegHL = 0; + // Clear alternate registers + RegAltAF = 0; RegAltBC = 0; RegAltDE = 0; RegAltHL = 0; + // Clear special purpose registers + RegI = 0; RegR = 0; RegR2 = 0; + RegIX.Word = 0xffff; RegIY.Word = 0xffff; + RegSP.Word = 0; RegPC.Word = 0; + RegWZ.Word = 0; + IFF1 = IFF2 = false; + Halted = false; + InterruptMode = 0; + } + + /// + /// Reset the Z80 to its initial state + /// + public override void Reset() + { + ResetRegisters(); + ResetInterrupts(); + } + + public override void set_irq_line(int irqline, LineState state) + { + if (irqline == (int)LineState.INPUT_LINE_NMI) + { + if (NonMaskableInterrupt == false && state != LineState.CLEAR_LINE) + nonMaskableInterruptPending = true; + NonMaskableInterrupt = (state != LineState.CLEAR_LINE); + } + else + { + Interrupt = (state != LineState.CLEAR_LINE); + } + } + public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) + { + Atime time1; + time1 = EmuTimer.get_current_time(); + bool b1 = false; + foreach (irq irq1 in Cpuint.lirq) + { + if (irq1.cpunum == cpunum && irq1.line == line) + { + if (Attotime.attotime_compare(irq1.time, time1) > 0) + { + b1 = true; + break; + } + else + { + int i1 = 1; + } + } + } + if (b1) + { + int i1 = 1; + } + else + { + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + } + + // Memory Access + + public Func ReadOp, ReadOpArg; + public Func ReadMemory; + public Action WriteMemory; + + + public void UnregisterMemoryMapper() + { + ReadMemory = null; + WriteMemory = null; + } + + // Hardware I/O Port Access + + public Func ReadHardware; + public Action WriteHardware; + + // State Save/Load + + public void SaveStateBinary(BinaryWriter writer) + { + writer.Write(PPC); + writer.Write(RegisterAF); + writer.Write(RegisterBC); + writer.Write(RegisterDE); + writer.Write(RegisterHL); + writer.Write(RegisterShadowAF); + writer.Write(RegisterShadowBC); + writer.Write(RegisterShadowDE); + writer.Write(RegisterShadowHL); + writer.Write(RegisterIX); + writer.Write(RegisterIY); + writer.Write(RegisterSP); + writer.Write(RegisterPC); + writer.Write(RegisterWZ); + writer.Write(RegisterI); + writer.Write(RegisterR); + writer.Write(RegisterR2); + writer.Write(Interrupt); + writer.Write(NonMaskableInterrupt); + writer.Write(NonMaskableInterruptPending); + writer.Write(InterruptMode); + writer.Write(IFF1); + writer.Write(IFF2); + writer.Write(Halted); + writer.Write(TotalExecutedCycles); + writer.Write(PendingCycles); + } + public void LoadStateBinary(BinaryReader reader) + { + PPC = reader.ReadUInt16(); + RegisterAF = reader.ReadUInt16(); + RegisterBC = reader.ReadUInt16(); + RegisterDE = reader.ReadUInt16(); + RegisterHL = reader.ReadUInt16(); + RegisterShadowAF = reader.ReadUInt16(); + RegisterShadowBC = reader.ReadUInt16(); + RegisterShadowDE = reader.ReadUInt16(); + RegisterShadowHL = reader.ReadUInt16(); + RegisterIX = reader.ReadUInt16(); + RegisterIY = reader.ReadUInt16(); + RegisterSP = reader.ReadUInt16(); + RegisterPC = reader.ReadUInt16(); + RegisterWZ = reader.ReadUInt16(); + RegisterI = reader.ReadByte(); + RegisterR = reader.ReadByte(); + RegisterR2 = reader.ReadByte(); + Interrupt = reader.ReadBoolean(); + NonMaskableInterrupt = reader.ReadBoolean(); + NonMaskableInterruptPending = reader.ReadBoolean(); + InterruptMode = reader.ReadInt32(); + IFF1 = reader.ReadBoolean(); + IFF2 = reader.ReadBoolean(); + Halted = reader.ReadBoolean(); + TotalExecutedCycles = reader.ReadUInt64(); + PendingCycles = reader.ReadInt32(); + } + public void SaveStateText(TextWriter writer) + { + writer.WriteLine("[Z80]"); + writer.WriteLine("AF {0:X4}", RegAF.Word); + writer.WriteLine("BC {0:X4}", RegBC.Word); + writer.WriteLine("DE {0:X4}", RegDE.Word); + writer.WriteLine("HL {0:X4}", RegHL.Word); + writer.WriteLine("ShadowAF {0:X4}", RegAltAF.Word); + writer.WriteLine("ShadowBC {0:X4}", RegAltBC.Word); + writer.WriteLine("ShadowDE {0:X4}", RegAltDE.Word); + writer.WriteLine("ShadowHL {0:X4}", RegAltHL.Word); + writer.WriteLine("I {0:X2}", RegI); + writer.WriteLine("R {0:X2}", RegR); + writer.WriteLine("IX {0:X4}", RegIX.Word); + writer.WriteLine("IY {0:X4}", RegIY.Word); + writer.WriteLine("SP {0:X4}", RegSP.Word); + writer.WriteLine("PC {0:X4}", RegPC.Word); + writer.WriteLine("IRQ {0}", interrupt); + writer.WriteLine("NMI {0}", nonMaskableInterrupt); + writer.WriteLine("NMIPending {0}", nonMaskableInterruptPending); + writer.WriteLine("IM {0}", InterruptMode); + writer.WriteLine("IFF1 {0}", IFF1); + writer.WriteLine("IFF2 {0}", IFF2); + writer.WriteLine("Halted {0}", Halted); + writer.WriteLine("ExecutedCycles {0}", totalExecutedCycles); + writer.WriteLine("PendingCycles {0}", pendingCycles); + writer.WriteLine("[/Z80]"); + writer.WriteLine(); + } + + public void LoadStateText(TextReader reader) + { + while (true) + { + string[] args = reader.ReadLine().Split(' '); + if (args[0].Trim() == "") continue; + if (args[0] == "[/Z80]") break; + if (args[0] == "AF") + RegAF.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "BC") + RegBC.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "DE") + RegDE.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "HL") + RegHL.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "ShadowAF") + RegAltAF.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "ShadowBC") + RegAltBC.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "ShadowDE") + RegAltDE.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "ShadowHL") + RegAltHL.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "I") + RegI = byte.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "R") + RegR = byte.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "IX") + RegIX.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "IY") + RegIY.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "SP") + RegSP.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "PC") + RegPC.Word = ushort.Parse(args[1], NumberStyles.HexNumber); + else if (args[0] == "IRQ") + interrupt = bool.Parse(args[1]); + else if (args[0] == "NMI") + nonMaskableInterrupt = bool.Parse(args[1]); + else if (args[0] == "NMIPending") + nonMaskableInterruptPending = bool.Parse(args[1]); + else if (args[0] == "IM") + InterruptMode = int.Parse(args[1]); + else if (args[0] == "IFF1") + IFF1 = bool.Parse(args[1]); + else if (args[0] == "IFF2") + IFF2 = bool.Parse(args[1]); + else if (args[0] == "Halted") + Halted = bool.Parse(args[1]); + else if (args[0] == "ExecutedCycles") + totalExecutedCycles = ulong.Parse(args[1]); + else if (args[0] == "PendingCycles") + pendingCycles = int.Parse(args[1]); + + else + EmuLogger.Log("Skipping unrecognized identifier " + args[0]); + } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Z80A.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Z80A.cs.meta new file mode 100644 index 00000000..a4982a9a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/cpu/z80/Z80A.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd46bd23b3b45ae49adfb6aa6c807213 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu.meta new file mode 100644 index 00000000..406d2a8b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 386b71aba86862047bbefefc784eac87 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Attotime.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Attotime.cs new file mode 100644 index 00000000..d6994581 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Attotime.cs @@ -0,0 +1,231 @@ +namespace MAME.Core +{ + public struct Atime + { + public int seconds; + public long attoseconds; + public Atime(int i, long l) + { + seconds = i; + attoseconds = l; + } + } + public class Attotime + { + public static int ATTOTIME_MAX_SECONDS = 1000000000, ATTOSECONDS_PER_SECOND_SQRT = 1000000000; + public static long ATTOSECONDS_PER_SECOND = (long)(1e18); + public static Atime ATTOTIME_ZERO = new Atime(0, 0); + public static Atime ATTOTIME_NEVER = new Atime(1000000000, 0); + public static long ATTOSECONDS_PER_NANOSECOND = (long)1e9; + public static Atime ATTOTIME_IN_NSEC(long ns) + { + return new Atime((int)(ns / 1000000000), (long)((ns % 1000000000) * ATTOSECONDS_PER_NANOSECOND)); + } + public static Atime ATTOTIME_IN_HZ(int hz) + { + return new Atime(0, (long)(ATTOSECONDS_PER_SECOND / hz)); + } + public static long attotime_to_attoseconds(Atime _time) + { + if (_time.seconds == 0) + { + return _time.attoseconds; + } + else if (_time.seconds == -1) + { + return _time.attoseconds - Attotime.ATTOSECONDS_PER_SECOND; + } + else if (_time.seconds > 0) + { + return Attotime.ATTOSECONDS_PER_SECOND; + } + else + { + return -Attotime.ATTOSECONDS_PER_SECOND; + } + } + public static Atime attotime_add(Atime _time1, Atime _time2) + { + Atime result = new Atime(); + + /* if one of the items is attotime_never, return attotime_never */ + if (_time1.seconds >= ATTOTIME_MAX_SECONDS || _time2.seconds >= ATTOTIME_MAX_SECONDS) + return ATTOTIME_NEVER; + + /* add the seconds and attoseconds */ + result.attoseconds = _time1.attoseconds + _time2.attoseconds; + result.seconds = _time1.seconds + _time2.seconds; + + /* normalize and return */ + if (result.attoseconds >= ATTOSECONDS_PER_SECOND) + { + result.attoseconds -= ATTOSECONDS_PER_SECOND; + result.seconds++; + } + + /* overflow */ + if (result.seconds >= ATTOTIME_MAX_SECONDS) + return ATTOTIME_NEVER; + return result; + } + public static Atime attotime_add_attoseconds(Atime _time1, long _attoseconds) + { + Atime result; + + /* if one of the items is attotime_never, return attotime_never */ + if (_time1.seconds >= ATTOTIME_MAX_SECONDS) + return ATTOTIME_NEVER; + + /* add the seconds and attoseconds */ + result.attoseconds = _time1.attoseconds + _attoseconds; + result.seconds = _time1.seconds; + + /* normalize and return */ + if (result.attoseconds >= ATTOSECONDS_PER_SECOND) + { + result.attoseconds -= ATTOSECONDS_PER_SECOND; + result.seconds++; + } + + /* overflow */ + if (result.seconds >= ATTOTIME_MAX_SECONDS) + return ATTOTIME_NEVER; + return result; + } + public static Atime attotime_sub(Atime _time1, Atime _time2) + { + Atime result; + + /* if time1 is attotime_never, return attotime_never */ + if (_time1.seconds >= ATTOTIME_MAX_SECONDS) + return ATTOTIME_NEVER; + + /* add the seconds and attoseconds */ + result.attoseconds = _time1.attoseconds - _time2.attoseconds; + result.seconds = _time1.seconds - _time2.seconds; + + /* normalize and return */ + if (result.attoseconds < 0) + { + result.attoseconds += ATTOSECONDS_PER_SECOND; + result.seconds--; + } + return result; + } + public static Atime attotime_sub_attoseconds(Atime _time1, long _attoseconds) + { + Atime result; + + /* if time1 is attotime_never, return attotime_never */ + if (_time1.seconds >= ATTOTIME_MAX_SECONDS) + return ATTOTIME_NEVER; + + /* add the seconds and attoseconds */ + result.attoseconds = _time1.attoseconds - _attoseconds; + result.seconds = _time1.seconds; + + /* normalize and return */ + if (result.attoseconds < 0) + { + result.attoseconds += ATTOSECONDS_PER_SECOND; + result.seconds--; + } + return result; + } + public static Atime attotime_mul(Atime _time1, uint factor) + { + uint attolo, attohi, reslo, reshi; + ulong temp; + + /* if one of the items is attotime_never, return attotime_never */ + if (_time1.seconds >= ATTOTIME_MAX_SECONDS) + return ATTOTIME_NEVER; + + /* 0 times anything is zero */ + if (factor == 0) + return ATTOTIME_ZERO; + + /* split attoseconds into upper and lower halves which fit into 32 bits */ + attohi = divu_64x32_rem((ulong)_time1.attoseconds, 1000000000, out attolo); + + /* scale the lower half, then split into high/low parts */ + temp = mulu_32x32(attolo, factor); + temp = divu_64x32_rem(temp, 1000000000, out reslo); + + /* scale the upper half, then split into high/low parts */ + temp += mulu_32x32(attohi, factor); + temp = divu_64x32_rem(temp, 1000000000, out reshi); + + /* scale the seconds */ + temp += mulu_32x32((uint)_time1.seconds, factor); + if (temp >= 1000000000) + return ATTOTIME_NEVER; + + /* build the result */ + return new Atime((int)temp, (long)reslo + mul_32x32((int)reshi, 1000000000)); + } + private static uint divu_64x32_rem(ulong a, uint b, out uint remainder) + { + remainder = (uint)(a % (ulong)b); + return (uint)(a / (ulong)b); + } + private static ulong mulu_32x32(uint a, uint b) + { + return (ulong)a * (ulong)b; + } + private static long mul_32x32(int a, int b) + { + return (long)a * (long)b; + } + public static Atime attotime_div(Atime _time1, uint factor) + { + uint attolo, attohi, reshi, reslo, remainder; + Atime result; + ulong temp; + + /* if one of the items is attotime_never, return attotime_never */ + if (_time1.seconds >= ATTOTIME_MAX_SECONDS) + return new Atime(ATTOTIME_MAX_SECONDS, 0); + + /* ignore divide by zero */ + if (factor == 0) + return _time1; + + /* split attoseconds into upper and lower halves which fit into 32 bits */ + attohi = divu_64x32_rem((ulong)_time1.attoseconds, 1000000000, out attolo); + + /* divide the seconds and get the remainder */ + result.seconds = (int)divu_64x32_rem((ulong)_time1.seconds, factor, out remainder); + + /* combine the upper half of attoseconds with the remainder and divide that */ + temp = (ulong)attohi + mulu_32x32(remainder, 1000000000); + reshi = divu_64x32_rem(temp, factor, out remainder); + + /* combine the lower half of attoseconds with the remainder and divide that */ + temp = attolo + mulu_32x32(remainder, 1000000000); + reslo = divu_64x32_rem(temp, factor, out remainder); + + /* round based on the remainder */ + result.attoseconds = (long)reslo + (long)mulu_32x32(reshi, 1000000000); + if (remainder >= factor / 2) + if (++result.attoseconds >= ATTOSECONDS_PER_SECOND) + { + result.attoseconds = 0; + result.seconds++; + } + return result; + } + public static int attotime_compare(Atime _time1, Atime _time2) + { + if (_time1.seconds > _time2.seconds) + return 1; + if (_time1.seconds < _time2.seconds) + return -1; + if (_time1.attoseconds > _time2.attoseconds) + return 1; + if (_time1.attoseconds < _time2.attoseconds) + return -1; + return 0; + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Attotime.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Attotime.cs.meta new file mode 100644 index 00000000..063f17e2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Attotime.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cfd1896a9cde00f4ea338e1f9cb3454c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuexec.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuexec.cs new file mode 100644 index 00000000..3d386527 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuexec.cs @@ -0,0 +1,2840 @@ +using cpu.m6502; +using cpu.m6800; +using cpu.m68000; +using cpu.m6805; +using cpu.m6809; +using cpu.nec; +using cpu.z80; +using System; +using System.IO; + +namespace MAME.Core +{ + public class cpuexec_data + { + public int cpunum; + public byte suspend; + public byte nextsuspend; + public byte eatcycles; + public byte nexteatcycles; + public int trigger; + public ulong totalcycles; // total CPU cycles executed + public Atime localtime; // local time, relative to the timer system's global time + public int cycles_per_second; + public long attoseconds_per_cycle; + public int cycles_running; + public int cycles_stolen; + public int icount; + public EmuTimer.emu_timer partial_frame_timer; + public Atime partial_frame_period; + public virtual ulong TotalExecutedCycles { get; set; } + public virtual int PendingCycles { get; set; } + public virtual int ExecuteCycles(int cycles) { return 0; } + public virtual void Reset() { } + public virtual void set_irq_line(int irqline, LineState state) { } + public virtual void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { } + } + public class Cpuexec + { + public static byte SUSPEND_REASON_HALT = 0x01, SUSPEND_REASON_RESET = 0x02, SUSPEND_REASON_SPIN = 0x04, SUSPEND_REASON_TRIGGER = 0x08, SUSPEND_REASON_DISABLE = 0x10, SUSPEND_ANY_REASON = 0xff; + public static int iType, bLog, bLog0, bLog1, bLog2, bLog3, bLogS; + public static bool bLog02, bLog12, bLog22, bLog32; + public static bool b11 = true, b12 = true, b13 = true, b14 = true; + public static int iloops, activecpu, icpu, ncpu, iloops2; + public static cpuexec_data[] cpu; + public static EmuTimer.emu_timer timedint_timer; + public static Atime timedint_period, timeslice_period; + public delegate void vblank_delegate(); + public static vblank_delegate vblank_interrupt; + public static Action vblank_interrupt2; + public static EmuTimer.emu_timer interleave_boost_timer; + public static EmuTimer.emu_timer interleave_boost_timer_end; + public static EmuTimer.emu_timer timeslice_timer; + public static Atime perfect_interleave; + public static int vblank_interrupts_per_frame; + public static void cpuexec_init() + { + switch (Machine.sBoard) + { + case "CPS-1": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 10000000; + switch (Machine.sName) + { + case "daimakair": + case "striderjr": + case "dynwarjr": + case "area88r": + case "sf2ce": + case "sf2ceea": + case "sf2ceua": + case "sf2ceub": + case "sf2ceuc": + case "sf2ceja": + case "sf2cejb": + case "sf2cejc": + case "sf2bhh": + case "sf2rb": + case "sf2rb2": + case "sf2rb3": + case "sf2red": + case "sf2v004": + case "sf2acc": + case "sf2acca": + case "sf2accp2": + case "sf2amf2": + case "sf2dkot2": + case "sf2cebltw": + case "sf2m2": + case "sf2m3": + case "sf2m4": + case "sf2m5": + case "sf2m6": + case "sf2m7": + case "sf2m8": + case "sf2m10": + case "sf2yyc": + case "sf2koryu": + case "sf2dongb": + case "cworld2j": + case "cworld2ja": + case "cworld2jb": + case "varth": + case "varthr1": + case "varthu": + case "varthj": + case "varthjr": + case "qad": + case "qadjr": + case "wofhfh": + case "sf2hf": + case "sf2hfu": + case "sf2hfj": + case "dinohunt": + case "punisherbz": + case "pnickj": + case "qtono2j": + case "megaman": + case "megamana": + case "rockmanj": + case "pang3": + case "pang3r1": + case "pang3j": + case "pang3b": + case "sfzch": + case "sfach": + case "sfzbch": + cpu[0].cycles_per_second = 12000000; + break; + } + cpu[1].cycles_per_second = 3579545; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + break; + case "CPS-1(QSound)": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 12000000; + cpu[1].cycles_per_second = 8000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 1; + break; + case "CPS2": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = (int)(16000000 * 0.7375f); + cpu[1].cycles_per_second = 8000000; + cpu[0].attoseconds_per_cycle = (long)((double)Attotime.ATTOSECONDS_PER_SECOND / (16000000 * 0.7375f)); + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 262; + vblank_interrupt = CPS.cps2_interrupt; + break; + case "Data East": + M6502.mm1 = new M6502[2]; + M6502.mm1[0] = new M6502(); + M6502.mm1[0].m6502_common_init(Cpuint.cpu_0_irq_callback); + M6502.mm1[1] = new M6502(); + M6502.mm1[1].m6502_common_init(Cpuint.cpu_1_irq_callback); + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = M6502.mm1[0]; + cpu[1] = M6502.mm1[1]; + cpu[0].cycles_per_second = 2000000; + cpu[1].cycles_per_second = 1500000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 1; + break; + case "Tehkan": + Z80A.nZ80 = 2; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Z80A.zz1[1] = new Z80A(); + Z80A.zz1[0].cpunum = 0; + Z80A.zz1[1].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = Z80A.zz1[0]; + cpu[1] = Z80A.zz1[1]; + cpu[0].cycles_per_second = 4000000; + cpu[1].cycles_per_second = 3072000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 2; + vblank_interrupt = Generic.nmi_0_line_pulse; + break; + case "Neo Geo": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 12000000; + cpu[1].cycles_per_second = 4000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 1; + break; + case "SunA8": + Z80A.nZ80 = 2; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Z80A.zz1[1] = new Z80A(); + Z80A.zz1[0].cpunum = 0; + Z80A.zz1[1].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = Z80A.zz1[0]; + cpu[1] = Z80A.zz1[1]; + cpu[0].cycles_per_second = 6000000; + cpu[1].cycles_per_second = 6000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 0x100; + break; + case "Namco System 1": + M6809.mm1 = new M6809[3]; + M6809.mm1[0] = new M6809(); + M6809.mm1[1] = new M6809(); + M6809.mm1[2] = new M6809(); + M6809.mm1[0].irq_callback = null; + M6809.mm1[1].irq_callback = null; + M6809.mm1[2].irq_callback = null; + M6800.m1 = new M6800(); + M6800.action_rx = M6800.m1.m6800_rx_tick; + M6800.action_tx = M6800.m1.m6800_tx_tick; + M6809.mm1[0].cpunum = 0; + M6809.mm1[1].cpunum = 1; + M6809.mm1[2].cpunum = 2; + M6800.m1.cpunum = 3; + ncpu = 4; + cpu = new cpuexec_data[ncpu]; + cpu[0] = M6809.mm1[0]; + cpu[1] = M6809.mm1[1]; + cpu[2] = M6809.mm1[2]; + cpu[3] = M6800.m1; + cpu[0].cycles_per_second = 1536000; + cpu[1].cycles_per_second = 1536000; + cpu[2].cycles_per_second = 1536000; + cpu[3].cycles_per_second = 1536000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + cpu[2].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[2].cycles_per_second; + cpu[3].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[3].cycles_per_second; + vblank_interrupts_per_frame = 1; + break; + case "IGS011": + MC68000.m1 = new MC68000(); + MC68000.m1.cpunum = 0; + ncpu = 1; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[0].cycles_per_second = 7333333; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + case "lhb2": + vblank_interrupts_per_frame = 5; + vblank_interrupt = IGS011.lhb2_interrupt; + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + vblank_interrupts_per_frame = 4; + vblank_interrupt = IGS011.lhb_interrupt; + break; + case "xymg": + case "wlcc": + vblank_interrupts_per_frame = 2; + vblank_interrupt = IGS011.wlcc_interrupt; + break; + case "vbowl": + case "vbowlj": + vblank_interrupts_per_frame = 7; + vblank_interrupt = IGS011.vbowl_interrupt; + break; + case "nkishusp": + vblank_interrupts_per_frame = 5; + vblank_interrupt = Generic.irq_0_6_line_hold; + break; + } + break; + case "PGM": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 20000000; + cpu[1].cycles_per_second = 8468000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 2; + vblank_interrupt = PGM.drgw_interrupt; + break; + case "M72": + Nec.nn1 = new Nec[1]; + Nec.nn1[0] = new V30(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Nec.nn1[0].cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = Nec.nn1[0]; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 8000000; + cpu[1].cycles_per_second = 3579545; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 128; + switch (Machine.sName) + { + case "airduel": + case "airduelm72": + vblank_interrupt = M72.fake_nmi; + break; + case "ltswords": + case "kengo": + case "kengoa": + vblank_interrupt = Generic.nmi_1_line_pulse; + break; + } + break; + case "M92": + Nec.nn1 = new Nec[2]; + Nec.nn1[0] = new V33(); + Nec.nn1[1] = new V30(); + Nec.nn1[0].cpunum = 0; + Nec.nn1[1].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = Nec.nn1[0]; + cpu[1] = Nec.nn1[1]; + cpu[0].cycles_per_second = 9000000; + cpu[1].cycles_per_second = 7159090; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 0; + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "dland": + case "bbredux": + case "bublboblb": + case "boblcave": + Z80A.nZ80 = 3; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Z80A.zz1[1] = new Z80A(); + Z80A.zz1[2] = new Z80A(); + Z80A.zz1[0].cpunum = 0; + Z80A.zz1[1].cpunum = 1; + Z80A.zz1[2].cpunum = 2; + ncpu = 3; + cpu = new cpuexec_data[ncpu]; + cpu[0] = Z80A.zz1[0]; + cpu[1] = Z80A.zz1[1]; + cpu[2] = Z80A.zz1[2]; + cpu[0].cycles_per_second = 6000000; + cpu[1].cycles_per_second = 6000000; + cpu[2].cycles_per_second = 3000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + cpu[2].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[2].cycles_per_second; + vblank_interrupts_per_frame = 0; + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "bublcave": + case "bublcave11": + case "bublcave10": + Z80A.nZ80 = 3; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Z80A.zz1[1] = new Z80A(); + Z80A.zz1[2] = new Z80A(); + M6800.m1 = new M6801(); + M6800.action_rx = M6800.m1.m6800_rx_tick; + M6800.action_tx = M6800.m1.m6800_tx_tick; + Z80A.zz1[0].cpunum = 0; + Z80A.zz1[1].cpunum = 1; + Z80A.zz1[2].cpunum = 2; + M6800.m1.cpunum = 3; + ncpu = 4; + cpu = new cpuexec_data[ncpu]; + cpu[0] = Z80A.zz1[0]; + cpu[1] = Z80A.zz1[1]; + cpu[2] = Z80A.zz1[2]; + cpu[3] = M6800.m1; + cpu[0].cycles_per_second = 6000000; + cpu[1].cycles_per_second = 6000000; + cpu[2].cycles_per_second = 3000000; + cpu[3].cycles_per_second = 1000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + cpu[2].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[2].cycles_per_second; + cpu[3].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[3].cycles_per_second; + vblank_interrupts_per_frame = 0; + break; + case "bub68705": + Z80A.nZ80 = 3; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Z80A.zz1[1] = new Z80A(); + Z80A.zz1[2] = new Z80A(); + M6805.m1 = new M68705(); + Z80A.zz1[0].cpunum = 0; + Z80A.zz1[1].cpunum = 1; + Z80A.zz1[2].cpunum = 2; + M6805.m1.cpunum = 3; + ncpu = 4; + cpu = new cpuexec_data[ncpu]; + cpu[0] = Z80A.zz1[0]; + cpu[1] = Z80A.zz1[1]; + cpu[2] = Z80A.zz1[2]; + cpu[3] = M68705.m1; + cpu[0].cycles_per_second = 6000000; + cpu[1].cycles_per_second = 6000000; + cpu[2].cycles_per_second = 3000000; + cpu[3].cycles_per_second = 1000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + cpu[2].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[2].cycles_per_second; + cpu[3].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[3].cycles_per_second; + vblank_interrupts_per_frame = 2; + vblank_interrupt = Taito.bublbobl_m68705_interrupt; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfp": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 8000000; + cpu[1].cycles_per_second = 4000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 1; + break; + case "opwolfb": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 2; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Z80A.zz1[1] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + Z80A.zz1[1].cpunum = 2; + ncpu = 3; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[2] = Z80A.zz1[1]; + cpu[0].cycles_per_second = 8000000; + cpu[1].cycles_per_second = 4000000; + cpu[2].cycles_per_second = 4000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + cpu[2].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[2].cycles_per_second; + vblank_interrupts_per_frame = 1; + break; + } + break; + case "Taito B": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 12000000; + switch (Machine.sName) + { + case "silentd": + case "silentdj": + case "silentdu": + cpu[0].cycles_per_second = 16000000; + break; + } + cpu[1].cycles_per_second = 4000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 1; + switch (Machine.sName) + { + case "pbobble": + vblank_interrupt = Taitob.pbobble_interrupt; + vblank_interrupt2 = Taitob.pbobble_interrupt5; + break; + case "silentd": + case "silentdj": + case "silentdu": + vblank_interrupt = Taitob.silentd_interrupt; + vblank_interrupt2 = Taitob.silentd_interrupt4; + break; + } + break; + case "Konami 68000": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + vblank_interrupts_per_frame = 1; + switch (Machine.sName) + { + case "cuebrick": + ncpu = 1; + cpu[0].cycles_per_second = 8000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + vblank_interrupts_per_frame = 10; + vblank_interrupt = Konami68000.cuebrick_interrupt; + break; + case "mia": + case "mia2": + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + cpu[0].cycles_per_second = 8000000; + cpu[1].cycles_per_second = 3579545; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupt = Generic.irq5_line_hold0; + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + cpu[0].cycles_per_second = 12000000; + cpu[1].cycles_per_second = 3579545; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupt = Konami68000.punkshot_interrupt; + break; + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + case "glfgreat": + case "glfgreatj": + cpu[0].cycles_per_second = 12000000; + cpu[1].cycles_per_second = 3579545; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupt = Konami68000.lgtnfght_interrupt; + break; + case "blswhstl": + case "blswhstla": + case "detatwin": + cpu[0].cycles_per_second = 16000000; + cpu[1].cycles_per_second = 3579545; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupt = Konami68000.punkshot_interrupt; + break; + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + cpu[0].cycles_per_second = 16000000; + cpu[1].cycles_per_second = 8000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupt = Konami68000.punkshot_interrupt; + break; + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + cpu[0].cycles_per_second = 16000000; + cpu[1].cycles_per_second = 4000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupt = Konami68000.punkshot_interrupt; + break; + case "prmrsocr": + case "prmrsocrj": + cpu[0].cycles_per_second = 12000000; + cpu[1].cycles_per_second = 8000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupt = Konami68000.lgtnfght_interrupt; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + M6809.mm1 = new M6809[1]; + M6809.mm1[0] = new M6809(); + M6809.mm1[0].irq_callback = Cpuint.cpu_0_irq_callback; + Z80A.nZ80 = 1; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + M6809.mm1[0].cpunum = 0; + Z80A.zz1[0].cpunum = 1; + ncpu = 2; + cpu = new cpuexec_data[ncpu]; + cpu[0] = M6809.mm1[0]; + cpu[1] = Z80A.zz1[0]; + cpu[0].cycles_per_second = 1500000; + cpu[1].cycles_per_second = 3000000; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + vblank_interrupts_per_frame = 4; + vblank_interrupt = Generic.irq0_line_hold1; + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + MC68000.m1 = new MC68000(); + Z80A.nZ80 = 2; + Z80A.zz1 = new Z80A[Z80A.nZ80]; + Z80A.zz1[0] = new Z80A(); + Z80A.zz1[1] = new Z80A(); + MC68000.m1.cpunum = 0; + Z80A.zz1[0].cpunum = 1; + Z80A.zz1[1].cpunum = 2; + ncpu = 3; + cpu = new cpuexec_data[ncpu]; + cpu[0] = MC68000.m1; + cpu[1] = Z80A.zz1[0]; + cpu[2] = Z80A.zz1[1]; + cpu[0].cycles_per_second = 8000000; + cpu[1].cycles_per_second = 3579545; + cpu[2].cycles_per_second = 3579545; + cpu[0].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[0].cycles_per_second; + cpu[1].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[1].cycles_per_second; + cpu[2].attoseconds_per_cycle = Attotime.ATTOSECONDS_PER_SECOND / cpu[2].cycles_per_second; + vblank_interrupts_per_frame = 1; + break; + } + break; + } + activecpu = -1; + for (icpu = 0; icpu < ncpu; icpu++) + { + cpu[icpu].suspend = SUSPEND_REASON_RESET; + cpu[icpu].localtime = Attotime.ATTOTIME_ZERO; + cpu[icpu].TotalExecutedCycles = 0; + cpu[icpu].PendingCycles = 0; + } + compute_perfect_interleave(); + } + public static void cpuexec_reset() + { + switch (Machine.sBoard) + { + case "CPS-1": + MC68000.m1.ReadOpByte = CPS.MCReadOpByte; + MC68000.m1.ReadByte = CPS.MCReadByte; + MC68000.m1.ReadOpWord = CPS.MCReadOpWord; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord; + MC68000.m1.ReadOpLong = CPS.MCReadOpLong; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = CPS.MCReadLong; + MC68000.m1.WriteByte = CPS.MCWriteByte; + MC68000.m1.WriteWord = CPS.MCWriteWord; + MC68000.m1.WriteLong = CPS.MCWriteLong; + Z80A.zz1[0].ReadOp = CPS.ZCReadOp; + Z80A.zz1[0].ReadOpArg = CPS.ZCReadMemory; + Z80A.zz1[0].ReadMemory = CPS.ZCReadMemory; + Z80A.zz1[0].WriteMemory = CPS.ZCWriteMemory; + Z80A.zz1[0].ReadHardware = CPS.ZCReadHardware; + Z80A.zz1[0].WriteHardware = CPS.ZCWriteHardware; + Z80A.zz1[0].IRQCallback = CPS.ZIRQCallback; + switch (Machine.sName) + { + case "forgottn": + case "forgottna": + case "forgottnu": + case "forgottnue": + case "forgottnuc": + case "forgottnua": + case "forgottnuaa": + case "lostwrld": + case "lostwrldo": + MC68000.m1.ReadByte = CPS.MCReadByte_forgottn; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord_forgottn; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = CPS.MCReadLong_forgottn; + MC68000.m1.WriteByte = CPS.MCWriteByte_forgottn; + MC68000.m1.WriteWord = CPS.MCWriteWord_forgottn; + MC68000.m1.WriteLong = CPS.MCWriteLong_forgottn; + break; + case "sf2ee": + case "sf2ue": + case "sf2thndr": + MC68000.m1.ReadByte = CPS.MCReadByte_sf2thndr; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord_sf2thndr; + MC68000.m1.WriteWord = CPS.MCWriteWord_sf2thndr; + break; + case "sf2ceblp": + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord_sf2ceblp; + MC68000.m1.WriteWord = CPS.MCWriteWord_sf2ceblp; + break; + case "sf2m3": + case "sf2m8": + MC68000.m1.ReadByte = CPS.MCReadByte_sf2m3; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord_sf2m3; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = CPS.MCReadLong_sf2m3; + MC68000.m1.WriteByte = CPS.MCWriteByte_sf2m3; + MC68000.m1.WriteWord = CPS.MCWriteWord_sf2m3; + MC68000.m1.WriteLong = CPS.MCWriteLong_sf2m3; + break; + case "sf2m10": + CPS.mainram2_set = new byte[0x100000]; + CPS.mainram3_set = new byte[0x100]; + MC68000.m1.ReadByte = CPS.MCReadByte_sf2m10; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord_sf2m10; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = CPS.MCReadLong_sf2m10; + MC68000.m1.WriteByte = CPS.MCWriteByte_sf2m10; + MC68000.m1.WriteWord = CPS.MCWriteWord_sf2m10; + MC68000.m1.WriteLong = CPS.MCWriteLong_sf2m10; + break; + case "sf2dongb": + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord_sf2dongb; + break; + case "dinohunt": + MC68000.m1.ReadByte = CPS.MCReadByte_dinohunt; + break; + case "pang3": + case "pang3r1": + case "pang3j": + case "pang3b": + MC68000.m1.ReadByte = CPS.MCReadByte_pang3; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MCReadWord_pang3; + MC68000.m1.WriteByte = CPS.MCWriteByte_pang3; + MC68000.m1.WriteWord = CPS.MCWriteWord_pang3; + break; + } + break; + case "CPS-1(QSound)": + MC68000.m1.ReadOpByte = CPS.MQReadOpByte; + MC68000.m1.ReadByte = CPS.MQReadByte; + MC68000.m1.ReadOpWord = CPS.MQReadOpWord; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MQReadWord; + MC68000.m1.ReadOpLong = CPS.MQReadOpLong; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = CPS.MQReadLong; + MC68000.m1.WriteByte = CPS.MQWriteByte; + MC68000.m1.WriteWord = CPS.MQWriteWord; + MC68000.m1.WriteLong = CPS.MQWriteLong; + Z80A.zz1[0].ReadOp = CPS.ZQReadOp; + Z80A.zz1[0].ReadOpArg = CPS.ZQReadMemory; + Z80A.zz1[0].ReadMemory = CPS.ZQReadMemory; + Z80A.zz1[0].WriteMemory = CPS.ZQWriteMemory; + Z80A.zz1[0].ReadHardware = CPS.ZCReadHardware; + Z80A.zz1[0].WriteHardware = CPS.ZCWriteHardware; + Z80A.zz1[0].IRQCallback = CPS.ZIRQCallback; + break; + case "CPS2": + MC68000.m1.ReadOpByte = CPS.MC2ReadOpByte; + MC68000.m1.ReadByte = CPS.MC2ReadByte; + MC68000.m1.ReadOpWord = CPS.MC2ReadOpWord; + MC68000.m1.ReadPcrelWord = CPS.MC2ReadPcrelWord; + MC68000.m1.ReadWord = CPS.MC2ReadWord; + MC68000.m1.ReadOpLong = CPS.MC2ReadOpLong; + MC68000.m1.ReadPcrelLong = CPS.MC2ReadPcrelLong; + MC68000.m1.ReadLong = CPS.MC2ReadLong; + MC68000.m1.WriteByte = CPS.MC2WriteByte; + MC68000.m1.WriteWord = CPS.MC2WriteWord; + MC68000.m1.WriteLong = CPS.MC2WriteLong; + switch (Machine.sName) + { + case "ddtodd": + case "ecofghtrd": + case "ssf2ud": + case "ssf2tbd": + case "armwar1d": + case "avspd": + case "dstlku1d": + case "ringdstd": + case "ssf2tad": + case "ssf2xjr1d": + case "xmcotar1d": + case "mshud": + case "cybotsud": + case "cybotsjd": + case "nwarrud": + case "sfad": + case "19xxd": + case "ddsomud": + case "gigaman2": + case "megamn2d": + case "sfz2ad": + case "sfz2jd": + case "spf2td": + case "spf2xjd": + case "sfz2ald": + case "xmvsfu1d": + case "batcird": + case "csclub1d": + case "mshvsfu1d": + case "sgemfd": + case "vsavd": + case "vhunt2d": + case "vsav2d": + case "mvscud": + case "sfa3ud": + case "sfz3jr2d": + case "gigawingd": + case "gigawingjd": + case "1944d": + case "dimahoud": + case "mmatrixd": + case "progearud": + case "progearjd": + case "progearjbl": + case "hsf2d": + MC68000.m1.ReadOpByte = CPS.MC2ReadOpByte_dead; + MC68000.m1.ReadByte = CPS.MC2ReadByte_dead; + MC68000.m1.ReadOpWord = CPS.MC2ReadOpWord_dead; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = CPS.MC2ReadWord_dead; + MC68000.m1.ReadOpLong = CPS.MC2ReadOpLong_dead; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = CPS.MC2ReadLong_dead; + MC68000.m1.WriteByte = CPS.MC2WriteByte_dead; + MC68000.m1.WriteWord = CPS.MC2WriteWord_dead; + MC68000.m1.WriteLong = CPS.MC2WriteLong_dead; + break; + } + Z80A.zz1[0].ReadOp = CPS.ZQReadOp; + Z80A.zz1[0].ReadOpArg = CPS.ZQReadMemory; + Z80A.zz1[0].ReadMemory = CPS.ZQReadMemory; + Z80A.zz1[0].WriteMemory = CPS.ZQWriteMemory; + Z80A.zz1[0].ReadHardware = CPS.ZCReadHardware; + Z80A.zz1[0].WriteHardware = CPS.ZCWriteHardware; + Z80A.zz1[0].IRQCallback = CPS.ZIRQCallback; + break; + case "Data East": + M6502.mm1[0].ReadOp = Dataeast.D0ReadOp; + M6502.mm1[0].ReadOpArg = Dataeast.D0ReadOpArg; + M6502.mm1[0].ReadMemory = Dataeast.D0ReadMemory; + M6502.mm1[0].WriteMemory = Dataeast.D0WriteMemory; + M6502.mm1[1].ReadOpArg = Dataeast.D1ReadOpArg; + M6502.mm1[1].ReadMemory = Dataeast.D1ReadMemory; + M6502.mm1[1].WriteMemory = Dataeast.D1WriteMemory; + switch (Machine.sName) + { + case "pcktgal": + case "pcktgalb": + M6502.mm1[1].ReadOp = Dataeast.D1ReadOp; + break; + case "pcktgal2": + case "pcktgal2j": + case "spool3": + case "spool3i": + M6502.mm1[1].ReadOp = Dataeast.D1ReadOp_2; + break; + } + break; + case "Tehkan": + Z80A.zz1[0].ReadOp = Tehkan.Z0ReadOp; + Z80A.zz1[0].ReadOpArg = Tehkan.Z0ReadMemory; + Z80A.zz1[0].ReadMemory = Tehkan.Z0ReadMemory; + Z80A.zz1[0].WriteMemory = Tehkan.Z0WriteMemory; + Z80A.zz1[0].ReadHardware = Tehkan.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Tehkan.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Tehkan.Z0IRQCallback; + switch (Machine.sName) + { + case "pbaction3": + Z80A.zz1[0].ReadOp = Tehkan.Z0ReadOp_pbaction3; + Z80A.zz1[0].ReadOpArg = Tehkan.Z0ReadMemory_pbaction3; + Z80A.zz1[0].ReadMemory = Tehkan.Z0ReadMemory_pbaction3; + break; + case "pbaction4": + case "pbaction5": + Z80A.zz1[0].ReadOp = Tehkan.Z0ReadOp_pbaction3; + break; + } + Z80A.zz1[1].ReadOp = Tehkan.Z1ReadOp; + Z80A.zz1[1].ReadOpArg = Tehkan.Z1ReadMemory; + Z80A.zz1[1].ReadMemory = Tehkan.Z1ReadMemory; + Z80A.zz1[1].WriteMemory = Tehkan.Z1WriteMemory; + Z80A.zz1[1].ReadHardware = Tehkan.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Tehkan.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Tehkan.Z1IRQCallback; + break; + case "Neo Geo": + MC68000.m1.ReadOpByte = Neogeo.MReadOpByte; + MC68000.m1.ReadByte = Neogeo.MReadByte; + MC68000.m1.ReadOpWord = Neogeo.MReadOpWord; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord; + MC68000.m1.ReadOpLong = Neogeo.MReadOpLong; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong; + MC68000.m1.WriteByte = Neogeo.MWriteByte; + MC68000.m1.WriteWord = Neogeo.MWriteWord; + MC68000.m1.WriteLong = Neogeo.MWriteLong; + Z80A.zz1[0].ReadOp = Neogeo.ZReadOp; + Z80A.zz1[0].ReadOpArg = Neogeo.ZReadOp; + Z80A.zz1[0].ReadMemory = Neogeo.ZReadMemory; + Z80A.zz1[0].WriteMemory = Neogeo.ZWriteMemory; + Z80A.zz1[0].ReadHardware = Neogeo.ZReadHardware; + Z80A.zz1[0].WriteHardware = Neogeo.ZWriteHardware; + Z80A.zz1[0].IRQCallback = Neogeo.ZIRQCallback; + switch (Machine.sName) + { + case "fatfury2": + case "ssideki": + MC68000.m1.ReadByte = Neogeo.MReadByte_fatfury2; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_fatfury2; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_fatfury2; + MC68000.m1.WriteByte = Neogeo.MWriteByte_fatfury2; + MC68000.m1.WriteWord = Neogeo.MWriteWord_fatfury2; + MC68000.m1.WriteLong = Neogeo.MWriteLong_fatfury2; + break; + case "irrmaze": + MC68000.m1.ReadByte = Neogeo.MReadByte_irrmaze; + break; + case "kof98": + case "kof98a": + case "kof98k": + case "kof98ka": + MC68000.m1.WriteWord = Neogeo.MWriteWord_kof98; + break; + case "kof99": + case "kof99h": + case "kof99e": + MC68000.m1.ReadByte = Neogeo.MReadByte_kof99; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_kof99; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_kof99; + MC68000.m1.WriteByte = Neogeo.MWriteByte_kof99; + MC68000.m1.WriteWord = Neogeo.MWriteWord_kof99; + MC68000.m1.WriteLong = Neogeo.MWriteLong_kof99; + break; + case "garou": + MC68000.m1.ReadByte = Neogeo.MReadByte_garou; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_garou; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_garou; + MC68000.m1.WriteByte = Neogeo.MWriteByte_garou; + MC68000.m1.WriteWord = Neogeo.MWriteWord_garou; + MC68000.m1.WriteLong = Neogeo.MWriteLong_garou; + break; + case "garouh": + MC68000.m1.ReadByte = Neogeo.MReadByte_garou; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_garou; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_garou; + MC68000.m1.WriteByte = Neogeo.MWriteByte_garouh; + MC68000.m1.WriteWord = Neogeo.MWriteWord_garouh; + MC68000.m1.WriteLong = Neogeo.MWriteLong_garouh; + break; + case "mslug3": + MC68000.m1.ReadByte = Neogeo.MReadByte_mslug3; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_mslug3; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_mslug3; + MC68000.m1.WriteByte = Neogeo.MWriteByte_mslug3; + MC68000.m1.WriteWord = Neogeo.MWriteWord_mslug3; + MC68000.m1.WriteLong = Neogeo.MWriteLong_mslug3; + break; + case "kof2000": + MC68000.m1.ReadOpByte = MC68000.m1.ReadByte = Neogeo.MReadByte_kof2000; + MC68000.m1.ReadOpWord = MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_kof2000; + MC68000.m1.ReadOpLong = MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_kof2000; + MC68000.m1.WriteByte = Neogeo.MWriteByte_kof2000; + MC68000.m1.WriteWord = Neogeo.MWriteWord_kof2000; + MC68000.m1.WriteLong = Neogeo.MWriteLong_kof2000; + break; + case "mslug5": + case "mslug5h": + case "svc": + case "kof2003": + case "kof2003h": + case "svcboot": + case "svcsplus": + MC68000.m1.ReadByte = Neogeo.MReadByte_pvc; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_pvc; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_pvc; + MC68000.m1.WriteByte = Neogeo.MWriteByte_pvc; + MC68000.m1.WriteWord = Neogeo.MWriteWord_pvc; + MC68000.m1.WriteLong = Neogeo.MWriteLong_pvc; + break; + case "cthd2003": + case "ct2k3sp": + MC68000.m1.WriteByte = Neogeo.MWriteByte_cthd2003; + MC68000.m1.WriteWord = Neogeo.MWriteWord_cthd2003; + break; + case "ms5plus": + MC68000.m1.ReadByte = Neogeo.MReadByte_ms5plus; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_ms5plus; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_ms5plus; + MC68000.m1.WriteByte = Neogeo.MWriteByte_ms5plus; + MC68000.m1.WriteWord = Neogeo.MWriteWord_ms5plus; + MC68000.m1.WriteLong = Neogeo.MWriteLong_ms5plus; + break; + case "kog": + MC68000.m1.ReadByte = Neogeo.MReadByte_kog; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_kog; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_kog; + break; + case "kf2k3bl": + case "kf2k3upl": + MC68000.m1.ReadByte = Neogeo.MReadByte_kf2k3bl; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_kf2k3bl; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_kf2k3bl; + MC68000.m1.WriteByte = Neogeo.MWriteByte_kf2k3bl; + MC68000.m1.WriteWord = Neogeo.MWriteWord_kf2k3bl; + MC68000.m1.WriteLong = Neogeo.MWriteLong_kf2k3bl; + break; + case "kf2k3bla": + case "kf2k3pl": + MC68000.m1.ReadByte = Neogeo.MReadByte_kf2k3bl; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_kf2k3bl; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_kf2k3bl; + MC68000.m1.WriteByte = Neogeo.MWriteByte_kf2k3pl; + MC68000.m1.WriteWord = Neogeo.MWriteWord_kf2k3pl; + MC68000.m1.WriteLong = Neogeo.MWriteLong_kf2k3pl; + break; + case "sbp": + MC68000.m1.ReadByte = Neogeo.MReadByte_sbp; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_sbp; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_sbp; + MC68000.m1.WriteByte = Neogeo.MWriteByte_sbp; + MC68000.m1.WriteWord = Neogeo.MWriteWord_sbp; + MC68000.m1.WriteLong = Neogeo.MWriteLong_sbp; + break; + case "kof10th": + MC68000.m1.ReadByte = Neogeo.MReadByte_kof10th; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_kof10th; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_kof10th; + MC68000.m1.WriteByte = Neogeo.MWriteByte_kof10th; + MC68000.m1.WriteWord = Neogeo.MWriteWord_kof10th; + MC68000.m1.WriteLong = Neogeo.MWriteLong_kof10th; + break; + case "jockeygp": + case "jockeygpa": + MC68000.m1.ReadByte = Neogeo.MReadByte_jockeygp; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_jockeygp; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_jockeygp; + MC68000.m1.WriteByte = Neogeo.MWriteByte_jockeygp; + MC68000.m1.WriteWord = Neogeo.MWriteWord_jockeygp; + MC68000.m1.WriteLong = Neogeo.MWriteLong_jockeygp; + break; + case "vliner": + MC68000.m1.ReadByte = Neogeo.MReadByte_vliner; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Neogeo.MReadWord_vliner; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Neogeo.MReadLong_vliner; + MC68000.m1.WriteByte = Neogeo.MWriteByte_jockeygp; + MC68000.m1.WriteWord = Neogeo.MWriteWord_jockeygp; + MC68000.m1.WriteLong = Neogeo.MWriteLong_jockeygp; + break; + } + break; + case "SunA8": + switch (Machine.sName) + { + case "starfigh": + Z80A.zz1[0].ReadOp = SunA8.Z0ReadOp_starfigh; + Z80A.zz1[0].ReadOpArg = SunA8.Z0ReadMemory_starfigh; + Z80A.zz1[0].ReadMemory = SunA8.Z0ReadMemory_starfigh; + Z80A.zz1[0].WriteMemory = SunA8.Z0WriteMemory_starfigh; + Z80A.zz1[0].ReadHardware = SunA8.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = SunA8.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = SunA8.Z0IRQCallback; + Z80A.zz1[1].ReadOp = SunA8.Z1ReadOp_hardhead; + Z80A.zz1[1].ReadOpArg = SunA8.Z1ReadMemory_hardhead; + Z80A.zz1[1].ReadMemory = SunA8.Z1ReadMemory_hardhead; + Z80A.zz1[1].WriteMemory = SunA8.Z1Write_Memory_hardhead; + Z80A.zz1[1].ReadHardware = SunA8.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = SunA8.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = SunA8.Z1IRQCallback; + break; + } + break; + case "Namco System 1": + M6809.mm1[0].ReadOp = Namcos1.N0ReadOpByte; + M6809.mm1[0].ReadOpArg = Namcos1.N0ReadOpByte; + M6809.mm1[0].RM = Namcos1.N0ReadMemory; + M6809.mm1[0].WM = Namcos1.N0WriteMemory; + M6809.mm1[1].ReadOp = Namcos1.N1ReadOpByte; + M6809.mm1[1].ReadOpArg = Namcos1.N1ReadOpByte; + M6809.mm1[1].RM = Namcos1.N1ReadMemory; + M6809.mm1[1].WM = Namcos1.N1WriteMemory; + M6809.mm1[2].ReadOp = Namcos1.N2ReadOpByte; + M6809.mm1[2].ReadOpArg = Namcos1.N2ReadOpByte; + M6809.mm1[2].RM = Namcos1.N2ReadMemory; + M6809.mm1[2].WM = Namcos1.N2WriteMemory; + M6800.m1.ReadOp = Namcos1.N3ReadOpByte; + M6800.m1.ReadOpArg = Namcos1.N3ReadOpByte; + M6800.m1.ReadMemory = Namcos1.N3ReadMemory; + M6800.m1.ReadIO = Namcos1.N3ReadIO; + M6800.m1.WriteMemory = Namcos1.N3WriteMemory; + M6800.m1.WriteIO = Namcos1.N3WriteIO; + switch (Machine.sName) + { + case "quester": + case "questers": + M6800.m1.ReadMemory = Namcos1.N3ReadMemory_quester; + break; + case "berabohm": + M6800.m1.ReadMemory = Namcos1.N3ReadMemory_berabohm; + break; + case "faceoff": + case "tankfrce4": + M6800.m1.ReadMemory = Namcos1.N3ReadMemory_faceoff; + break; + } + break; + case "IGS011": + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv10c": + case "drgnwrldv11h": + MC68000.m1.ReadOpByte = IGS011.MReadOpByte_drgnwrld; + MC68000.m1.ReadByte = IGS011.MReadByte_drgnwrld; + MC68000.m1.ReadOpWord = IGS011.MReadOpWord_drgnwrld; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_drgnwrld; + MC68000.m1.ReadOpLong = IGS011.MReadOpLong_drgnwrld; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_drgnwrld; + MC68000.m1.WriteByte = IGS011.MWriteByte_drgnwrld; + MC68000.m1.WriteWord = IGS011.MWriteWord_drgnwrld; + MC68000.m1.WriteLong = IGS011.MWriteLong_drgnwrld; + break; + case "drgnwrldv21": + MC68000.m1.ReadOpByte = IGS011.MReadByte_drgnwrld_igs012; + MC68000.m1.ReadByte = IGS011.MReadByte_drgnwrld_igs012; + MC68000.m1.ReadOpWord = IGS011.MReadWord_drgnwrld_igs012_drgnwrldv21; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_drgnwrld_igs012_drgnwrldv21; + MC68000.m1.ReadOpLong = IGS011.MReadLong_drgnwrld_igs012; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_drgnwrld_igs012; + MC68000.m1.WriteByte = IGS011.MWriteByte_drgnwrld_igs012; + MC68000.m1.WriteWord = IGS011.MWriteWord_drgnwrld_igs012; + MC68000.m1.WriteLong = IGS011.MWriteLong_drgnwrld_igs012; + break; + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv40k": + MC68000.m1.ReadOpByte = IGS011.MReadByte_drgnwrld_igs012; + MC68000.m1.ReadByte = IGS011.MReadByte_drgnwrld_igs012; + MC68000.m1.ReadOpWord = IGS011.MReadWord_drgnwrld_igs012; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_drgnwrld_igs012; + MC68000.m1.ReadOpLong = IGS011.MReadLong_drgnwrld_igs012; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_drgnwrld_igs012; + MC68000.m1.WriteByte = IGS011.MWriteByte_drgnwrld_igs012; + MC68000.m1.WriteWord = IGS011.MWriteWord_drgnwrld_igs012; + MC68000.m1.WriteLong = IGS011.MWriteLong_drgnwrld_igs012; + break; + case "lhb": + case "lhbv33c": + MC68000.m1.ReadOpByte = IGS011.MReadByte_lhb; + MC68000.m1.ReadByte = IGS011.MReadByte_lhb; + MC68000.m1.ReadOpWord = IGS011.MReadWord_lhb; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_lhb; + MC68000.m1.ReadOpLong = IGS011.MReadLong_lhb; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_lhb; + MC68000.m1.WriteByte = IGS011.MWriteByte_lhb; + MC68000.m1.WriteWord = IGS011.MWriteWord_lhb; + MC68000.m1.WriteLong = IGS011.MWriteLong_lhb; + break; + case "dbc": + MC68000.m1.ReadOpByte = IGS011.MReadByte_lhb; + MC68000.m1.ReadByte = IGS011.MReadByte_lhb; + MC68000.m1.ReadOpWord = IGS011.MReadWord_lhb; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_dbc; + MC68000.m1.ReadOpLong = IGS011.MReadLong_lhb; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_lhb; + MC68000.m1.WriteByte = IGS011.MWriteByte_lhb; + MC68000.m1.WriteWord = IGS011.MWriteWord_lhb; + MC68000.m1.WriteLong = IGS011.MWriteLong_lhb; + break; + case "ryukobou": + MC68000.m1.ReadOpByte = IGS011.MReadByte_lhb; + MC68000.m1.ReadByte = IGS011.MReadByte_lhb; + MC68000.m1.ReadOpWord = IGS011.MReadWord_lhb; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_ryukobou; + MC68000.m1.ReadOpLong = IGS011.MReadLong_lhb; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_lhb; + MC68000.m1.WriteByte = IGS011.MWriteByte_lhb; + MC68000.m1.WriteWord = IGS011.MWriteWord_lhb; + MC68000.m1.WriteLong = IGS011.MWriteLong_lhb; + break; + case "lhb2": + MC68000.m1.ReadOpByte = IGS011.MReadOpByte_lhb2; + MC68000.m1.ReadByte = IGS011.MReadByte_lhb2; + MC68000.m1.ReadOpWord = IGS011.MReadOpWord_lhb2; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_lhb2; + MC68000.m1.ReadOpLong = IGS011.MReadOpLong_lhb2; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_lhb2; + MC68000.m1.WriteByte = IGS011.MWriteByte_lhb2; + MC68000.m1.WriteWord = IGS011.MWriteWord_lhb2; + MC68000.m1.WriteLong = IGS011.MWriteLong_lhb2; + break; + case "xymg": + MC68000.m1.ReadOpByte = IGS011.MReadOpByte_xymg; + MC68000.m1.ReadByte = IGS011.MReadByte_xymg; + MC68000.m1.ReadOpWord = IGS011.MReadOpWord_xymg; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_xymg; + MC68000.m1.ReadOpLong = IGS011.MReadOpLong_xymg; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_xymg; + MC68000.m1.WriteByte = IGS011.MWriteByte_xymg; + MC68000.m1.WriteWord = IGS011.MWriteWord_xymg; + MC68000.m1.WriteLong = IGS011.MWriteLong_xymg; + break; + case "wlcc": + MC68000.m1.ReadOpByte = IGS011.MReadOpByte_wlcc; + MC68000.m1.ReadByte = IGS011.MReadByte_wlcc; + MC68000.m1.ReadOpWord = IGS011.MReadOpWord_wlcc; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_wlcc; + MC68000.m1.ReadOpLong = IGS011.MReadOpLong_wlcc; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_wlcc; + MC68000.m1.WriteByte = IGS011.MWriteByte_wlcc; + MC68000.m1.WriteWord = IGS011.MWriteWord_wlcc; + MC68000.m1.WriteLong = IGS011.MWriteLong_wlcc; + break; + case "vbowl": + case "vbowlj": + MC68000.m1.ReadOpByte = IGS011.MReadOpByte_vbowl; + MC68000.m1.ReadByte = IGS011.MReadByte_vbowl; + MC68000.m1.ReadOpWord = IGS011.MReadOpWord_vbowl; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_vbowl; + MC68000.m1.ReadOpLong = IGS011.MReadOpLong_vbowl; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_vbowl; + MC68000.m1.WriteByte = IGS011.MWriteByte_vbowl; + MC68000.m1.WriteWord = IGS011.MWriteWord_vbowl; + MC68000.m1.WriteLong = IGS011.MWriteLong_vbowl; + break; + case "nkishusp": + MC68000.m1.ReadOpByte = IGS011.MReadOpByte_nkishusp; + MC68000.m1.ReadByte = IGS011.MReadByte_nkishusp; + MC68000.m1.ReadOpWord = IGS011.MReadOpWord_nkishusp; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = IGS011.MReadWord_nkishusp; + MC68000.m1.ReadOpLong = IGS011.MReadOpLong_nkishusp; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = IGS011.MReadLong_nkishusp; + MC68000.m1.WriteByte = IGS011.MWriteByte_nkishusp; + MC68000.m1.WriteWord = IGS011.MWriteWord_nkishusp; + MC68000.m1.WriteLong = IGS011.MWriteLong_nkishusp; + break; + } + break; + case "PGM": + MC68000.m1.ReadOpByte = PGM.MReadOpByte; + MC68000.m1.ReadByte = PGM.MReadByte; + MC68000.m1.ReadOpWord = PGM.MReadOpWord; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = PGM.MReadWord; + MC68000.m1.ReadOpLong = PGM.MReadOpLong; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = PGM.MReadLong; + MC68000.m1.WriteByte = PGM.MWriteByte; + MC68000.m1.WriteWord = PGM.MWriteWord; + MC68000.m1.WriteLong = PGM.MWriteLong; + Z80A.zz1[0].ReadOp = PGM.ZReadMemory; + Z80A.zz1[0].ReadOpArg = PGM.ZReadMemory; + Z80A.zz1[0].ReadMemory = PGM.ZReadMemory; + Z80A.zz1[0].WriteMemory = PGM.ZWriteMemory; + Z80A.zz1[0].ReadHardware = PGM.ZReadHardware; + Z80A.zz1[0].WriteHardware = PGM.ZWriteHardware; + Z80A.zz1[0].IRQCallback = PGM.ZIRQCallback; + switch (Machine.sName) + { + case "orlegend": + case "orlegende": + case "orlegendc": + case "orlegendca": + case "orlegend111c": + case "orlegend111t": + case "orlegend111k": + case "orlegend105k": + MC68000.m1.ReadByte = PGM.MPReadByte_orlegend; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = PGM.MPReadWord_orlegend; + MC68000.m1.WriteByte = PGM.MPWriteByte_orlegend; + MC68000.m1.WriteWord = PGM.MPWriteWord_orlegend; + break; + /*case "drgw2": + MC68000.m1.ReadByte = PGM.MPReadByte_drgw2; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord= PGM.MPReadWord_drgw2; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong= PGM.MPReadLong_drgw2; + MC68000.m1.WriteByte = PGM.MPWriteByte_drgw2; + MC68000.m1.WriteWord = PGM.MPWriteWord_drgw2; + MC68000.m1.WriteLong = PGM.MPWriteLong_drgw2; + break;*/ + } + break; + case "M72": + Nec.nn1[0].ReadOp = Nec.nn1[0].ReadOpArg = M72.NReadOpByte; + Nec.nn1[0].ReadByte = M72.NReadByte_m72; + Nec.nn1[0].ReadWord = M72.NReadWord_m72; + Nec.nn1[0].WriteByte = M72.NWriteByte_m72; + Nec.nn1[0].WriteWord = M72.NWriteWord_m72; + Nec.nn1[0].ReadIOByte = M72.NReadIOByte; + Nec.nn1[0].ReadIOWord = M72.NReadIOWord; + Nec.nn1[0].WriteIOByte = M72.NWriteIOByte_m72; + Nec.nn1[0].WriteIOWord = M72.NWriteIOWord_m72; + Z80A.zz1[0].ReadOp = M72.ZReadMemory_ram; + Z80A.zz1[0].ReadOpArg = M72.ZReadMemory_ram; + Z80A.zz1[0].ReadMemory = M72.ZReadMemory_ram; + Z80A.zz1[0].WriteMemory = M72.ZWriteMemory_ram; + Z80A.zz1[0].ReadHardware = M72.ZReadHardware; + Z80A.zz1[0].WriteHardware = M72.ZWriteHardware; + Z80A.zz1[0].IRQCallback = M72.ZIRQCallback; + switch (Machine.sName) + { + case "airduel": + case "airduelm72": + Nec.nn1[0].ReadOp = Nec.nn1[0].ReadOpArg = M72.NReadOpByte_airduel; + Nec.nn1[0].ReadByte = M72.NReadByte_m72_airduel; + Nec.nn1[0].ReadWord = M72.NReadWord_m72_airduel; + Nec.nn1[0].WriteByte = M72.NWriteByte_m72_airduel; + Nec.nn1[0].WriteWord = M72.NWriteWord_m72_airduel; + Nec.nn1[0].WriteIOByte = M72.NWriteIOByte_m72_airduel; + Nec.nn1[0].WriteIOWord = M72.NWriteIOWord_m72_airduel; + break; + case "ltswords": + case "kengo": + case "kengoa": + Nec.nn1[0].ReadByte = M72.NReadByte_kengo; + Nec.nn1[0].ReadWord = M72.NReadWord_kengo; + Nec.nn1[0].WriteByte = M72.NWriteByte_kengo; + Nec.nn1[0].WriteWord = M72.NWriteWord_kengo; + Nec.nn1[0].WriteIOByte = M72.NWriteIOByte_kengo; + Nec.nn1[0].WriteIOWord = M72.NWriteIOWord_kengo; + Z80A.zz1[0].ReadOp = M72.ZReadMemory_rom; + Z80A.zz1[0].ReadOpArg = M72.ZReadMemory_rom; + Z80A.zz1[0].ReadMemory = M72.ZReadMemory_rom; + Z80A.zz1[0].WriteMemory = M72.ZWriteMemory_rom; + Z80A.zz1[0].ReadHardware = M72.ZReadHardware_rtype2; + Z80A.zz1[0].WriteHardware = M72.ZWriteHardware_rtype2; + Nec.nn1[0].v25v35_decryptiontable = M72.gunforce_decryption_table; + break; + default: + Nec.nn1[0].v25v35_decryptiontable = null; + break; + } + break; + case "M92": + Nec.nn1[0].ReadOp = Nec.nn1[0].ReadOpArg = M92.N0ReadOpByte; + Nec.nn1[0].ReadByte = M92.N0ReadByte_m92; + Nec.nn1[0].ReadWord = M92.N0ReadWord_m92; + Nec.nn1[0].WriteByte = M92.N0WriteByte_m92; + Nec.nn1[0].WriteWord = M92.N0WriteWord_m92; + Nec.nn1[0].ReadIOByte = M92.N0ReadIOByte_m92; + Nec.nn1[0].ReadIOWord = M92.N0ReadIOWord_m92; + Nec.nn1[0].WriteIOByte = M92.N0WriteIOByte_m92; + Nec.nn1[0].WriteIOWord = M92.N0WriteIOWord_m92; + Nec.nn1[1].ReadOp = Nec.nn1[1].ReadOpArg = M92.N1ReadOpByte; + Nec.nn1[1].ReadByte = M92.N1ReadByte; + Nec.nn1[1].ReadWord = M92.N1ReadWord; + Nec.nn1[1].WriteByte = M92.N1WriteByte; + Nec.nn1[1].WriteWord = M92.N1WriteWord; + Nec.nn1[1].ReadIOByte = null_callback1; + Nec.nn1[1].ReadIOWord = null_callback2; + Nec.nn1[1].WriteIOByte = null_callback; + Nec.nn1[1].WriteIOWord = null_callback; + Nec.nn1[0].v25v35_decryptiontable = null; + switch (Machine.sName) + { + case "gunforce": + case "gunforcej": + case "gunforceu": + Nec.nn1[1].v25v35_decryptiontable = M92.gunforce_decryption_table; + break; + case "bmaster": + case "crossbld": + Nec.nn1[1].v25v35_decryptiontable = M92.bomberman_decryption_table; + break; + case "lethalth": + case "thndblst": + Nec.nn1[0].ReadByte = M92.N0ReadByte_lethalth; + Nec.nn1[0].ReadWord = M92.N0ReadWord_lethalth; + Nec.nn1[0].WriteByte = M92.N0WriteByte_lethalth; + Nec.nn1[0].WriteWord = M92.N0WriteWord_lethalth; + Nec.nn1[0].WriteIOByte = M92.N0WriteIOByte_lethalth; + Nec.nn1[0].WriteIOWord = M92.N0WriteIOWord_lethalth; + Nec.nn1[1].v25v35_decryptiontable = M92.lethalth_decryption_table; + break; + case "uccops": + case "uccopsu": + case "uccopsar": + case "uccopsj": + Nec.nn1[1].v25v35_decryptiontable = M92.dynablaster_decryption_table; + break; + case "mysticri": + case "gunhohki": + case "mysticrib": + Nec.nn1[1].v25v35_decryptiontable = M92.mysticri_decryption_table; + break; + case "majtitl2": + case "majtitl2a": + case "majtitl2b": + case "majtitl2j": + case "skingame": + case "skingame2": + Nec.nn1[0].ReadByte = M92.N0ReadByte_majtitl2; + Nec.nn1[0].ReadWord = M92.N0ReadWord_majtitl2; + Nec.nn1[0].WriteByte = M92.N0WriteByte_majtitl2; + Nec.nn1[0].WriteWord = M92.N0WriteWord_majtitl2; + Nec.nn1[1].v25v35_decryptiontable = M92.majtitl2_decryption_table; + break; + case "hook": + case "hooku": + case "hookj": + Nec.nn1[1].v25v35_decryptiontable = M92.hook_decryption_table; + break; + case "rtypeleo": + case "rtypeleoj": + Nec.nn1[1].v25v35_decryptiontable = M92.rtypeleo_decryption_table; + break; + case "inthunt": + case "inthuntu": + case "kaiteids": + Nec.nn1[1].v25v35_decryptiontable = M92.inthunt_decryption_table; + break; + case "nbbatman": + case "nbbatmanu": + case "leaguemn": + Nec.nn1[1].v25v35_decryptiontable = M92.leagueman_decryption_table; + break; + case "ssoldier": + case "psoldier": + Nec.nn1[1].v25v35_decryptiontable = M92.psoldier_decryption_table; + break; + case "gunforc2": + case "geostorm": + Nec.nn1[1].v25v35_decryptiontable = M92.lethalth_decryption_table; + break; + default: + Nec.nn1[1].v25v35_decryptiontable = null; + break; + } + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + Z80A.zz1[0].ReadOp = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadOpArg = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadMemory = Taito.Z0ReadMemory_tokio; + Z80A.zz1[0].WriteMemory = Taito.Z0WriteMemory_tokio; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Taito.Z1ReadOp_tokio; + Z80A.zz1[1].ReadOpArg = Taito.Z1ReadOp_tokio; + Z80A.zz1[1].ReadMemory = Taito.Z1ReadMemory_tokio; + Z80A.zz1[1].WriteMemory = Taito.Z1WriteMemory_tokio; + Z80A.zz1[1].ReadHardware = Taito.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Taito.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Taito.Z1IRQCallback; + Z80A.zz1[2].ReadOp = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadOpArg = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadMemory = Taito.Z2ReadMemory_tokio; + Z80A.zz1[2].WriteMemory = Taito.Z2WriteMemory_tokio; + Z80A.zz1[2].ReadHardware = Taito.Z2ReadHardware; + Z80A.zz1[2].WriteHardware = Taito.Z2WriteHardware; + Z80A.zz1[2].IRQCallback = Taito.Z2IRQCallback; + break; + case "tokiob": + Z80A.zz1[0].ReadOp = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadOpArg = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadMemory = Taito.Z0ReadMemory_tokiob; + Z80A.zz1[0].WriteMemory = Taito.Z0WriteMemory_tokio; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Taito.Z1ReadOp_tokio; + Z80A.zz1[1].ReadOpArg = Taito.Z1ReadOp_tokio; + Z80A.zz1[1].ReadMemory = Taito.Z1ReadMemory_tokio; + Z80A.zz1[1].WriteMemory = Taito.Z1WriteMemory_tokio; + Z80A.zz1[1].ReadHardware = Taito.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Taito.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Taito.Z1IRQCallback; + Z80A.zz1[2].ReadOp = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadOpArg = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadMemory = Taito.Z2ReadMemory_tokio; + Z80A.zz1[2].WriteMemory = Taito.Z2WriteMemory_tokio; + Z80A.zz1[2].ReadHardware = Taito.Z2ReadHardware; + Z80A.zz1[2].WriteHardware = Taito.Z2WriteHardware; + Z80A.zz1[2].IRQCallback = Taito.Z2IRQCallback; + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "bublcave": + case "bublcave11": + case "bublcave10": + Z80A.zz1[0].ReadOp = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadOpArg = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadMemory = Taito.Z0ReadMemory_bublbobl; + Z80A.zz1[0].WriteMemory = Taito.Z0WriteMemory_bublbobl; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Taito.Z1ReadOp_bublbobl; + Z80A.zz1[1].ReadOpArg = Taito.Z1ReadOp_bublbobl; + Z80A.zz1[1].ReadMemory = Taito.Z1ReadMemory_bublbobl; + Z80A.zz1[1].WriteMemory = Taito.Z1WriteMemory_bublbobl; + Z80A.zz1[1].ReadHardware = Taito.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Taito.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Taito.Z1IRQCallback; + Z80A.zz1[2].ReadOp = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadOpArg = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadMemory = Taito.Z2ReadMemory_bublbobl; + Z80A.zz1[2].WriteMemory = Taito.Z2WriteMemory_bublbobl; + Z80A.zz1[2].ReadHardware = Taito.Z2ReadHardware; + Z80A.zz1[2].WriteHardware = Taito.Z2WriteHardware; + Z80A.zz1[2].IRQCallback = Taito.Z2IRQCallback; + M6800.m1.ReadOp = Taito.MReadOp_bublbobl; + M6800.m1.ReadOpArg = Taito.MReadOp_bublbobl; + M6800.m1.ReadMemory = Taito.MReadMemory_bublbobl; + M6800.m1.WriteMemory = Taito.MWriteMemory_bublbobl; + M6800.m1.ReadIO = Taito.MReadHardware; + M6800.m1.WriteIO = Taito.MWriteHardware; + break; + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "dland": + case "bbredux": + case "bublboblb": + case "boblcave": + Z80A.zz1[0].ReadOp = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadOpArg = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadMemory = Taito.Z0ReadMemory_bootleg; + Z80A.zz1[0].WriteMemory = Taito.Z0WriteMemory_bootleg; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Taito.Z1ReadOp_bublbobl; + Z80A.zz1[1].ReadOpArg = Taito.Z1ReadOp_bublbobl; + Z80A.zz1[1].ReadMemory = Taito.Z1ReadMemory_bublbobl; + Z80A.zz1[1].WriteMemory = Taito.Z1WriteMemory_bublbobl; + Z80A.zz1[1].ReadHardware = Taito.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Taito.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Taito.Z1IRQCallback; + Z80A.zz1[2].ReadOp = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadOpArg = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadMemory = Taito.Z2ReadMemory_bublbobl; + Z80A.zz1[2].WriteMemory = Taito.Z2WriteMemory_bublbobl; + Z80A.zz1[2].ReadHardware = Taito.Z2ReadHardware; + Z80A.zz1[2].WriteHardware = Taito.Z2WriteHardware; + Z80A.zz1[2].IRQCallback = Taito.Z2IRQCallback; + break; + case "bub68705": + Z80A.zz1[0].ReadOp = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadOpArg = Taito.Z0ReadOp_bublbobl; + Z80A.zz1[0].ReadMemory = Taito.Z0ReadMemory_bublbobl; + Z80A.zz1[0].WriteMemory = Taito.Z0WriteMemory_bublbobl; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Taito.Z1ReadOp_bublbobl; + Z80A.zz1[1].ReadOpArg = Taito.Z1ReadOp_bublbobl; + Z80A.zz1[1].ReadMemory = Taito.Z1ReadMemory_bublbobl; + Z80A.zz1[1].WriteMemory = Taito.Z1WriteMemory_bublbobl; + Z80A.zz1[1].ReadHardware = Taito.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Taito.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Taito.Z1IRQCallback; + Z80A.zz1[2].ReadOp = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadOpArg = Taito.Z2ReadOp_bublbobl; + Z80A.zz1[2].ReadMemory = Taito.Z2ReadMemory_bublbobl; + Z80A.zz1[2].WriteMemory = Taito.Z2WriteMemory_bublbobl; + Z80A.zz1[2].ReadHardware = Taito.Z2ReadHardware; + Z80A.zz1[2].WriteHardware = Taito.Z2WriteHardware; + Z80A.zz1[2].IRQCallback = Taito.Z2IRQCallback; + M6805.m1.ReadOp = Taito.MReadOp_bootleg; + M6805.m1.ReadOpArg = Taito.MReadOp_bootleg; + M6805.m1.ReadMemory = Taito.MReadMemory_bootleg; + M6805.m1.WriteMemory = Taito.MWriteMemory_bootleg; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + MC68000.m1.ReadOpByte = Taito.MReadOpByte_opwolf; + MC68000.m1.ReadByte = Taito.MReadByte_opwolf; + MC68000.m1.ReadOpWord = Taito.MReadOpWord_opwolf; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Taito.MReadWord_opwolf; + MC68000.m1.ReadOpLong = Taito.MReadOpLong_opwolf; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Taito.MReadLong_opwolf; + MC68000.m1.WriteByte = Taito.MWriteByte_opwolf; + MC68000.m1.WriteWord = Taito.MWriteWord_opwolf; + MC68000.m1.WriteLong = Taito.MWriteLong_opwolf; + Z80A.zz1[0].ReadOp = Taito.ZReadOp_opwolf; + Z80A.zz1[0].ReadOpArg = Taito.ZReadOp_opwolf; + Z80A.zz1[0].ReadMemory = Taito.ZReadMemory_opwolf; + Z80A.zz1[0].WriteMemory = Taito.ZWriteMemory_opwolf; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + break; + case "opwolfb": + MC68000.m1.ReadOpByte = Taito.MReadOpByte_opwolf; + MC68000.m1.ReadByte = Taito.MReadByte_opwolfb; + MC68000.m1.ReadOpWord = Taito.MReadOpWord_opwolf; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Taito.MReadWord_opwolfb; + MC68000.m1.ReadOpLong = Taito.MReadOpLong_opwolf; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Taito.MReadLong_opwolfb; + MC68000.m1.WriteByte = Taito.MWriteByte_opwolfb; + MC68000.m1.WriteWord = Taito.MWriteWord_opwolfb; + MC68000.m1.WriteLong = Taito.MWriteLong_opwolfb; + Z80A.zz1[0].ReadOp = Taito.ZReadOp_opwolf; + Z80A.zz1[0].ReadOpArg = Taito.ZReadOp_opwolf; + Z80A.zz1[0].ReadMemory = Taito.ZReadMemory_opwolf; + Z80A.zz1[0].WriteMemory = Taito.ZWriteMemory_opwolf; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Taito.ZReadOp_opwolf_sub; + Z80A.zz1[1].ReadOpArg = Taito.ZReadOp_opwolf_sub; + Z80A.zz1[1].ReadMemory = Taito.ZReadMemory_opwolf_sub; + Z80A.zz1[1].WriteMemory = Taito.ZWriteMemory_opwolf_sub; + Z80A.zz1[1].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[1].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[1].IRQCallback = Taito.Z1IRQCallback; + break; + case "opwolfp": + MC68000.m1.ReadOpByte = Taito.MReadOpByte_opwolf; + MC68000.m1.ReadByte = Taito.MReadByte_opwolfp; + MC68000.m1.ReadOpWord = Taito.MReadOpWord_opwolf; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Taito.MReadWord_opwolfp; + MC68000.m1.ReadOpLong = Taito.MReadOpLong_opwolf; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Taito.MReadLong_opwolfp; + MC68000.m1.WriteByte = Taito.MWriteByte_opwolfp; + MC68000.m1.WriteWord = Taito.MWriteWord_opwolfp; + MC68000.m1.WriteLong = Taito.MWriteLong_opwolfp; + Z80A.zz1[0].ReadOp = Taito.ZReadOp_opwolf; + Z80A.zz1[0].ReadOpArg = Taito.ZReadOp_opwolf; + Z80A.zz1[0].ReadMemory = Taito.ZReadMemory_opwolf; + Z80A.zz1[0].WriteMemory = Taito.ZWriteMemory_opwolf; + Z80A.zz1[0].ReadHardware = Taito.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Taito.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Taito.Z0IRQCallback; + break; + } + break; + case "Taito B": + Z80A.zz1[0].ReadOp = Taitob.ZReadOp; + Z80A.zz1[0].ReadOpArg = Taitob.ZReadOp; + Z80A.zz1[0].ReadMemory = Taitob.ZReadMemory; + Z80A.zz1[0].WriteMemory = Taitob.ZWriteMemory; + Z80A.zz1[0].ReadHardware = Taitob.ZReadHardware; + Z80A.zz1[0].WriteHardware = Taitob.ZWriteHardware; + Z80A.zz1[0].IRQCallback = Taitob.ZIRQCallback; + switch (Machine.sName) + { + case "pbobble": + MC68000.m1.ReadOpByte = Taitob.MReadOpByte_pbobble; + MC68000.m1.ReadByte = Taitob.MReadByte_pbobble; + MC68000.m1.ReadOpWord = Taitob.MReadOpWord_pbobble; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Taitob.MReadWord_pbobble; + MC68000.m1.ReadOpLong = Taitob.MReadOpLong_pbobble; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Taitob.MReadLong_pbobble; + MC68000.m1.WriteByte = Taitob.MWriteByte_pbobble; + MC68000.m1.WriteWord = Taitob.MWriteWord_pbobble; + MC68000.m1.WriteLong = Taitob.MWriteLong_pbobble; + break; + case "silentd": + case "silentdj": + case "silentdu": + MC68000.m1.ReadOpByte = Taitob.MReadOpByte_silentd; + MC68000.m1.ReadByte = Taitob.MReadByte_silentd; + MC68000.m1.ReadOpWord = Taitob.MReadOpWord_silentd; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Taitob.MReadWord_silentd; + MC68000.m1.ReadOpLong = Taitob.MReadOpLong_silentd; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Taitob.MReadLong_silentd; + MC68000.m1.WriteByte = Taitob.MWriteByte_silentd; + MC68000.m1.WriteWord = Taitob.MWriteWord_silentd; + MC68000.m1.WriteLong = Taitob.MWriteLong_silentd; + break; + } + break; + case "Konami 68000": + Z80A.zz1[0].ReadHardware = Konami68000.ZReadHardware; + Z80A.zz1[0].WriteHardware = Konami68000.ZWriteHardware; + Z80A.zz1[0].IRQCallback = Konami68000.ZIRQCallback; + switch (Machine.sName) + { + case "cuebrick": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_cuebrick; + MC68000.m1.ReadByte = Konami68000.MReadByte_cuebrick; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_cuebrick; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_cuebrick; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_cuebrick; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_cuebrick; + MC68000.m1.WriteByte = Konami68000.MWriteByte_cuebrick; + MC68000.m1.WriteWord = Konami68000.MWriteWord_cuebrick; + MC68000.m1.WriteLong = Konami68000.MWriteLong_cuebrick; + break; + case "mia": + case "mia2": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_mia; + MC68000.m1.ReadByte = Konami68000.MReadByte_mia; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_mia; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_mia; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_mia; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_mia; + MC68000.m1.WriteByte = Konami68000.MWriteByte_mia; + MC68000.m1.WriteWord = Konami68000.MWriteWord_mia; + MC68000.m1.WriteLong = Konami68000.MWriteLong_mia; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_mia; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_mia; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_mia; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_mia; + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_tmnt; + MC68000.m1.ReadByte = Konami68000.MReadByte_tmnt; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_tmnt; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_tmnt; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_tmnt; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_tmnt; + MC68000.m1.WriteByte = Konami68000.MWriteByte_tmnt; + MC68000.m1.WriteWord = Konami68000.MWriteWord_tmnt; + MC68000.m1.WriteLong = Konami68000.MWriteLong_tmnt; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_tmnt; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_tmnt; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_tmnt; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_tmnt; + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_punkshot; + MC68000.m1.ReadByte = Konami68000.MReadByte_punkshot; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_punkshot; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_punkshot; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_punkshot; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_punkshot; + MC68000.m1.WriteByte = Konami68000.MWriteByte_punkshot; + MC68000.m1.WriteWord = Konami68000.MWriteWord_punkshot; + MC68000.m1.WriteLong = Konami68000.MWriteLong_punkshot; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_punkshot; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_punkshot; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_punkshot; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_punkshot; + break; + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_lgtnfght; + MC68000.m1.ReadByte = Konami68000.MReadByte_lgtnfght; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_lgtnfght; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_lgtnfght; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_lgtnfght; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_lgtnfght; + MC68000.m1.WriteByte = Konami68000.MWriteByte_lgtnfght; + MC68000.m1.WriteWord = Konami68000.MWriteWord_lgtnfght; + MC68000.m1.WriteLong = Konami68000.MWriteLong_lgtnfght; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_lgtnfght; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_lgtnfght; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_lgtnfght; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_lgtnfght; + break; + case "blswhstl": + case "blswhstla": + case "detatwin": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_blswhstl; + MC68000.m1.ReadByte = Konami68000.MReadByte_blswhstl; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_blswhstl; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_blswhstl; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_blswhstl; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_blswhstl; + MC68000.m1.WriteByte = Konami68000.MWriteByte_blswhstl; + MC68000.m1.WriteWord = Konami68000.MWriteWord_blswhstl; + MC68000.m1.WriteLong = Konami68000.MWriteLong_blswhstl; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_ssriders; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_ssriders; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_ssriders; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_ssriders; + break; + case "glfgreat": + case "glfgreatj": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_glfgreat; + MC68000.m1.ReadByte = Konami68000.MReadByte_glfgreat; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_glfgreat; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_glfgreat; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_glfgreat; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_glfgreat; + MC68000.m1.WriteByte = Konami68000.MWriteByte_glfgreat; + MC68000.m1.WriteWord = Konami68000.MWriteWord_glfgreat; + MC68000.m1.WriteLong = Konami68000.MWriteLong_glfgreat; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_glfgreat; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_glfgreat; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_glfgreat; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_glfgreat; + break; + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_tmnt2; + MC68000.m1.ReadByte = Konami68000.MReadByte_tmnt2; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_tmnt2; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_tmnt2; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_tmnt2; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_tmnt2; + MC68000.m1.WriteByte = Konami68000.MWriteByte_tmnt2; + MC68000.m1.WriteWord = Konami68000.MWriteWord_tmnt2; + MC68000.m1.WriteLong = Konami68000.MWriteLong_tmnt2; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_ssriders; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_ssriders; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_ssriders; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_ssriders; + break; + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_ssriders; + MC68000.m1.ReadByte = Konami68000.MReadByte_ssriders; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_ssriders; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_ssriders; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_ssriders; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_ssriders; + MC68000.m1.WriteByte = Konami68000.MWriteByte_ssriders; + MC68000.m1.WriteWord = Konami68000.MWriteWord_ssriders; + MC68000.m1.WriteLong = Konami68000.MWriteLong_ssriders; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_ssriders; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_ssriders; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_ssriders; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_ssriders; + break; + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_thndrx2; + MC68000.m1.ReadByte = Konami68000.MReadByte_thndrx2; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_thndrx2; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_thndrx2; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_thndrx2; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_thndrx2; + MC68000.m1.WriteByte = Konami68000.MWriteByte_thndrx2; + MC68000.m1.WriteWord = Konami68000.MWriteWord_thndrx2; + MC68000.m1.WriteLong = Konami68000.MWriteLong_thndrx2; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_thndrx2; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_thndrx2; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_thndrx2; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_thndrx2; + break; + case "prmrsocr": + case "prmrsocrj": + MC68000.m1.ReadOpByte = Konami68000.MReadOpByte_prmrsocr; + MC68000.m1.ReadByte = Konami68000.MReadByte_prmrsocr; + MC68000.m1.ReadOpWord = Konami68000.MReadOpWord_prmrsocr; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Konami68000.MReadWord_prmrsocr; + MC68000.m1.ReadOpLong = Konami68000.MReadOpLong_prmrsocr; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Konami68000.MReadLong_prmrsocr; + MC68000.m1.WriteByte = Konami68000.MWriteByte_prmrsocr; + MC68000.m1.WriteWord = Konami68000.MWriteWord_prmrsocr; + MC68000.m1.WriteLong = Konami68000.MWriteLong_prmrsocr; + Z80A.zz1[0].ReadOp = Konami68000.ZReadOp_prmrsocr; + Z80A.zz1[0].ReadOpArg = Konami68000.ZReadOp_prmrsocr; + Z80A.zz1[0].ReadMemory = Konami68000.ZReadMemory_prmrsocr; + Z80A.zz1[0].WriteMemory = Konami68000.ZWriteMemory_prmrsocr; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + M6809.mm1[0].ReadOp = Capcom.MReadOpByte_gng; + M6809.mm1[0].ReadOpArg = Capcom.MReadOpByte_gng; + M6809.mm1[0].RM = Capcom.MReadByte_gng; + M6809.mm1[0].WM = Capcom.MWriteByte_gng; + Z80A.zz1[0].ReadOp = Capcom.ZReadOp_gng; + Z80A.zz1[0].ReadOpArg = Capcom.ZReadOp_gng; + Z80A.zz1[0].ReadMemory = Capcom.ZReadMemory_gng; + Z80A.zz1[0].WriteMemory = Capcom.ZWriteMemory_gng; + Z80A.zz1[0].ReadHardware = Capcom.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Capcom.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Capcom.Z0IRQCallback; + break; + case "diamond": + M6809.mm1[0].ReadOp = Capcom.MReadOpByte_gng; + M6809.mm1[0].ReadOpArg = Capcom.MReadOpByte_gng; + M6809.mm1[0].RM = Capcom.MReadByte_diamond; + M6809.mm1[0].WM = Capcom.MWriteByte_gng; + Z80A.zz1[0].ReadOp = Capcom.ZReadOp_gng; + Z80A.zz1[0].ReadOpArg = Capcom.ZReadOp_gng; + Z80A.zz1[0].ReadMemory = Capcom.ZReadMemory_gng; + Z80A.zz1[0].WriteMemory = Capcom.ZWriteMemory_gng; + Z80A.zz1[0].ReadHardware = Capcom.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Capcom.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Capcom.Z0IRQCallback; + break; + case "sf": + MC68000.m1.ReadOpByte = Capcom.MReadOpByte_sfus; + MC68000.m1.ReadByte = Capcom.MReadByte_sfus; + MC68000.m1.ReadOpWord = Capcom.MReadOpWord_sfus; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Capcom.MReadWord_sfus; + MC68000.m1.ReadOpLong = Capcom.MReadOpLong_sfus; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Capcom.MReadLong_sfus; + MC68000.m1.WriteByte = Capcom.MWriteByte_sf; + MC68000.m1.WriteWord = Capcom.MWriteWord_sf; + MC68000.m1.WriteLong = Capcom.MWriteLong_sf; + Z80A.zz1[0].ReadOp = Capcom.Z0ReadOp_sf; + Z80A.zz1[0].ReadOpArg = Capcom.Z0ReadOp_sf; + Z80A.zz1[0].ReadMemory = Capcom.Z0ReadMemory_sf; + Z80A.zz1[0].WriteMemory = Capcom.Z0WriteMemory_sf; + Z80A.zz1[0].ReadHardware = Capcom.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Capcom.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Capcom.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Capcom.Z1ReadOp_sf; + Z80A.zz1[1].ReadOpArg = Capcom.Z1ReadOp_sf; + Z80A.zz1[1].ReadMemory = Capcom.Z1ReadMemory_sf; + Z80A.zz1[1].WriteMemory = Capcom.Z1WriteMemory_sf; + Z80A.zz1[1].ReadHardware = Capcom.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Capcom.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Capcom.Z1IRQCallback; + break; + case "sfua": + case "sfj": + MC68000.m1.ReadOpByte = Capcom.MReadByte_sfjp; + MC68000.m1.ReadByte = Capcom.MReadByte_sfjp; + MC68000.m1.ReadOpWord = Capcom.MReadOpWord_sfus; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Capcom.MReadWord_sfjp; + MC68000.m1.ReadOpLong = Capcom.MReadOpLong_sfus; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Capcom.MReadLong_sfus; + MC68000.m1.WriteByte = Capcom.MWriteByte_sf; + MC68000.m1.WriteWord = Capcom.MWriteWord_sf; + MC68000.m1.WriteLong = Capcom.MWriteLong_sf; + Z80A.zz1[0].ReadOp = Capcom.Z0ReadOp_sf; + Z80A.zz1[0].ReadOpArg = Capcom.Z0ReadOp_sf; + Z80A.zz1[0].ReadMemory = Capcom.Z0ReadMemory_sf; + Z80A.zz1[0].WriteMemory = Capcom.Z0WriteMemory_sf; + Z80A.zz1[0].ReadHardware = Capcom.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Capcom.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Capcom.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Capcom.Z1ReadOp_sf; + Z80A.zz1[1].ReadOpArg = Capcom.Z1ReadOp_sf; + Z80A.zz1[1].ReadMemory = Capcom.Z1ReadMemory_sf; + Z80A.zz1[1].WriteMemory = Capcom.Z1WriteMemory_sf; + Z80A.zz1[1].ReadHardware = Capcom.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Capcom.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Capcom.Z1IRQCallback; + break; + case "sfjan": + case "sfan": + case "sfp": + MC68000.m1.ReadOpByte = Capcom.MReadByte_sf; + MC68000.m1.ReadByte = Capcom.MReadByte_sf; + MC68000.m1.ReadOpWord = Capcom.MReadOpWord_sfus; + MC68000.m1.ReadWord = MC68000.m1.ReadPcrelWord = Capcom.MReadWord_sf; + MC68000.m1.ReadOpLong = Capcom.MReadOpLong_sfus; + MC68000.m1.ReadLong = MC68000.m1.ReadPcrelLong = Capcom.MReadLong_sfus; + MC68000.m1.WriteByte = Capcom.MWriteByte_sf; + MC68000.m1.WriteWord = Capcom.MWriteWord_sf; + MC68000.m1.WriteLong = Capcom.MWriteLong_sf; + MC68000.m1.WriteByte = Capcom.MWriteByte_sf; + MC68000.m1.WriteWord = Capcom.MWriteWord_sf; + MC68000.m1.WriteLong = Capcom.MWriteLong_sf; + Z80A.zz1[0].ReadOp = Capcom.Z0ReadOp_sf; + Z80A.zz1[0].ReadOpArg = Capcom.Z0ReadOp_sf; + Z80A.zz1[0].ReadMemory = Capcom.Z0ReadMemory_sf; + Z80A.zz1[0].WriteMemory = Capcom.Z0WriteMemory_sf; + Z80A.zz1[0].ReadHardware = Capcom.Z0ReadHardware; + Z80A.zz1[0].WriteHardware = Capcom.Z0WriteHardware; + Z80A.zz1[0].IRQCallback = Capcom.Z0IRQCallback; + Z80A.zz1[1].ReadOp = Capcom.Z1ReadOp_sf; + Z80A.zz1[1].ReadOpArg = Capcom.Z1ReadOp_sf; + Z80A.zz1[1].ReadMemory = Capcom.Z1ReadMemory_sf; + Z80A.zz1[1].WriteMemory = Capcom.Z1WriteMemory_sf; + Z80A.zz1[1].ReadHardware = Capcom.Z1ReadHardware; + Z80A.zz1[1].WriteHardware = Capcom.Z1WriteHardware; + Z80A.zz1[1].IRQCallback = Capcom.Z1IRQCallback; + break; + } + break; + } + cpu_inittimers(); + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + case "Neo Geo": + case "PGM": + case "Taito B": + break; + case "Tehkan": + break; + case "IGS011": + break; + case "SunA8": + break; + case "Namco System 1": + //M6809.mm1[0].DisassemblerInit(); + break; + case "M72": + break; + case "M92": + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfp": + break; + case "opwolfb": + break; + } + break; + case "Konami 68000": + switch (Machine.sName) + { + case "cuebrick": + default: + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + break; + } + break; + } + for (icpu = 0; icpu < ncpu; icpu++) + { + cpu[icpu].Reset(); + } + } + public static void null_callback() + { + + } + public static void trigger2() + { + if (iloops2 == 0) + { + iloops2 = 4; + } + iloops2--; + Generic.irq_1_0_line_hold(); + if (iloops2 > 1) + { + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + } + } + public static byte null_callback1(int address) + { + return 0; + } + public static ushort null_callback2(int address) + { + return 0; + } + public static void null_callback(int address, byte value) + { + + } + public static void null_callback(int address, ushort value) + { + + } + private static void cpu_inittimers() + { + switch (Machine.sBoard) + { + case "CPS-1(QSound)": + case "CPS2": + timedint_period = new Atime(0, (long)(1e18 / 250)); + timedint_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Generic_irq_1_0_line_hold, false); + EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); + break; + case "Neo Geo": + interleave_boost_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_null_callback, false); + interleave_boost_timer_end = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_end_interleave_boost, false); + break; + case "CPS1": + case "Namco System 1": + break; + case "IGS011": + /*switch (Machine.sName) + { + case "lhb": + timeslice_period = new Atime(0, Video.screenstate.frame_period); + timeslice_timer = Timer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); + Timer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); + break; + }*/ + break; + case "PGM": + case "M72": + case "M92": + case "Konami 68000": + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + timeslice_period = new Atime(0, Video.screenstate.frame_period / 100); + timeslice_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_cpu_timeslicecallback, false); + EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + timeslice_period = new Atime(0, Video.screenstate.frame_period / 10); + timeslice_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_cpu_timeslicecallback, false); + EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); + break; + } + break; + case "Taito B": + timeslice_period = new Atime(0, Video.screenstate.frame_period / 10); + timeslice_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_cpu_timeslicecallback, false); + EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + timedint_period = new Atime(0, (long)(1e18 / 8000)); + timedint_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Generic_irq_2_0_line_hold, false); + EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); + break; + } + break; + } + } + public static void cpuexec_timeslice() + { + Atime target = EmuTimer.lt[0].expire; + Atime tbase = EmuTimer.global_basetime; + int ran; + Atime at; + int i, j; + for (icpu = 0; icpu < ncpu; icpu++) + { + cpu[icpu].suspend = cpu[icpu].nextsuspend; + cpu[icpu].eatcycles = cpu[icpu].nexteatcycles; + } + for (icpu = 0; icpu < ncpu; icpu++) + { + if (cpu[icpu].suspend == 0) + { + at = Attotime.attotime_sub(target, cpu[icpu].localtime); + cpu[icpu].cycles_running = (int)(at.seconds * cpu[icpu].cycles_per_second + at.attoseconds / cpu[icpu].attoseconds_per_cycle); + if (cpu[icpu].cycles_running > 0) + { + cpu[icpu].cycles_stolen = 0; + activecpu = icpu; + ran = cpu[icpu].ExecuteCycles(cpu[icpu].cycles_running); + activecpu = -1; + ran -= cpu[icpu].cycles_stolen; + cpu[icpu].totalcycles += (ulong)ran; + cpu[icpu].localtime = Attotime.attotime_add(cpu[icpu].localtime, new Atime(ran / cpu[icpu].cycles_per_second, ran * cpu[icpu].attoseconds_per_cycle)); + if (Attotime.attotime_compare(cpu[icpu].localtime, target) < 0) + { + if (Attotime.attotime_compare(cpu[icpu].localtime, tbase) > 0) + target = cpu[icpu].localtime; + else + target = tbase; + } + } + } + } + for (icpu = 0; icpu < ncpu; icpu++) + { + if (cpu[icpu].suspend != 0 && cpu[icpu].eatcycles != 0 && Attotime.attotime_compare(cpu[icpu].localtime, target) < 0) + { + at = Attotime.attotime_sub(target, cpu[icpu].localtime); + cpu[icpu].cycles_running = (int)(at.seconds * cpu[icpu].cycles_per_second + at.attoseconds / cpu[icpu].attoseconds_per_cycle); + cpu[icpu].totalcycles += (ulong)cpu[icpu].cycles_running; + cpu[icpu].localtime = Attotime.attotime_add(cpu[icpu].localtime, new Atime(cpu[icpu].cycles_running / cpu[icpu].cycles_per_second, cpu[icpu].cycles_running * cpu[icpu].attoseconds_per_cycle)); + } + cpu[icpu].suspend = cpu[icpu].nextsuspend; + cpu[icpu].eatcycles = cpu[icpu].nexteatcycles; + } + EmuTimer.timer_set_global_time(target); + //if (EmuTimer.global_basetime.attoseconds == 0 && Machine.mainMotion.cheatmotion.lockState == CheatMotion.LockState.LOCK_SECOND) + //{ + // Machine.mainMotion.cheatmotion.ApplyCheat(); + //} + } + public static void cpu_boost_interleave(Atime timeslice_time, Atime boost_duration) + { + if (Attotime.attotime_compare(timeslice_time, perfect_interleave) < 0) + timeslice_time = perfect_interleave; + EmuTimer.timer_adjust_periodic(interleave_boost_timer, timeslice_time, timeslice_time); + if (!EmuTimer.timer_enabled(interleave_boost_timer_end) || Attotime.attotime_compare(EmuTimer.timer_timeleft(interleave_boost_timer_end), boost_duration) < 0) + EmuTimer.timer_adjust_periodic(interleave_boost_timer_end, boost_duration, Attotime.ATTOTIME_NEVER); + } + public static void activecpu_abort_timeslice(int cpunum) + { + int current_icount; + current_icount = cpu[cpunum].PendingCycles + 1; + cpu[cpunum].cycles_stolen += current_icount; + cpu[cpunum].cycles_running -= current_icount; + cpu[cpunum].PendingCycles = -1; + } + public static void cpunum_suspend(int cpunum, byte reason, byte eatcycles) + { + cpu[cpunum].nextsuspend |= reason; + cpu[cpunum].nexteatcycles = eatcycles; + if (Cpuexec.activecpu >= 0) + { + activecpu_abort_timeslice(Cpuexec.activecpu); + } + } + public static void cpunum_resume(int cpunum, byte reason) + { + cpu[cpunum].nextsuspend &= (byte)(~reason); + if (Cpuexec.activecpu >= 0) + { + activecpu_abort_timeslice(Cpuexec.activecpu); + } + } + public static bool cpunum_is_suspended(int cpunum, byte reason) + { + return ((cpu[cpunum].nextsuspend & reason) != 0); + } + public static Atime cpunum_get_localtime(int cpunum) + { + Atime result; + result = cpu[cpunum].localtime; + int cycles; + cycles = cpu[cpunum].cycles_running - cpu[cpunum].PendingCycles; + result = Attotime.attotime_add(result, new Atime(cycles / cpu[cpunum].cycles_per_second, cycles * cpu[cpunum].attoseconds_per_cycle)); + return result; + } + public static void cpunum_suspend_until_trigger(int cpunum, int trigger, int eatcycles) + { + cpunum_suspend(cpunum, (byte)SUSPEND_REASON_TRIGGER, (byte)eatcycles); + cpu[cpunum].trigger = trigger; + } + public static void cpu_spin() + { + int cpunum = activecpu;//cpu_getexecutingcpu(); + cpunum_suspend_until_trigger(cpunum, -1000, 1); + } + public static void cpu_trigger(int trigger) + { + int cpunum; + if (activecpu >= 0) + { + activecpu_abort_timeslice(activecpu); + } + for (cpunum = 0; cpunum < ncpu; cpunum++) + { + if (cpu[cpunum].suspend != 0 && cpu[cpunum].trigger == trigger) + { + cpunum_resume(cpunum, SUSPEND_REASON_TRIGGER); + cpu[cpunum].trigger = 0; + } + } + } + public static void cpu_triggerint(int cpunum) + { + cpu_trigger(-2000 + cpunum); + } + public static void on_vblank() + { + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + CPS.cps1_interrupt(); + break; + case "CPS2": + iloops = 0; + CPS.cps2_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + case "Data East": + Generic.nmi_line_pulse0(); + break; + case "Tehkan": + iloops = 0; + vblank_interrupt(); + Tehkan.pbaction_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + case "Neo Geo": + break; + case "SunA8": + iloops = 0; + iloops2 = 0; + Generic.irq_1_0_line_hold(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + case "Namco System 1": + for (int cpunum = 0; cpunum < ncpu; cpunum++) + { + //if (!cpunum_is_suspended(cpunum, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Cpuint.cpunum_set_input_line(cpunum, 0, LineState.ASSERT_LINE); + } + } + break; + case "IGS011": + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + iloops = 0; + IGS011.lhb2_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + iloops = 0; + IGS011.lhb_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + } + break; + case "PGM": + PGM.drgw_interrupt(); + break; + case "M72": + iloops = 0; + vblank_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + case "M92": + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "dland": + case "bbredux": + case "bublboblb": + case "boblcave": + if (!cpunum_is_suspended(0, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Cpuint.cpunum_set_input_line(0, 0, LineState.HOLD_LINE); + } + if (!cpunum_is_suspended(1, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "bublcave": + case "bublcave11": + case "bublcave10": + if (!cpunum_is_suspended(1, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + if (!cpunum_is_suspended(3, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Cpuint.cpunum_set_input_line(3, 0, LineState.PULSE_LINE); + } + break; + case "bub68705": + if (!cpunum_is_suspended(1, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + iloops = 0; + vblank_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[3].partial_frame_timer, Cpuexec.cpu[3].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfp": + if (!cpunum_is_suspended(0, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Generic.irq5_line_hold(0); + } + Crosshair.animate_opwolf(); + break; + case "opwolfb": + if (!cpunum_is_suspended(0, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Generic.irq5_line_hold(0); + } + if (!cpunum_is_suspended(2, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Generic.irq0_line_hold(2); + } + Crosshair.animate_opwolf(); + break; + default: + break; + } + break; + case "Taito B": + vblank_interrupt(); + break; + case "Konami 68000": + switch (Machine.sName) + { + case "cuebrick": + iloops = 0; + vblank_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + default: + vblank_interrupt(); + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + if (!cpunum_is_suspended(0, (byte)(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) + { + Generic.irq_0_0_line_hold(); + } + iloops = 0; + vblank_interrupt(); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + Generic.irq_0_1_line_hold(); + break; + case "sfp": + Generic.irq_0_6_line_hold(); + break; + } + break; + } + } + public static void trigger_partial_frame_interrupt() + { + switch (Machine.sBoard) + { + case "CPS2": + case "IGS011": + case "Konami 68000": + if (iloops == 0) + { + iloops = vblank_interrupts_per_frame; + } + iloops--; + vblank_interrupt(); + if (iloops > 1) + { + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + } + break; + case "Tehkan": + if (iloops == 0) + { + iloops = vblank_interrupts_per_frame; + } + iloops--; + Tehkan.pbaction_interrupt(); + if (iloops > 1) + { + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + } + break; + case "SunA8": + if (iloops == 0) + { + iloops = vblank_interrupts_per_frame; + } + iloops--; + SunA8.hardhea2_interrupt(); + if (iloops > 1) + { + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + } + break; + case "M72": + if (iloops == 0) + { + iloops = vblank_interrupts_per_frame; + } + iloops--; + vblank_interrupt(); + if (iloops > 1) + { + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + } + break; + case "Taito": + switch (Machine.sName) + { + case "bub68705": + if (iloops == 0) + { + iloops = vblank_interrupts_per_frame; + } + iloops--; + vblank_interrupt(); + if (iloops > 1) + { + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[3].partial_frame_timer, Cpuexec.cpu[3].partial_frame_period, Attotime.ATTOTIME_NEVER); + } + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + if (iloops == 0) + { + iloops = vblank_interrupts_per_frame; + } + iloops--; + vblank_interrupt(); + if (iloops > 1) + { + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + } + break; + } + break; + } + } + public static void cpu_timeslicecallback() + { + cpu_trigger(-1000); + } + public static void end_interleave_boost() + { + EmuTimer.timer_adjust_periodic(interleave_boost_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + } + public static void compute_perfect_interleave() + { + long smallest = cpu[0].attoseconds_per_cycle; + int cpunum; + perfect_interleave = Attotime.ATTOTIME_ZERO; + perfect_interleave.attoseconds = Attotime.ATTOSECONDS_PER_SECOND - 1; + for (cpunum = 1; cpunum < ncpu; cpunum++) + { + if (cpu[cpunum].attoseconds_per_cycle < smallest) + { + perfect_interleave.attoseconds = smallest; + smallest = cpu[cpunum].attoseconds_per_cycle; + } + else if (cpu[cpunum].attoseconds_per_cycle < perfect_interleave.attoseconds) + perfect_interleave.attoseconds = cpu[cpunum].attoseconds_per_cycle; + } + if (perfect_interleave.attoseconds == Attotime.ATTOSECONDS_PER_SECOND - 1) + perfect_interleave.attoseconds = cpu[0].attoseconds_per_cycle; + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + for (i = 0; i < ncpu; i++) + { + writer.Write(Cpuexec.cpu[i].suspend); + writer.Write(Cpuexec.cpu[i].nextsuspend); + writer.Write(Cpuexec.cpu[i].eatcycles); + writer.Write(Cpuexec.cpu[i].nexteatcycles); + writer.Write(Cpuexec.cpu[i].trigger); + writer.Write(Cpuexec.cpu[i].localtime.seconds); + writer.Write(Cpuexec.cpu[i].localtime.attoseconds); + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + for (i = 0; i < ncpu; i++) + { + Cpuexec.cpu[i].suspend = reader.ReadByte(); + Cpuexec.cpu[i].nextsuspend = reader.ReadByte(); + Cpuexec.cpu[i].eatcycles = reader.ReadByte(); + Cpuexec.cpu[i].nexteatcycles = reader.ReadByte(); + Cpuexec.cpu[i].trigger = reader.ReadInt32(); + Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); + Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuexec.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuexec.cs.meta new file mode 100644 index 00000000..66548661 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuexec.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab939437f0bbed14e8ff65ed979d8fea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuint.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuint.cs new file mode 100644 index 00000000..41e27701 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuint.cs @@ -0,0 +1,410 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Numerics; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + [StructLayout(LayoutKind.Explicit)] + [Serializable()] + public struct Register + { + [FieldOffset(0)] + public uint d; + [FieldOffset(0)] + public int sd; + + [FieldOffset(0)] + public ushort LowWord; + [FieldOffset(2)] + public ushort HighWord; + + [FieldOffset(0)] + public byte LowByte; + [FieldOffset(1)] + public byte HighByte; + [FieldOffset(2)] + public byte HighByte2; + [FieldOffset(3)] + public byte HighByte3; + + public override string ToString() + { + return String.Format("{0:X8}", d); + } + } + public enum LineState + { + CLEAR_LINE = 0, + ASSERT_LINE, + HOLD_LINE, + PULSE_LINE, + INTERNAL_CLEAR_LINE = 100 + CLEAR_LINE, + INTERNAL_ASSERT_LINE = 100 + ASSERT_LINE, + MAX_INPUT_LINES = 32 + 3, + INPUT_LINE_NMI = MAX_INPUT_LINES - 3, + INPUT_LINE_RESET = MAX_INPUT_LINES - 2, + INPUT_LINE_HALT = MAX_INPUT_LINES - 1, + } + public class irq + { + public int cpunum; + public int line; + public LineState state; + public int vector; + public Atime time; + public irq() + { + + } + public void Init(int _cpunum, int _line, LineState _state, int _vector, Atime _time) + { + cpunum = _cpunum; + line = _line; + state = _state; + vector = _vector; + time = _time; + } + } + public class vec + { + public int vector; + public Atime time; + public vec() + { + + } + public vec(int _vector, Atime _time) + { + vector = _vector; + time = _time; + } + } + public class Cpuint + { + public static int[,] interrupt_vector; + public static byte[,] input_line_state; + public static int[,] input_line_vector; + public static int[,] input_event_index; + //public static int[, ,] input_state; + public static List lirq; + public static List lvec; + public static void cpuint_init() + { + int i, j; + lirq = new List(); + lvec = new List(); + interrupt_vector = new int[8, 35]; + input_line_state = new byte[8, 35]; + input_line_vector = new int[8, 35]; + input_event_index = new int[8, 35]; + //input_state = new int[8, 35, 32]; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + input_line_state[i, j] = 0; + interrupt_vector[i, j] = input_line_vector[i, j] = 0xff; + input_event_index[i, j] = 0; + } + } + } + public static void cpuint_reset() + { + int i, j; + lirq = new List(); + lvec = new List(); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + interrupt_vector[i, j] = 0xff; + input_event_index[i, j] = 0; + } + } + } + public static void cps1_irq_handler_mus(int irq) + { + cpunum_set_input_line(1, 0, (irq != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void namcos1_sound_interrupt(int irq) + { + cpunum_set_input_line(2, 1, (irq != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void cpunum_set_input_line(int cpunum, int line, LineState state) + { + int vector = (line >= 0 && line < 35) ? interrupt_vector[cpunum, line] : 0xff; + irq _irq = ObjectPoolAuto.Acquire(); + _irq.Init(cpunum, line, state, vector, EmuTimer.get_current_time()); + lirq.Add(_irq); + //lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time())); + Cpuexec.cpu[cpunum].cpunum_set_input_line_and_vector(cpunum, line, state, vector); + } + public static void cpunum_set_input_line_vector(int cpunum, int line, int vector) + { + if (cpunum < Cpuexec.ncpu && line >= 0 && line < (int)LineState.MAX_INPUT_LINES) + { + interrupt_vector[cpunum, line] = vector; + return; + } + } + public static void cpunum_set_input_line_and_vector2(int cpunum, int line, LineState state, int vector) + { + if (line >= 0 && line < 35) + { + irq _irq = ObjectPoolAuto.Acquire(); + _irq.Init(cpunum, line, state, vector, EmuTimer.get_current_time()); + lirq.Add(_irq); + //lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time())); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); + } + } + public static void cpunum_empty_event_queue() + { + //List lsirq = new List(); + List lsirq = ObjectPoolAuto.AcquireList(); + if (lirq.Count == 0) + { + int i1 = 1; + } + foreach (irq irq1 in lirq) + { + if (Attotime.attotime_compare(irq1.time, EmuTimer.global_basetime) <= 0) + { + input_line_state[irq1.cpunum, irq1.line] = (byte)irq1.state; + input_line_vector[irq1.cpunum, irq1.line] = irq1.vector; + if (irq1.line == (int)LineState.INPUT_LINE_RESET) + { + if (irq1.state == LineState.ASSERT_LINE) + { + Cpuexec.cpunum_suspend(irq1.cpunum, Cpuexec.SUSPEND_REASON_RESET, 1); + } + else + { + if ((irq1.state == LineState.CLEAR_LINE && Cpuexec.cpunum_is_suspended(irq1.cpunum, Cpuexec.SUSPEND_REASON_RESET)) || irq1.state == LineState.PULSE_LINE) + { + Cpuexec.cpu[irq1.cpunum].Reset(); + } + Cpuexec.cpunum_resume(irq1.cpunum, Cpuexec.SUSPEND_REASON_RESET); + } + } + else if (irq1.line == (int)LineState.INPUT_LINE_HALT) + { + if (irq1.state == LineState.ASSERT_LINE) + { + Cpuexec.cpunum_suspend(irq1.cpunum, Cpuexec.SUSPEND_REASON_HALT, 1); + } + else if (irq1.state == LineState.CLEAR_LINE) + { + Cpuexec.cpunum_resume(irq1.cpunum, Cpuexec.SUSPEND_REASON_HALT); + } + } + else + { + switch (irq1.state) + { + case LineState.PULSE_LINE: + Cpuexec.cpu[irq1.cpunum].set_irq_line(irq1.line, LineState.ASSERT_LINE); + Cpuexec.cpu[irq1.cpunum].set_irq_line(irq1.line, LineState.CLEAR_LINE); + break; + case LineState.HOLD_LINE: + case LineState.ASSERT_LINE: + Cpuexec.cpu[irq1.cpunum].set_irq_line(irq1.line, LineState.ASSERT_LINE); + break; + case LineState.CLEAR_LINE: + Cpuexec.cpu[irq1.cpunum].set_irq_line(irq1.line, LineState.CLEAR_LINE); + break; + } + if (irq1.state != LineState.CLEAR_LINE) + { + Cpuexec.cpu_triggerint(irq1.cpunum); + } + } + lsirq.Add(irq1); + } + } + foreach (irq irq1 in lsirq) + { + input_event_index[irq1.cpunum, irq1.line] = 0; + ObjectPoolAuto.Release(irq1); + lirq.Remove(irq1); + } + if (lirq.Count > 0) + { + int i1 = 1; + } + ObjectPoolAuto.Release(lsirq); + } + public static int cpu_irq_callback(int cpunum, int line) + { + int vector = input_line_vector[cpunum, line]; + if (input_line_state[cpunum, line] == (byte)LineState.HOLD_LINE) + { + Cpuexec.cpu[cpunum].set_irq_line(line, LineState.CLEAR_LINE); + input_line_state[cpunum, line] = (byte)LineState.CLEAR_LINE; + } + return vector; + } + public static int cpu_0_irq_callback(int line) + { + return cpu_irq_callback(0, line); + } + public static int cpu_1_irq_callback(int line) + { + return cpu_irq_callback(1, line); + } + public static int cpu_2_irq_callback(int line) + { + return cpu_irq_callback(2, line); + } + public static int cpu_3_irq_callback(int line) + { + return cpu_irq_callback(3, line); + } + public static void SaveStateBinary_v(BinaryWriter writer) + { + int i, n; + n = lvec.Count; + writer.Write(n); + for (i = 0; i < n; i++) + { + writer.Write(lvec[i].vector); + writer.Write(lvec[i].time.seconds); + writer.Write(lvec[i].time.attoseconds); + } + for (i = n; i < 16; i++) + { + writer.Write(0); + writer.Write(0); + writer.Write((long)0); + } + } + public static void LoadStateBinary_v(BinaryReader reader) + { + int i, n; + n = reader.ReadInt32(); + lvec = new List(); + for (i = 0; i < n; i++) + { + lvec.Add(new vec()); + lvec[i].vector = reader.ReadInt32(); + lvec[i].time.seconds = reader.ReadInt32(); + lvec[i].time.attoseconds = reader.ReadInt64(); + } + for (i = n; i < 16; i++) + { + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt64(); + } + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j, n; + n = lirq.Count; + writer.Write(n); + for (i = 0; i < n; i++) + { + writer.Write(lirq[i].cpunum); + writer.Write(lirq[i].line); + writer.Write((int)lirq[i].state); + writer.Write(lirq[i].vector); + writer.Write(lirq[i].time.seconds); + writer.Write(lirq[i].time.attoseconds); + } + for (i = n; i < 16; i++) + { + writer.Write(0); + writer.Write(0); + writer.Write(0); + writer.Write(0); + writer.Write(0); + writer.Write((long)0); + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + writer.Write(interrupt_vector[i, j]); + } + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + writer.Write(input_line_state[i, j]); + } + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + writer.Write(input_line_vector[i, j]); + } + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + writer.Write(input_event_index[i, j]); + } + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j, n; + n = reader.ReadInt32(); + lirq = new List(); + for (i = 0; i < n; i++) + { + irq _irq = ObjectPoolAuto.Acquire(); + lirq.Add(_irq); + //lirq.Add(new irq()); + lirq[i].cpunum = reader.ReadInt32(); + lirq[i].line = reader.ReadInt32(); + lirq[i].state = (LineState)reader.ReadInt32(); + lirq[i].vector = reader.ReadInt32(); + lirq[i].time.seconds = reader.ReadInt32(); + lirq[i].time.attoseconds = reader.ReadInt64(); + } + for (i = n; i < 16; i++) + { + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt64(); + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + interrupt_vector[i, j] = reader.ReadInt32(); + } + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + input_line_state[i, j] = reader.ReadByte(); + } + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + input_line_vector[i, j] = reader.ReadInt32(); + } + } + for (i = 0; i < 8; i++) + { + for (j = 0; j < 35; j++) + { + input_event_index[i, j] = reader.ReadInt32(); + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuint.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuint.cs.meta new file mode 100644 index 00000000..4c872ee9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Cpuint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28ecd470b1b11f141affee7641819f23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Crosshair.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Crosshair.cs new file mode 100644 index 00000000..98712800 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Crosshair.cs @@ -0,0 +1,126 @@ +namespace MAME.Core +{ + public class Crosshair + { + public struct crosshair_global + { + public bool[] used; + public bool[] visible; + /*bitmap_t * bitmap[MAX_PLAYERS]; + render_texture * texture[MAX_PLAYERS]; + const device_config *screen[MAX_PLAYERS];*/ + public int[] x; + public int[] y; + public byte fade; + public byte animation_counter; + } + public static crosshair_global global; + public static byte[] crosshair_raw_top = new byte[] + { + 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00, + 0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00, + 0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf0,0x00, + 0x01,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf8,0x00, + 0x03,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x00, + 0x07,0xfe,0x00,0x00,0x00,0x0f,0xfe,0x00,0x00,0x00,0x07,0xfe,0x00, + 0x0f,0xff,0x00,0x00,0x01,0xff,0xff,0xf0,0x00,0x00,0x0f,0xff,0x00, + 0x1f,0xff,0x80,0x00,0x1f,0xff,0xff,0xff,0x00,0x00,0x1f,0xff,0x80, + 0x3f,0xff,0x80,0x00,0xff,0xff,0xff,0xff,0xe0,0x00,0x1f,0xff,0xc0, + 0x7f,0xff,0xc0,0x03,0xff,0xff,0xff,0xff,0xf8,0x00,0x3f,0xff,0xe0, + 0xff,0xff,0xe0,0x07,0xff,0xff,0xff,0xff,0xfc,0x00,0x7f,0xff,0xf0, + 0x7f,0xff,0xf0,0x1f,0xff,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xe0, + 0x3f,0xff,0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xc0, + 0x0f,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xff,0x00, + 0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0xff,0xfe,0x00, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00, + 0x01,0xff,0xff,0xff,0xff,0xf0,0x01,0xff,0xff,0xff,0xff,0xf8,0x00, + 0x00,0x7f,0xff,0xff,0xff,0x00,0x00,0x1f,0xff,0xff,0xff,0xe0,0x00, + 0x00,0x3f,0xff,0xff,0xf8,0x00,0x00,0x03,0xff,0xff,0xff,0xc0,0x00, + 0x00,0x1f,0xff,0xff,0xe0,0x00,0x00,0x00,0xff,0xff,0xff,0x80,0x00, + 0x00,0x0f,0xff,0xff,0x80,0x00,0x00,0x00,0x3f,0xff,0xff,0x00,0x00, + 0x00,0x03,0xff,0xfe,0x00,0x00,0x00,0x00,0x0f,0xff,0xfc,0x00,0x00, + 0x00,0x01,0xff,0xfc,0x00,0x00,0x00,0x00,0x07,0xff,0xf8,0x00,0x00, + 0x00,0x03,0xff,0xf8,0x00,0x00,0x00,0x00,0x01,0xff,0xf8,0x00,0x00, + 0x00,0x07,0xff,0xfc,0x00,0x00,0x00,0x00,0x03,0xff,0xfc,0x00,0x00, + 0x00,0x0f,0xff,0xfe,0x00,0x00,0x00,0x00,0x07,0xff,0xfe,0x00,0x00, + 0x00,0x0f,0xff,0xff,0x00,0x00,0x00,0x00,0x0f,0xff,0xfe,0x00,0x00, + 0x00,0x1f,0xff,0xff,0x80,0x00,0x00,0x00,0x1f,0xff,0xff,0x00,0x00, + 0x00,0x1f,0xff,0xff,0x80,0x00,0x00,0x00,0x1f,0xff,0xff,0x00,0x00, + 0x00,0x3f,0xfe,0xff,0xc0,0x00,0x00,0x00,0x3f,0xff,0xff,0x80,0x00, + 0x00,0x7f,0xfc,0x7f,0xe0,0x00,0x00,0x00,0x7f,0xe7,0xff,0xc0,0x00, + 0x00,0x7f,0xf8,0x3f,0xf0,0x00,0x00,0x00,0xff,0xc3,0xff,0xc0,0x00, + 0x00,0xff,0xf8,0x1f,0xf8,0x00,0x00,0x01,0xff,0x83,0xff,0xe0,0x00, + 0x00,0xff,0xf0,0x07,0xf8,0x00,0x00,0x01,0xfe,0x01,0xff,0xe0,0x00, + 0x00,0xff,0xf0,0x03,0xfc,0x00,0x00,0x03,0xfc,0x01,0xff,0xe0,0x00, + 0x01,0xff,0xe0,0x01,0xfe,0x00,0x00,0x07,0xf8,0x00,0xff,0xf0,0x00, + 0x01,0xff,0xe0,0x00,0xff,0x00,0x00,0x0f,0xf0,0x00,0xff,0xf0,0x00, + 0x01,0xff,0xc0,0x00,0x3f,0x80,0x00,0x1f,0xc0,0x00,0x7f,0xf0,0x00, + 0x01,0xff,0xc0,0x00,0x1f,0x80,0x00,0x1f,0x80,0x00,0x7f,0xf0,0x00, + 0x03,0xff,0xc0,0x00,0x0f,0xc0,0x00,0x3f,0x00,0x00,0x7f,0xf8,0x00, + 0x03,0xff,0x80,0x00,0x07,0xe0,0x00,0x7e,0x00,0x00,0x3f,0xf8,0x00, + 0x03,0xff,0x80,0x00,0x01,0xf0,0x00,0xf8,0x00,0x00,0x3f,0xf8,0x00, + 0x03,0xff,0x80,0x00,0x00,0xf8,0x01,0xf0,0x00,0x00,0x3f,0xf8,0x00, + 0x03,0xff,0x80,0x00,0x00,0x78,0x01,0xe0,0x00,0x00,0x3f,0xf8,0x00, + 0x07,0xff,0x00,0x00,0x00,0x3c,0x03,0xc0,0x00,0x00,0x3f,0xfc,0x00, + 0x07,0xff,0x00,0x00,0x00,0x0e,0x07,0x00,0x00,0x00,0x1f,0xfc,0x00, + 0x07,0xff,0x00,0x00,0x00,0x07,0x0e,0x00,0x00,0x00,0x1f,0xfc,0x00, + 0x07,0xff,0x00,0x00,0x00,0x03,0x9c,0x00,0x00,0x00,0x1f,0xfc,0x00, + 0x07,0xff,0x00,0x00,0x00,0x01,0x98,0x00,0x00,0x00,0x1f,0xfc,0x00, + 0x07,0xff,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x1f,0xfc,0x00 + }; + public static uint[] crosshair_colors = new uint[] + { + 0x4040ff, + 0xff4040, + 0x40ff40, + 0xffff40, + 0xff40ff, + 0x40ffff, + 0xffffff + }; + public static void crosshair_init() + { + global.used = new bool[8]; + global.visible = new bool[8]; + global.x = new int[8]; + global.y = new int[8]; + switch (Machine.sName) + { + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + global.used[0] = true; + global.visible[0] = true; + Video.drawcrosshair = Video.drawcrosshair_opwolf; + break; + default: + Video.drawcrosshair = Video.drawcrosshair_null; + break; + } + } + public static void animate_opwolf() + { + int player; + global.animation_counter += 0x04; + if (global.animation_counter < 0x80) + { + global.fade = (byte)(0xa0 + (0x60 * (global.animation_counter & 0x7f) / 0x80)); + } + else + { + global.fade = (byte)(0xa0 + (0x60 * (~global.animation_counter & 0x7f) / 0x80)); + } + for (player = 0; player < 8; player++) + { + if (global.used[player]) + { + global.x[player] = ((Taito.p1x * 320) / 256) - 0; + global.y[player] = Taito.p1y - 10; + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Crosshair.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Crosshair.cs.meta new file mode 100644 index 00000000..c4b56b3a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Crosshair.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5abe76ea4deb70642bf147117d94adbc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Drawgfx.cs new file mode 100644 index 00000000..0307951a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Drawgfx.cs @@ -0,0 +1,10 @@ +namespace MAME.Core +{ + public partial class Drawgfx + { + public static int[] gfx_drawmode_table = new int[256]; + + + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Drawgfx.cs.meta new file mode 100644 index 00000000..edd34265 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4775223c49339fe4f96b0b24efc27793 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Eeprom.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Eeprom.cs new file mode 100644 index 00000000..79ba32e5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Eeprom.cs @@ -0,0 +1,412 @@ +using System.IO; + +namespace MAME.Core +{ + /*public enum eeprom_command + { + COMMAND_INVALID, + COMMAND_READ, + COMMAND_WRITE, + COMMAND_ERASE, + COMMAND_LOCK, + COMMAND_UNLOCK, + COMMAND_WRITEALL, + COMMAND_ERASEALL, + COMMAND_COPY_EEPROM_TO_RAM, + COMMAND_COPY_RAM_TO_EEPROM + } + public enum eeprom_state + { + STATE_IN_RESET, + STATE_WAIT_FOR_START_BIT, + STATE_WAIT_FOR_COMMAND, + STATE_READING_DATA, + STATE_WAIT_FOR_DATA, + STATE_WAIT_FOR_COMPLETION + }; + public enum eeprom_event + { + EVENT_CS_RISING_EDGE = 1 << 0, + EVENT_CS_FALLING_EDGE = 1 << 1, + EVENT_CLK_RISING_EDGE = 1 << 2, + EVENT_CLK_FALLING_EDGE = 1 << 3 + };*/ + public class Eeprom + { + public static int serial_count; + public static byte[] serial_buffer = new byte[40]; + public static byte[] eeprom_data = new byte[0x80]; + private static byte[] cmd_read; + private static byte[] cmd_write; + private static byte[] cmd_erase; + private static byte[] cmd_lock, cmd_unlock; + public static int eeprom_data_bits; + public static int eeprom_read_address; + public static int eeprom_clock_count; + public static int latch, sending; + public static int address_bits, data_bits; + public static LineState reset_line, clock_line; + public static int locked; + public static int enable_multi_read; + public static int reset_delay, reset_delay1; + private static bool eeprom_command_match(byte[] buf, byte[] cmd, int len) + { + int ibuf = 0, idx = 0; + if (cmd.Length == 0) + { + return false; + } + if (len == 0) + { + return false; + } + for (; len > 0;) + { + byte b = buf[ibuf]; + byte c = cmd[idx]; + if ((b == 0) || (c == 0)) + return (b == c); + switch (c) + { + case (byte)'0': + case (byte)'1': + if (b != c) + { + return false; + } + ibuf++; + len--; + idx++; + break; + case (byte)'X': + case (byte)'x': + ibuf++; + len--; + idx++; + break; + case (byte)'*': + break; + } + } + return (idx >= cmd.Length); + } + public static void eeprom_init() + { + serial_count = 0; + latch = 0; + reset_line = LineState.ASSERT_LINE; + clock_line = LineState.ASSERT_LINE; + eeprom_read_address = 0; + sending = 0; + reset_delay1 = 0; + switch (Machine.sBoard) + { + case "CPS-1"://pang3 + cmd_read = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'0' }; + cmd_write = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'1' }; + cmd_erase = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'1' }; + cmd_lock = new byte[] { }; + cmd_unlock = new byte[] { }; + for (int i = 0; i < 0x80; i++) + { + eeprom_data[i] = 0xff; + } + locked = 0; + address_bits = 6; + data_bits = 16; + break; + case "CPS-1(QSound)": + cmd_read = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'0' }; + cmd_write = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'1' }; + cmd_erase = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'1' }; + cmd_lock = new byte[] { }; + cmd_unlock = new byte[] { }; + for (int i = 0; i < 0x80; i++) + { + eeprom_data[i] = 0xff; + } + locked = 0; + address_bits = 7; + data_bits = 8; + break; + case "CPS2": + cmd_read = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'0' }; + cmd_write = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'1' }; + cmd_erase = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'1' }; + cmd_lock = new byte[] { }; + cmd_unlock = new byte[] { }; + for (int i = 0; i < 0x80; i++) + { + eeprom_data[i] = 0xff; + } + locked = 0; + address_bits = 6; + data_bits = 16; + break; + case "Taito B": + cmd_read = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'0' }; + cmd_write = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'1' }; + cmd_erase = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'1' }; + cmd_lock = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0' }; + cmd_unlock = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'0', (byte)'1', (byte)'1', (byte)'0', (byte)'0', (byte)'0', (byte)'0' }; + for (int i = 0; i < 0x80; i++) + { + eeprom_data[i] = 0xff; + } + locked = 1; + address_bits = 6; + data_bits = 16; + break; + case "Konami 68000": + cmd_read = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'0', (byte)'0', (byte)'0' }; + cmd_write = new byte[] { (byte)'0', (byte)'1', (byte)'1', (byte)'1', (byte)'0', (byte)'0' }; + cmd_erase = new byte[] { }; + cmd_lock = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0' }; + cmd_unlock = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'0', (byte)'1', (byte)'1', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0', (byte)'0' }; + for (int i = 0; i < 0x80; i++) + { + eeprom_data[i] = 0xff; + } + locked = 1; + address_bits = 7; + data_bits = 8; + switch (Machine.sName) + { + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + case "prmrsocr": + case "prmrsocrj": + cmd_write = new byte[] { (byte)'0', (byte)'1', (byte)'0', (byte)'1', (byte)'0', (byte)'0' }; + break; + } + break; + } + switch (Machine.sName) + { + case "pang3": + case "pang3r1": + case "pang3j": + case "pang3b": + for (int i = 0; i < 0x80; i++) + { + eeprom_data[i] = 0xff; + } + locked = 0; + address_bits = 6; + data_bits = 16; + break; + } + } + private static void eeprom_write(int bit) + { + if (serial_count >= 40 - 1) + { + return; + } + serial_buffer[serial_count++] = (bit != 0 ? (byte)'1' : (byte)'0'); + serial_buffer[serial_count] = 0; /* nul terminate so we can treat it as a string */ + if ((serial_count > address_bits) && eeprom_command_match(serial_buffer, cmd_read, serial_count - address_bits)) + { + int i, address; + address = 0; + for (i = serial_count - address_bits; i < serial_count; i++) + { + address <<= 1; + if (serial_buffer[i] == (byte)'1') + { + address |= 1; + } + } + if (data_bits == 16) + { + eeprom_data_bits = (eeprom_data[2 * address + 0] << 8) + eeprom_data[2 * address + 1]; + } + else + { + eeprom_data_bits = eeprom_data[address]; + } + eeprom_read_address = address; + eeprom_clock_count = 0; + sending = 1; + serial_count = 0; + } + else if ((serial_count > address_bits) && eeprom_command_match(serial_buffer, cmd_erase, serial_count - address_bits)) + { + int i, address; + address = 0; + for (i = serial_count - address_bits; i < serial_count; i++) + { + address <<= 1; + if (serial_buffer[i] == '1') + { + address |= 1; + } + } + if (locked == 0) + { + if (data_bits == 16) + { + eeprom_data[2 * address + 0] = 0x00; + eeprom_data[2 * address + 1] = 0x00; + } + else + { + eeprom_data[address] = 0x00; + } + } + serial_count = 0; + } + else if ((serial_count > (address_bits + data_bits)) && eeprom_command_match(serial_buffer, cmd_write, serial_count - (address_bits + data_bits))) + { + int i, address, data; + address = 0; + for (i = serial_count - data_bits - address_bits; i < (serial_count - data_bits); i++) + { + address <<= 1; + if (serial_buffer[i] == '1') + { + address |= 1; + } + } + data = 0; + for (i = serial_count - data_bits; i < serial_count; i++) + { + data <<= 1; + if (serial_buffer[i] == '1') + { + data |= 1; + } + } + if (locked == 0) + { + if (data_bits == 16) + { + eeprom_data[2 * address + 0] = (byte)(data >> 8); + eeprom_data[2 * address + 1] = (byte)(data & 0xff); + } + else + { + eeprom_data[address] = (byte)data; + } + } + serial_count = 0; + } + else if (eeprom_command_match(serial_buffer, cmd_lock, serial_count)) + { + locked = 1; + serial_count = 0; + } + else if (eeprom_command_match(serial_buffer, cmd_unlock, serial_count)) + { + locked = 0; + serial_count = 0; + } + } + private static void eeprom_reset() + { + serial_count = 0; + sending = 0; + reset_delay = reset_delay1; + } + public static void eeprom_write_bit(int bit) + { + latch = bit; + } + public static int eeprom_read_bit() + { + int res; + if (sending == 1) + { + res = (eeprom_data_bits >> data_bits) & 1; + } + else + { + if (reset_delay > 0) + { + reset_delay--; + res = 0; + } + else + { + res = 1; + } + } + return res; + } + public static int eeprom_bit_r() + { + return eeprom_read_bit(); + } + public static void eeprom_set_cs_line(LineState state) + { + reset_line = state; + if (reset_line != LineState.CLEAR_LINE) + { + eeprom_reset(); + } + } + public static void eeprom_set_clock_line(LineState state) + { + if (state == LineState.PULSE_LINE || (clock_line == LineState.CLEAR_LINE && state != LineState.CLEAR_LINE)) + { + if (reset_line == LineState.CLEAR_LINE) + { + if (sending == 1) + { + if (eeprom_clock_count == data_bits && enable_multi_read != 0) + { + eeprom_read_address = (eeprom_read_address + 1) & ((1 << address_bits) - 1); + if (data_bits == 16) + { + eeprom_data_bits = (eeprom_data[2 * eeprom_read_address + 0] << 8) + eeprom_data[2 * eeprom_read_address + 1]; + } + else + { + eeprom_data_bits = eeprom_data[eeprom_read_address]; + } + eeprom_clock_count = 0; + } + eeprom_data_bits = (eeprom_data_bits << 1) | 1; + eeprom_clock_count++; + } + else + { + eeprom_write(latch); + } + } + } + clock_line = state; + } + public static void SaveStateBinary(BinaryWriter writer) + { + writer.Write(eeprom_data); + writer.Write(serial_buffer); + writer.Write((int)clock_line); + writer.Write((int)reset_line); + writer.Write(locked); + writer.Write(serial_count); + writer.Write(latch); + writer.Write(reset_delay); + writer.Write(sending); + writer.Write(eeprom_clock_count); + writer.Write(eeprom_data_bits); + writer.Write(eeprom_read_address); + } + public static void LoadStateBinary(BinaryReader reader) + { + eeprom_data = reader.ReadBytes(0x80); + serial_buffer = reader.ReadBytes(40); + clock_line = (LineState)reader.ReadInt32(); + reset_line = (LineState)reader.ReadInt32(); + locked = reader.ReadInt32(); + serial_count = reader.ReadInt32(); + latch = reader.ReadInt32(); + reset_delay = reader.ReadInt32(); + sending = reader.ReadInt32(); + eeprom_clock_count = reader.ReadInt32(); + eeprom_data_bits = reader.ReadInt32(); + eeprom_read_address = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Eeprom.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Eeprom.cs.meta new file mode 100644 index 00000000..389ba201 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Eeprom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03a6d506fec241d4f9c95216bb5b7fb5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs new file mode 100644 index 00000000..5bfcf857 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs @@ -0,0 +1,965 @@ +using cpu.m6800; +using System; +using System.Collections.Generic; +using System.IO; + +namespace MAME.Core +{ + public class EmuTimer + { + public static List lt; + private static List lt2; + public static Atime global_basetime; + public static Atime global_basetime_obj; + private static bool callback_timer_modified; + private static emu_timer callback_timer; + private static Atime callback_timer_expire_time; + public delegate void timer_fired_func(); + public static Action setvector; + public class emu_timer + { + public TIME_ACT action; + //public string func; + public bool enabled; + public bool temporary; + public Atime period; + public Atime start; + public Atime expire; + } + public class emu_timer2 + { + public int index; + public TIME_ACT action; + public string func; + public emu_timer2(int i1, TIME_ACT ac1) + { + index = i1; + action = ac1; + //func = func1; + } + } + //public static Action getactionbyindex(int index) + public static TIME_ACT getactionbyindex(int index) + { + TIME_ACT action = TIME_ACT.NoneAct; + foreach (emu_timer2 timer in lt2) + { + if (timer.index == index) + { + action = timer.action; + if (index == 4) + { + action = TIME_ACT.Sound_sound_update; + } + else if (index == 32) + { + action = TIME_ACT.M6800_action_rx; + } + else if (index == 33) + { + action = TIME_ACT.M6800_action_tx; + } + else if (index == 39) + { + action = TIME_ACT.setvector; + } + else if (index == 42) + { + action = TIME_ACT.Cpuexec_vblank_interrupt2; + } + } + } + return action; + } + //{ + // Action action = null; + // foreach (emu_timer2 timer in lt2) + // { + // if (timer.index == index) + // { + // action = timer.action; + // if (index == 4) + // { + // action = Sound.sound_update; + // } + // else if (index == 32) + // { + // action = M6800.action_rx; + // } + // else if (index == 33) + // { + // action = M6800.action_tx; + // } + // else if (index == 39) + // { + // action = setvector; + // } + // else if (index == 42) + // { + // action = Cpuexec.vblank_interrupt2; + // } + // } + // } + // return action; + //} + public static string getfuncbyindex(int index) + { + string func = ""; + foreach (emu_timer2 timer in lt2) + { + if (timer.index == index) + { + func = timer.func; + break; + } + } + return func; + } + //public static int getindexbyfunc(string func) + //{ + // int index = 0; + // foreach (emu_timer2 timer in lt2) + // { + // if (timer.func == func) + // { + // index = timer.index; + // break; + // } + // } + // return index; + //} + public static int getindexbyaction(TIME_ACT act) + { + int index = 0; + foreach (emu_timer2 timer in lt2) + { + if (timer.action == act) + { + index = timer.index; + break; + } + } + return index; + } + //public static void timer_init() + //{ + // global_basetime = Attotime.ATTOTIME_ZERO; + // lt = new List(); + // lt2 = new List(); + // lt2.Add(new emu_timer2(1, Video.vblank_begin_callback, "vblank_begin_callback")); + // lt2.Add(new emu_timer2(2, Mame.soft_reset, "soft_reset")); + // lt2.Add(new emu_timer2(3, Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue")); + // lt2.Add(new emu_timer2(4, Sound.sound_update, "sound_update")); + // lt2.Add(new emu_timer2(5, Watchdog.watchdog_callback, "watchdog_callback")); + // lt2.Add(new emu_timer2(6, Generic.irq_1_0_line_hold, "irq_1_0_line_hold")); + // lt2.Add(new emu_timer2(7, Video.vblank_end_callback, "vblank_end_callback")); + + // lt2.Add(new emu_timer2(10, YM2151.irqAon_callback, "irqAon_callback")); + // lt2.Add(new emu_timer2(11, YM2151.irqBon_callback, "irqBon_callback")); + // lt2.Add(new emu_timer2(12, YM2151.irqAoff_callback, "irqAoff_callback")); + // lt2.Add(new emu_timer2(13, YM2151.irqBoff_callback, "irqBoff_callback")); + // lt2.Add(new emu_timer2(14, YM2151.timer_callback_a, "timer_callback_a")); + // lt2.Add(new emu_timer2(15, YM2151.timer_callback_b, "timer_callback_b")); + // lt2.Add(new emu_timer2(16, Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt")); + // lt2.Add(new emu_timer2(17, Cpuexec.null_callback, "boost_callback")); + // lt2.Add(new emu_timer2(18, Cpuexec.end_interleave_boost, "end_interleave_boost")); + // lt2.Add(new emu_timer2(19, Video.scanline0_callback, "scanline0_callback")); + // lt2.Add(new emu_timer2(20, Sound.latch_callback, "latch_callback")); + // lt2.Add(new emu_timer2(21, Sound.latch_callback2, "latch_callback2")); + // lt2.Add(new emu_timer2(22, Sound.latch_callback3, "latch_callback3")); + // lt2.Add(new emu_timer2(23, Sound.latch_callback4, "latch_callback4")); + // lt2.Add(new emu_timer2(24, Neogeo.display_position_interrupt_callback, "display_position_interrupt_callback")); + // lt2.Add(new emu_timer2(25, Neogeo.display_position_vblank_callback, "display_position_vblank_callback")); + // lt2.Add(new emu_timer2(26, Neogeo.vblank_interrupt_callback, "vblank_interrupt_callback")); + // lt2.Add(new emu_timer2(27, Neogeo.auto_animation_timer_callback, "auto_animation_timer_callback")); + // lt2.Add(new emu_timer2(29, YM2610.F2610.timer_callback_0, "timer_callback_0")); + // lt2.Add(new emu_timer2(30, YM2610.F2610.timer_callback_1, "timer_callback_1")); + // lt2.Add(new emu_timer2(31, Neogeo.sprite_line_timer_callback, "sprite_line_timer_callback")); + // lt2.Add(new emu_timer2(32, M6800.action_rx, "m6800_rx_tick")); + // lt2.Add(new emu_timer2(33, M6800.action_tx, "m6800_tx_tick")); + // lt2.Add(new emu_timer2(34, YM3812.timer_callback_3812_0, "timer_callback_3812_0")); + // lt2.Add(new emu_timer2(35, YM3812.timer_callback_3812_1, "timer_callback_3812_1")); + // lt2.Add(new emu_timer2(36, ICS2115.timer_cb_0, "timer_cb_0")); + // lt2.Add(new emu_timer2(37, ICS2115.timer_cb_1, "timer_cb_1")); + // lt2.Add(new emu_timer2(38, M72.m72_scanline_interrupt, "m72_scanline_interrupt")); + // lt2.Add(new emu_timer2(39, setvector, "setvector_callback")); + // lt2.Add(new emu_timer2(40, M92.m92_scanline_interrupt, "m92_scanline_interrupt")); + // lt2.Add(new emu_timer2(41, Cpuexec.cpu_timeslicecallback, "cpu_timeslicecallback")); + // lt2.Add(new emu_timer2(42, Cpuexec.vblank_interrupt2, "vblank_interrupt2")); + // lt2.Add(new emu_timer2(43, Konami68000.nmi_callback, "nmi_callback")); + // lt2.Add(new emu_timer2(44, Upd7759.upd7759_slave_update, "upd7759_slave_update")); + // lt2.Add(new emu_timer2(45, Generic.irq_2_0_line_hold, "irq_2_0_line_hold")); + // lt2.Add(new emu_timer2(46, MSM5205.MSM5205_vclk_callback0, "msm5205_vclk_callback0")); + // lt2.Add(new emu_timer2(47, MSM5205.MSM5205_vclk_callback1, "msm5205_vclk_callback1")); + // lt2.Add(new emu_timer2(48, YM2203.timer_callback_2203_0_0, "timer_callback_2203_0_0")); + // lt2.Add(new emu_timer2(49, YM2203.timer_callback_2203_0_1, "timer_callback_2203_0_1")); + // lt2.Add(new emu_timer2(50, YM2203.timer_callback_2203_1_0, "timer_callback_2203_1_0")); + // lt2.Add(new emu_timer2(51, YM2203.timer_callback_2203_1_1, "timer_callback_2203_1_1")); + // lt2.Add(new emu_timer2(52, YM3812.timer_callback_3526_0, "timer_callback_3526_0")); + // lt2.Add(new emu_timer2(53, YM3812.timer_callback_3526_1, "timer_callback_3526_1")); + // lt2.Add(new emu_timer2(54, K054539.k054539_irq, "k054539_irq")); + // lt2.Add(new emu_timer2(55, Taito.cchip_timer, "cchip_timer")); + //} + public static void timer_init() + { + global_basetime = Attotime.ATTOTIME_ZERO; + lt = new List(); + lt2 = new List(); + lt2.Add(new emu_timer2(1, TIME_ACT.Video_vblank_begin_callback)); + lt2.Add(new emu_timer2(2, TIME_ACT.Mame_soft_reset)); + lt2.Add(new emu_timer2(3, TIME_ACT.Cpuint_cpunum_empty_event_queue)); + lt2.Add(new emu_timer2(4, TIME_ACT.Sound_sound_update)); + lt2.Add(new emu_timer2(5, TIME_ACT.Watchdog_watchdog_callback)); + lt2.Add(new emu_timer2(6, TIME_ACT.Generic_irq_1_0_line_hold)); + lt2.Add(new emu_timer2(7, TIME_ACT.Video_vblank_end_callback)); + lt2.Add(new emu_timer2(10, TIME_ACT.YM2151_irqAon_callback)); + lt2.Add(new emu_timer2(11, TIME_ACT.YM2151_irqBon_callback)); + lt2.Add(new emu_timer2(12, TIME_ACT.YM2151_irqAoff_callback)); + lt2.Add(new emu_timer2(13, TIME_ACT.YM2151_irqBoff_callback)); + lt2.Add(new emu_timer2(14, TIME_ACT.YM2151_timer_callback_a)); + lt2.Add(new emu_timer2(15, TIME_ACT.YM2151_timer_callback_b)); + lt2.Add(new emu_timer2(16, TIME_ACT.Cpuexec_trigger_partial_frame_interrupt)); + lt2.Add(new emu_timer2(17, TIME_ACT.Cpuexec_null_callback)); + lt2.Add(new emu_timer2(18, TIME_ACT.Cpuexec_end_interleave_boost)); + lt2.Add(new emu_timer2(19, TIME_ACT.Video_scanline0_callback)); + lt2.Add(new emu_timer2(20, TIME_ACT.Sound_latch_callback)); + lt2.Add(new emu_timer2(21, TIME_ACT.Sound_latch_callback2)); + lt2.Add(new emu_timer2(22, TIME_ACT.Sound_latch_callback3)); + lt2.Add(new emu_timer2(23, TIME_ACT.Sound_latch_callback4)); + lt2.Add(new emu_timer2(24, TIME_ACT.Neogeo_display_position_interrupt_callback)); + lt2.Add(new emu_timer2(25, TIME_ACT.Neogeo_display_position_vblank_callback)); + lt2.Add(new emu_timer2(26, TIME_ACT.Neogeo_vblank_interrupt_callback)); + lt2.Add(new emu_timer2(27, TIME_ACT.Neogeo_auto_animation_timer_callback)); + lt2.Add(new emu_timer2(29, TIME_ACT.YM2610_F2610_timer_callback_0)); + lt2.Add(new emu_timer2(30, TIME_ACT.YM2610_F2610_timer_callback_1)); + lt2.Add(new emu_timer2(31, TIME_ACT.Neogeo_sprite_line_timer_callback)); + lt2.Add(new emu_timer2(32, TIME_ACT.M6800_action_rx)); + lt2.Add(new emu_timer2(33, TIME_ACT.M6800_action_tx)); + lt2.Add(new emu_timer2(34, TIME_ACT.YM3812_timer_callback_3812_0)); + lt2.Add(new emu_timer2(35, TIME_ACT.YM3812_timer_callback_3812_1)); + lt2.Add(new emu_timer2(36, TIME_ACT.ICS2115_timer_cb_0)); + lt2.Add(new emu_timer2(37, TIME_ACT.ICS2115_timer_cb_1)); + lt2.Add(new emu_timer2(38, TIME_ACT.M72_m72_scanline_interrupt)); + lt2.Add(new emu_timer2(39, TIME_ACT.setvector)); + lt2.Add(new emu_timer2(40, TIME_ACT.M92_m92_scanline_interrupt)); + lt2.Add(new emu_timer2(41, TIME_ACT.Cpuexec_cpu_timeslicecallback)); + lt2.Add(new emu_timer2(42, TIME_ACT.Cpuexec_vblank_interrupt2)); + lt2.Add(new emu_timer2(43, TIME_ACT.Konami68000_nmi_callback)); + lt2.Add(new emu_timer2(44, TIME_ACT.Upd7759_upd7759_slave_update)); + lt2.Add(new emu_timer2(45, TIME_ACT.Generic_irq_2_0_line_hold)); + lt2.Add(new emu_timer2(46, TIME_ACT.MSM5205_MSM5205_vclk_callback0)); + lt2.Add(new emu_timer2(47, TIME_ACT.MSM5205_MSM5205_vclk_callback1)); + lt2.Add(new emu_timer2(48, TIME_ACT.YM2203_timer_callback_2203_0_0)); + lt2.Add(new emu_timer2(49, TIME_ACT.YM2203_timer_callback_2203_0_1)); + lt2.Add(new emu_timer2(50, TIME_ACT.YM2203_timer_callback_2203_1_0)); + lt2.Add(new emu_timer2(51, TIME_ACT.YM2203_timer_callback_2203_1_1)); + lt2.Add(new emu_timer2(52, TIME_ACT.YM3812_timer_callback_3526_0)); + lt2.Add(new emu_timer2(53, TIME_ACT.YM3812_timer_callback_3526_1)); + lt2.Add(new emu_timer2(54, TIME_ACT.K054539_k054539_irq)); + lt2.Add(new emu_timer2(55, TIME_ACT.Taito_cchip_timer)); + } + + + #region 更换调度 + + public enum TIME_ACT : byte + { + NoneAct = 0, + Video_vblank_begin_callback, + Mame_soft_reset, + Cpuint_cpunum_empty_event_queue, + Sound_sound_update, + Watchdog_watchdog_callback, + Generic_irq_1_0_line_hold, + Video_vblank_end_callback, + YM2151_irqAon_callback, + YM2151_irqBon_callback, + YM2151_irqAoff_callback, + YM2151_irqBoff_callback, + YM2151_timer_callback_a, + YM2151_timer_callback_b, + Cpuexec_trigger_partial_frame_interrupt, + Cpuexec_null_callback, + Cpuexec_end_interleave_boost, + Video_scanline0_callback, + Sound_latch_callback, + Sound_latch_callback2, + Sound_latch_callback3, + Sound_latch_callback4, + Neogeo_display_position_interrupt_callback, + Neogeo_display_position_vblank_callback, + Neogeo_vblank_interrupt_callback, + Neogeo_auto_animation_timer_callback, + YM2610_F2610_timer_callback_0, + YM2610_F2610_timer_callback_1, + Neogeo_sprite_line_timer_callback, + M6800_action_rx, + M6800_action_tx, + YM3812_timer_callback_3812_0, + YM3812_timer_callback_3812_1, + ICS2115_timer_cb_0, + ICS2115_timer_cb_1, + M72_m72_scanline_interrupt, + setvector, + M92_m92_scanline_interrupt, + Cpuexec_cpu_timeslicecallback, + Cpuexec_vblank_interrupt2, + Konami68000_nmi_callback, + Upd7759_upd7759_slave_update, + Generic_irq_2_0_line_hold, + MSM5205_MSM5205_vclk_callback0, + MSM5205_MSM5205_vclk_callback1, + YM2203_timer_callback_2203_0_0, + YM2203_timer_callback_2203_0_1, + YM2203_timer_callback_2203_1_0, + YM2203_timer_callback_2203_1_1, + YM3812_timer_callback_3526_0, + YM3812_timer_callback_3526_1, + K054539_k054539_irq, + Taito_cchip_timer, + + + + Cpuexec_trigger2, + Taitob_rsaga2_interrupt2, + Taitob_crimec_interrupt3, + Taitob_hitice_interrupt6, + Taitob_rambo3_interrupt1, + Taitob_pbobble_interrupt5, + Taitob_viofight_interrupt1, + Taitob_masterw_interrupt4, + Taitob_silentd_interrupt4, + Taitob_selfeena_interrupt4, + Taitob_sbm_interrupt5, + Generic_clear_all_lines, + M92_spritebuffer_callback, + Taito_opwolf_timer_callback, + Taito_nmi_callback, + } + + public static void DoAct(TIME_ACT act) + { + switch (act) + { + case TIME_ACT.Video_vblank_begin_callback: Video.vblank_begin_callback(); break; + case TIME_ACT.Mame_soft_reset: Mame.soft_reset(); break; + case TIME_ACT.Cpuint_cpunum_empty_event_queue: Cpuint.cpunum_empty_event_queue(); break; + case TIME_ACT.Sound_sound_update: Sound.sound_update(); break; + case TIME_ACT.Watchdog_watchdog_callback: Watchdog.watchdog_callback(); break; + case TIME_ACT.Generic_irq_1_0_line_hold: Generic.irq_1_0_line_hold(); break; + case TIME_ACT.Video_vblank_end_callback: Video.vblank_end_callback(); break; + case TIME_ACT.YM2151_irqAon_callback: YM2151.irqAon_callback(); break; + case TIME_ACT.YM2151_irqBon_callback: YM2151.irqBon_callback(); break; + case TIME_ACT.YM2151_irqAoff_callback: YM2151.irqAoff_callback(); break; + case TIME_ACT.YM2151_irqBoff_callback: YM2151.irqBoff_callback(); break; + case TIME_ACT.YM2151_timer_callback_a: YM2151.timer_callback_a(); break; + case TIME_ACT.YM2151_timer_callback_b: YM2151.timer_callback_b(); break; + case TIME_ACT.Cpuexec_trigger_partial_frame_interrupt: Cpuexec.trigger_partial_frame_interrupt(); break; + case TIME_ACT.Cpuexec_null_callback: Cpuexec.null_callback(); break; + case TIME_ACT.Cpuexec_end_interleave_boost: Cpuexec.end_interleave_boost(); break; + case TIME_ACT.Video_scanline0_callback: Video.scanline0_callback(); break; + case TIME_ACT.Sound_latch_callback: Sound.latch_callback(); break; + case TIME_ACT.Sound_latch_callback2: Sound.latch_callback2(); break; + case TIME_ACT.Sound_latch_callback3: Sound.latch_callback3(); break; + case TIME_ACT.Sound_latch_callback4: Sound.latch_callback4(); break; + case TIME_ACT.Neogeo_display_position_interrupt_callback: Neogeo.display_position_interrupt_callback(); break; + case TIME_ACT.Neogeo_display_position_vblank_callback: Neogeo.display_position_vblank_callback(); break; + case TIME_ACT.Neogeo_vblank_interrupt_callback: Neogeo.vblank_interrupt_callback(); break; + case TIME_ACT.Neogeo_auto_animation_timer_callback: Neogeo.auto_animation_timer_callback(); break; + case TIME_ACT.YM2610_F2610_timer_callback_0: YM2610.F2610.timer_callback_0(); break; + case TIME_ACT.YM2610_F2610_timer_callback_1: YM2610.F2610.timer_callback_1(); break; + case TIME_ACT.Neogeo_sprite_line_timer_callback: Neogeo.sprite_line_timer_callback(); break; + case TIME_ACT.M6800_action_rx: M6800.action_rx(); break; + case TIME_ACT.M6800_action_tx: M6800.action_tx(); break; + case TIME_ACT.YM3812_timer_callback_3812_0: YM3812.timer_callback_3812_0(); break; + case TIME_ACT.YM3812_timer_callback_3812_1: YM3812.timer_callback_3812_1(); break; + case TIME_ACT.ICS2115_timer_cb_0: ICS2115.timer_cb_0(); break; + case TIME_ACT.ICS2115_timer_cb_1: ICS2115.timer_cb_1(); break; + case TIME_ACT.M72_m72_scanline_interrupt: M72.m72_scanline_interrupt(); break; + case TIME_ACT.setvector: setvector(); break; + case TIME_ACT.M92_m92_scanline_interrupt: M92.m92_scanline_interrupt(); break; + case TIME_ACT.Cpuexec_cpu_timeslicecallback: Cpuexec.cpu_timeslicecallback(); break; + case TIME_ACT.Cpuexec_vblank_interrupt2: Cpuexec.vblank_interrupt2(); break; + case TIME_ACT.Konami68000_nmi_callback: Konami68000.nmi_callback(); break; + case TIME_ACT.Upd7759_upd7759_slave_update: Upd7759.upd7759_slave_update(); break; + case TIME_ACT.Generic_irq_2_0_line_hold: Generic.irq_2_0_line_hold(); break; + case TIME_ACT.MSM5205_MSM5205_vclk_callback0: MSM5205.MSM5205_vclk_callback0(); break; + case TIME_ACT.MSM5205_MSM5205_vclk_callback1: MSM5205.MSM5205_vclk_callback1(); break; + case TIME_ACT.YM2203_timer_callback_2203_0_0: YM2203.timer_callback_2203_0_0(); break; + case TIME_ACT.YM2203_timer_callback_2203_0_1: YM2203.timer_callback_2203_0_1(); break; + case TIME_ACT.YM2203_timer_callback_2203_1_0: YM2203.timer_callback_2203_1_0(); break; + case TIME_ACT.YM2203_timer_callback_2203_1_1: YM2203.timer_callback_2203_1_1(); break; + case TIME_ACT.YM3812_timer_callback_3526_0: YM3812.timer_callback_3526_0(); break; + case TIME_ACT.YM3812_timer_callback_3526_1: YM3812.timer_callback_3526_1(); break; + case TIME_ACT.K054539_k054539_irq: K054539.k054539_irq(); break; + case TIME_ACT.Taito_cchip_timer: Taito.cchip_timer(); break; + + case TIME_ACT.Cpuexec_trigger2: Cpuexec.trigger2(); break; + + + case TIME_ACT.Taitob_rsaga2_interrupt2: Taitob.rsaga2_interrupt2(); break; + case TIME_ACT.Taitob_crimec_interrupt3: Taitob.crimec_interrupt3(); break; + case TIME_ACT.Taitob_hitice_interrupt6: Taitob.hitice_interrupt6(); break; + case TIME_ACT.Taitob_rambo3_interrupt1: Taitob.rambo3_interrupt1(); break; + case TIME_ACT.Taitob_pbobble_interrupt5: Taitob.pbobble_interrupt5(); break; + case TIME_ACT.Taitob_viofight_interrupt1: Taitob.viofight_interrupt1(); break; + case TIME_ACT.Taitob_masterw_interrupt4: Taitob.masterw_interrupt4(); break; + case TIME_ACT.Taitob_silentd_interrupt4: Taitob.silentd_interrupt4(); break; + case TIME_ACT.Taitob_selfeena_interrupt4: Taitob.selfeena_interrupt4(); break; + case TIME_ACT.Taitob_sbm_interrupt5: Taitob.sbm_interrupt5(); break; + + case TIME_ACT.Generic_clear_all_lines: Generic.clear_all_lines(); break; + case TIME_ACT.M92_spritebuffer_callback: M92.spritebuffer_callback(); break;//!! + case TIME_ACT.Taito_opwolf_timer_callback: Taito.opwolf_timer_callback(); break; + case TIME_ACT.Taito_nmi_callback: Taito.nmi_callback(); break; + } + } + #endregion + public static Atime get_current_time() + { + if (callback_timer != null) + { + return callback_timer_expire_time; + } + if (Cpuexec.activecpu >= 0 && Cpuexec.activecpu < Cpuexec.ncpu) + { + return Cpuexec.cpunum_get_localtime(Cpuexec.activecpu); + } + return global_basetime; + } + public static void timer_remove(emu_timer timer1) + { + if (timer1 == callback_timer) + { + callback_timer_modified = true; + } + timer_list_remove(timer1); + } + public static void timer_adjust_periodic(emu_timer which, Atime start_delay, Atime period) + { + Atime time = get_current_time(); + if (which == callback_timer) + { + callback_timer_modified = true; + } + which.enabled = true; + if (start_delay.seconds < 0) + { + start_delay = Attotime.ATTOTIME_ZERO; + } + which.start = time; + which.expire = Attotime.attotime_add(time, start_delay); + which.period = period; + timer_list_remove(which); + timer_list_insert(which); + if (lt.IndexOf(which) == 0) + { + if (Cpuexec.activecpu >= 0 && Cpuexec.activecpu < Cpuexec.ncpu) + { + Cpuexec.activecpu_abort_timeslice(Cpuexec.activecpu); + } + } + } + public static void timer_pulse_internal(Atime period, TIME_ACT action) + { + emu_timer timer = timer_alloc_common(action, false); + timer_adjust_periodic(timer, period, period); + } + public static void timer_set_internal(TIME_ACT action) + { + emu_timer timer = timer_alloc_common(action, true); + timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + public static void timer_list_insert(emu_timer timer1) + { + int i; + int i1 = -1; + if (timer1.action == TIME_ACT.Cpuint_cpunum_empty_event_queue || timer1.action == TIME_ACT.setvector) + { + foreach (emu_timer et in lt) + { + if (et.action == timer1.action && Attotime.attotime_compare(et.expire, global_basetime) <= 0) + { + i1 = lt.IndexOf(et); + break; + } + } + } + if (i1 == -1) + { + Atime expire = timer1.enabled ? timer1.expire : Attotime.ATTOTIME_NEVER; + for (i = 0; i < lt.Count; i++) + { + if (Attotime.attotime_compare(lt[i].expire, expire) > 0) + { + break; + } + } + lt.Insert(i, timer1); + } + } + + static List timer_list_remove_lt1 = new List(); + public static void timer_list_remove(emu_timer timer1) + { + if (timer1.action == TIME_ACT.Cpuint_cpunum_empty_event_queue || timer1.action == TIME_ACT.setvector) + { + timer_list_remove_lt1.Clear(); + foreach (emu_timer et in lt) + { + if (et.action == timer1.action && Attotime.attotime_compare(et.expire, timer1.expire) == 0) + { + timer_list_remove_lt1.Add(et); + //lt.Remove(et); + //break; + } + else if (et.action == timer1.action && Attotime.attotime_compare(et.expire, timer1.expire) < 0) + { + int i1 = 1; + } + else if (et.action == timer1.action && Attotime.attotime_compare(et.expire, timer1.expire) > 0) + { + int i1 = 1; + } + } + foreach (emu_timer et1 in timer_list_remove_lt1) + { + lt.Remove(et1); + } + } + else + { + foreach (emu_timer et in lt) + { + if (et.action == timer1.action) + { + lt.Remove(et); + break; + } + } + } + } + /*public static void sort() + { + int i1, i2, n1; + Atime expire1, expire2; + n1 = lt.Count; + for (i2 = 1; i2 < n1; i2++) + { + for (i1 = 0; i1 < i2; i1++) + { + if (lt[i1].enabled ==true) + { + expire1 = lt[i1].expire; + } + else + { + expire1 = Attotime.ATTOTIME_NEVER; + } + if (lt[i2].enabled == true) + { + expire2 = lt[i2].expire; + } + else + { + expire2 = Attotime.ATTOTIME_NEVER; + } + if (Attotime.attotime_compare(expire1, expire2) > 0) + { + var temp = lt[i1]; + lt[i1] = lt[i2]; + lt[i2] = temp; + } + } + } + }*/ + public static void timer_set_global_time(Atime newbase) + { + emu_timer timer; + global_basetime = newbase; + while (Attotime.attotime_compare(lt[0].expire, global_basetime) <= 0) + { + bool was_enabled = lt[0].enabled; + timer = lt[0]; + if (Attotime.attotime_compare(timer.period, Attotime.ATTOTIME_ZERO) == 0 || Attotime.attotime_compare(timer.period, Attotime.ATTOTIME_NEVER) == 0) + { + timer.enabled = false; + } + callback_timer_modified = false; + callback_timer = timer; + callback_timer_expire_time = timer.expire; + //if (was_enabled && (timer.action != null && timer.action != Cpuexec.null_callback)) + if (was_enabled && (timer.action != TIME_ACT.NoneAct && timer.action != TIME_ACT.Cpuexec_null_callback)) + { + //timer.action(); + DoAct(timer.action); + } + callback_timer = null; + if (callback_timer_modified == false) + { + if (timer.temporary) + { + timer_list_remove(timer); + } + else + { + timer.start = timer.expire; + timer.expire = Attotime.attotime_add(timer.expire, timer.period); + timer_list_remove(timer); + timer_list_insert(timer); + } + } + } + } + public static emu_timer timer_alloc_common(TIME_ACT action, bool temp) + { + Atime time = get_current_time(); + emu_timer timer = new emu_timer(); + timer.action = action; + timer.enabled = false; + timer.temporary = temp; + timer.period = Attotime.ATTOTIME_ZERO; + //timer.func = func; + timer.start = time; + timer.expire = Attotime.ATTOTIME_NEVER; + timer_list_insert(timer); + return timer; + } + public static bool timer_enable(emu_timer which, bool enable) + { + bool old; + old = which.enabled; + which.enabled = enable; + timer_list_remove(which); + timer_list_insert(which); + return old; + } + public static bool timer_enabled(emu_timer which) + { + return which.enabled; + } + public static Atime timer_timeleft(emu_timer which) + { + return Attotime.attotime_sub(which.expire, get_current_time()); + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i, i1, n; + n = lt.Count; + writer.Write(n); + for (i = 0; i < n; i++) + { + i1 = getindexbyaction(lt[i].action); + writer.Write(i1); + writer.Write(lt[i].enabled); + writer.Write(lt[i].temporary); + writer.Write(lt[i].period.seconds); + writer.Write(lt[i].period.attoseconds); + writer.Write(lt[i].start.seconds); + writer.Write(lt[i].start.attoseconds); + writer.Write(lt[i].expire.seconds); + writer.Write(lt[i].expire.attoseconds); + } + for (i = n; i < 32; i++) + { + writer.Write(0); + writer.Write(false); + writer.Write(false); + writer.Write(0); + writer.Write((long)0); + writer.Write(0); + writer.Write((long)0); + writer.Write(0); + writer.Write((long)0); + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, i1, n; + n = reader.ReadInt32(); + lt = new List(); + for (i = 0; i < n; i++) + { + lt.Add(new emu_timer()); + i1 = reader.ReadInt32(); + lt[i].action = getactionbyindex(i1); + //lt[i].func = getfuncbyindex(i1); + lt[i].enabled = reader.ReadBoolean(); + lt[i].temporary = reader.ReadBoolean(); + lt[i].period.seconds = reader.ReadInt32(); + lt[i].period.attoseconds = reader.ReadInt64(); + lt[i].start.seconds = reader.ReadInt32(); + lt[i].start.attoseconds = reader.ReadInt64(); + lt[i].expire.seconds = reader.ReadInt32(); + lt[i].expire.attoseconds = reader.ReadInt64(); + //if (lt[i].func == "vblank_begin_callback") + if (lt[i].action == TIME_ACT.Video_vblank_begin_callback) + { + Video.vblank_begin_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Video.vblank_begin_timer); + } + else if (lt[i].action == TIME_ACT.Video_vblank_end_callback) + { + Video.vblank_end_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Video.vblank_end_timer); + } + else if (lt[i].action == TIME_ACT.Mame_soft_reset) + { + Mame.soft_reset_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Mame.soft_reset_timer); + } + else if (lt[i].action == TIME_ACT.Watchdog_watchdog_callback) + { + Watchdog.watchdog_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Watchdog.watchdog_timer); + } + else if (lt[i].action == TIME_ACT.Generic_irq_1_0_line_hold) + { + Cpuexec.timedint_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.timedint_timer); + } + else if (lt[i].action == TIME_ACT.YM2151_timer_callback_a) + { + YM2151.PSG.timer_A = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2151.PSG.timer_A); + } + else if (lt[i].action == TIME_ACT.YM2151_timer_callback_b) + { + YM2151.PSG.timer_B = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2151.PSG.timer_B); + } + else if (lt[i].action == TIME_ACT.Cpuexec_trigger_partial_frame_interrupt) + { + switch (Machine.sBoard) + { + case "CPS2": + case "IGS011": + case "Konami68000": + Cpuexec.cpu[0].partial_frame_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.cpu[0].partial_frame_timer); + break; + case "M72": + Cpuexec.cpu[1].partial_frame_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.cpu[1].partial_frame_timer); + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Cpuexec.cpu[1].partial_frame_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.cpu[1].partial_frame_timer); + break; + } + break; + } + } + else if (lt[i].action == TIME_ACT.Cpuexec_null_callback) + { + Cpuexec.interleave_boost_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.interleave_boost_timer); + } + else if (lt[i].action == TIME_ACT.Cpuexec_end_interleave_boost) + { + Cpuexec.interleave_boost_timer_end = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.interleave_boost_timer_end); + } + else if (lt[i].action == TIME_ACT.Video_scanline0_callback) + { + Video.scanline0_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Video.scanline0_timer); + } + else if (lt[i].action == TIME_ACT.Neogeo_display_position_interrupt_callback) + { + Neogeo.display_position_interrupt_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Neogeo.display_position_interrupt_timer); + } + else if (lt[i].action == TIME_ACT.Neogeo_display_position_vblank_callback) + { + Neogeo.display_position_vblank_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Neogeo.display_position_vblank_timer); + } + else if (lt[i].action == TIME_ACT.Neogeo_vblank_interrupt_callback) + { + Neogeo.vblank_interrupt_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Neogeo.vblank_interrupt_timer); + } + else if (lt[i].action == TIME_ACT.Neogeo_auto_animation_timer_callback) + { + Neogeo.auto_animation_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Neogeo.auto_animation_timer); + } + else if (lt[i].action == TIME_ACT.Neogeo_sprite_line_timer_callback) + { + Neogeo.sprite_line_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Neogeo.sprite_line_timer); + } + else if (lt[i].action == TIME_ACT.YM2610_F2610_timer_callback_0) + { + YM2610.timer[0] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2610.timer[0]); + } + else if (lt[i].action == TIME_ACT.YM2610_F2610_timer_callback_1) + { + YM2610.timer[1] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2610.timer[1]); + } + else if (lt[i].action == TIME_ACT.M6800_action_rx) + { + M6800.m1.m6800_rx_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(M6800.m1.m6800_rx_timer); + } + else if (lt[i].action == TIME_ACT.M6800_action_tx) + { + M6800.m1.m6800_tx_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(M6800.m1.m6800_tx_timer); + } + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3812_0) + { + YM3812.timer[0] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM3812.timer[0]); + } + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3812_1) + { + YM3812.timer[1] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM3812.timer[1]); + } + else if (lt[i].action == TIME_ACT.ICS2115_timer_cb_0) + { + ICS2115.timer[0].timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(ICS2115.timer[0].timer); + } + else if (lt[i].action == TIME_ACT.ICS2115_timer_cb_1) + { + ICS2115.timer[1].timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(ICS2115.timer[1].timer); + } + else if (lt[i].action == TIME_ACT.M72_m72_scanline_interrupt) + { + M72.scanline_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(M72.scanline_timer); + } + else if (lt[i].action == TIME_ACT.M92_m92_scanline_interrupt) + { + M92.scanline_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(M92.scanline_timer); + } + else if (lt[i].action == TIME_ACT.Cpuexec_cpu_timeslicecallback) + { + Cpuexec.timeslice_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.timeslice_timer); + } + else if (lt[i].action == TIME_ACT.Upd7759_upd7759_slave_update) + { + Upd7759.chip.timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Upd7759.chip.timer); + } + else if (lt[i].action == TIME_ACT.Generic_irq_2_0_line_hold) + { + Cpuexec.timedint_timer = lt[i]; + lt.Remove(lt[i]); + lt.Add(Cpuexec.timedint_timer); + } + else if (lt[i].action == TIME_ACT.MSM5205_MSM5205_vclk_callback0) + { + MSM5205.timer[0] = lt[i]; + lt.Remove(lt[i]); + lt.Add(MSM5205.timer[0]); + } + else if (lt[i].action == TIME_ACT.MSM5205_MSM5205_vclk_callback1) + { + MSM5205.timer[1] = lt[i]; + lt.Remove(lt[i]); + lt.Add(MSM5205.timer[1]); + } + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_0_0) + { + YM2203.FF2203[0].timer[0] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2203.FF2203[0].timer[0]); + } + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_0_1) + { + YM2203.FF2203[0].timer[1] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2203.FF2203[0].timer[1]); + } + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_1_0) + { + YM2203.FF2203[1].timer[0] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2203.FF2203[1].timer[0]); + } + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_1_1) + { + YM2203.FF2203[1].timer[1] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM2203.FF2203[1].timer[1]); + } + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3526_0) + { + YM3812.timer[0] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM3812.timer[0]); + } + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3526_1) + { + YM3812.timer[1] = lt[i]; + lt.Remove(lt[i]); + lt.Add(YM3812.timer[1]); + } + } + for (i = n; i < 32; i++) + { + reader.ReadInt32(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadInt32(); + reader.ReadInt64(); + reader.ReadInt32(); + reader.ReadInt64(); + reader.ReadInt32(); + reader.ReadInt64(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs.meta new file mode 100644 index 00000000..d8156200 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50053683b6f8baa48960a9733840ce07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Generic.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Generic.cs new file mode 100644 index 00000000..ece271ae --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Generic.cs @@ -0,0 +1,633 @@ +using cpu.m68000; +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe class Generic + { + //private static uint[] coin_count; + //private static uint[] coinlockedout; + //private static uint[] lastcoin; + //public static byte[] videoram, colorram; + //public static byte[] generic_nvram; + //public static byte[] buffered_spriteram; + //public static ushort[] buffered_spriteram16; + //public static byte[] spriteram; + //public static ushort[] spriteram16, spriteram16_2; + //public static byte[] paletteram, paletteram_2; + //public static ushort[] paletteram16, paletteram16_2; + + #region //指针化coin_count + static uint[] coin_count_src; + static GCHandle coin_count_handle; + public static uint* coin_count; + public static int coin_countLength; + public static uint[] coin_count_set + { + set + { + coin_count_handle.ReleaseGCHandle(); + coin_count_src = value; + coin_countLength = value.Length; + coin_count_src.GetObjectPtr(ref coin_count_handle, ref coin_count); + } + } + #endregion + + #region //指针化coinlockedout + static uint[] coinlockedout_src; + static GCHandle coinlockedout_handle; + public static uint* coinlockedout; + public static int coinlockedoutLength; + public static uint[] coinlockedout_set + { + set + { + coinlockedout_handle.ReleaseGCHandle(); + coinlockedout_src = value; + coinlockedoutLength = value.Length; + coinlockedout_src.GetObjectPtr(ref coinlockedout_handle, ref coinlockedout); + } + } + #endregion + + #region //指针化lastcoin + static uint[] lastcoin_src; + static GCHandle lastcoin_handle; + public static uint* lastcoin; + public static int lastcoinLength; + public static uint[] lastcoin_set + { + set + { + lastcoin_handle.ReleaseGCHandle(); + lastcoin_src = value; + lastcoinLength = value.Length; + lastcoin_src.GetObjectPtr(ref lastcoin_handle, ref lastcoin); + } + } + #endregion + + #region //指针化colorram + static byte[] colorram_src; + static GCHandle colorram_handle; + public static byte* colorram; + public static int colorramLength; + public static byte[] colorram_set + { + set + { + colorram_handle.ReleaseGCHandle(); + colorram_src = value; + colorramLength = value.Length; + colorram_src.GetObjectPtr(ref colorram_handle, ref colorram); + } + } + #endregion + + #region //指针化videoram + static byte[] videoram_src; + static GCHandle videoram_handle; + public static byte* videoram; + public static int videoramLength; + public static byte[] videoram_set + { + set + { + videoram_handle.ReleaseGCHandle(); + if (value == null) + return; + videoram_src = value; + videoramLength = value.Length; + videoram_src.GetObjectPtr(ref videoram_handle, ref videoram); + } + } + #endregion + + #region //指针化generic_nvram + static byte[] generic_nvram_src; + static GCHandle generic_nvram_handle; + public static byte* generic_nvram; + public static int generic_nvramLength; + public static byte[] generic_nvram_set + { + set + { + generic_nvram_handle.ReleaseGCHandle(); + generic_nvram_src = value; + generic_nvramLength = value.Length; + generic_nvram_src.GetObjectPtr(ref generic_nvram_handle, ref generic_nvram); + } + } + #endregion + + #region //指针化buffered_spriteram + static byte[] buffered_spriteram_src; + static GCHandle buffered_spriteram_handle; + public static byte* buffered_spriteram; + public static int buffered_spriteramLength; + public static byte[] buffered_spriteram_set + { + set + { + buffered_spriteram_handle.ReleaseGCHandle(); + buffered_spriteram_src = value; + buffered_spriteramLength = value.Length; + buffered_spriteram_src.GetObjectPtr(ref buffered_spriteram_handle, ref buffered_spriteram); + } + } + #endregion + + #region //指针化buffered_spriteram16 + static ushort[] buffered_spriteram16_src; + static GCHandle buffered_spriteram16_handle; + public static ushort* buffered_spriteram16; + public static int buffered_spriteram16Length; + public static ushort[] buffered_spriteram16_set + { + set + { + buffered_spriteram16_handle.ReleaseGCHandle(); + buffered_spriteram16_src = value; + buffered_spriteram16Length = value.Length; + buffered_spriteram16_src.GetObjectPtr(ref buffered_spriteram16_handle, ref buffered_spriteram16); + } + } + #endregion + + + #region //指针化spriteram + static byte[] spriteram_src; + static GCHandle spriteram_handle; + public static byte* spriteram; + public static int spriteramLength; + public static byte[] spriteram_set + { + set + { + spriteram_handle.ReleaseGCHandle(); + if (value == null) + return; + spriteram_src = value; + spriteramLength = value.Length; + spriteram_src.GetObjectPtr(ref spriteram_handle, ref spriteram); + } + } + #endregion + + #region //指针化spriteram16 + static ushort[] spriteram16_src; + static GCHandle spriteram16_handle; + public static ushort* spriteram16; + public static int spriteram16Length; + public static ushort[] spriteram16_set + { + set + { + spriteram16_handle.ReleaseGCHandle(); + if (value == null) + return; + spriteram16_src = value; + spriteram16Length = value.Length; + spriteram16_src.GetObjectPtr(ref spriteram16_handle, ref spriteram16); + } + } + #endregion + + #region //指针化spriteram16_2 + static ushort[] spriteram16_2_src; + static GCHandle spriteram16_2_handle; + public static ushort* spriteram16_2; + public static int spriteram16_2Length; + public static ushort[] spriteram16_2_set + { + set + { + spriteram16_2_handle.ReleaseGCHandle(); + if (value == null) + return; + spriteram16_2_src = value; + spriteram16_2Length = value.Length; + spriteram16_2_src.GetObjectPtr(ref spriteram16_2_handle, ref spriteram16_2); + } + } + #endregion + + #region //指针化paletteram + static byte[] paletteram_src; + static GCHandle paletteram_handle; + public static byte* paletteram; + public static int paletteramLength; + public static byte[] paletteram_set + { + set + { + paletteram_handle.ReleaseGCHandle(); + paletteram_src = value; + paletteramLength = value.Length; + paletteram_src.GetObjectPtr(ref paletteram_handle, ref paletteram); + } + } + #endregion + + #region //指针化paletteram_2 + static byte[] paletteram_2_src; + static GCHandle paletteram_2_handle; + public static byte* paletteram_2; + public static int paletteram_2Length; + public static byte[] paletteram_2_set + { + set + { + paletteram_2_handle.ReleaseGCHandle(); + paletteram_2_src = value; + paletteram_2Length = value.Length; + paletteram_2_src.GetObjectPtr(ref paletteram_2_handle, ref paletteram_2); + } + } + #endregion + + #region //指针化paletteram16 + static ushort[] paletteram16_src; + static GCHandle paletteram16_handle; + public static ushort* paletteram16; + public static int paletteram16Length; + public static ushort[] paletteram16_set + { + set + { + paletteram16_handle.ReleaseGCHandle(); + paletteram16_src = value; + paletteram16Length = value.Length; + paletteram16_src.GetObjectPtr(ref paletteram16_handle, ref paletteram16); + } + } + #endregion + + + #region //指针化paletteram16_2 + static ushort[] paletteram16_2_src; + static GCHandle paletteram16_2_handle; + public static ushort* paletteram16_2; + public static int paletteram16_2Length; + public static ushort[] paletteram16_2_set + { + set + { + paletteram16_2_handle.ReleaseGCHandle(); + paletteram16_2_src = value; + paletteram16_2Length = value.Length; + paletteram16_2_src.GetObjectPtr(ref paletteram16_2_handle, ref paletteram16_2); + } + } + #endregion + + + public static int[] interrupt_enable; + public static int objcpunum; + public static int flip_screen_x, flip_screen_y; + public static void generic_machine_init() + { + int counternum; + coin_count_set = new uint[8]; + coinlockedout_set = new uint[8]; + lastcoin_set = new uint[8]; + for (counternum = 0; counternum < 8; counternum++) + { + lastcoin[counternum] = 0; + coinlockedout[counternum] = 0; + } + interrupt_enable = new int[8]; + } + public static void coin_counter_w(int num, int on) + { + if (num >= 8) + { + return; + } + if (on != 0 && (lastcoin[num] == 0)) + { + coin_count[num]++; + } + lastcoin[num] = (uint)on; + } + public static void coin_lockout_w(int num, int on) + { + if (num >= 8) + { + return; + } + coinlockedout[num] = (uint)on; + } + public static void coin_lockout_global_w(int on) + { + int i; + for (i = 0; i < 8; i++) + { + coin_lockout_w(i, on); + } + } + public static void nvram_load() + { + switch (Machine.sBoard) + { + case "Neo Geo": + Neogeo.nvram_handler_load_neogeo(); + break; + /*case "Namco System 1": + Namcos1.nvram_handler_load_namcos1(); + break;*/ + } + } + public static void nvram_save() + { + switch (Machine.sBoard) + { + case "Neo Geo": + Neogeo.nvram_handler_save_neogeo(); + break; + /*case "Namco System 1": + Namcos1.nvram_handler_save_namcos1(); + break;*/ + } + } + public static void watchdog_reset16_w() + { + Watchdog.watchdog_reset(); + } + public static ushort watchdog_reset16_r() + { + Watchdog.watchdog_reset(); + return 0xffff; + } + public static void nmi_0_line_pulse() + { + irqn_line_set(0, (int)LineState.INPUT_LINE_NMI, (int)LineState.PULSE_LINE); + } + public static void nmi_1_line_pulse() + { + irqn_line_set(1, (int)LineState.INPUT_LINE_NMI, (int)LineState.PULSE_LINE); + } + public static void irq_0_0_line_hold() + { + Cpuint.cpunum_set_input_line(0, 0, LineState.HOLD_LINE); + } + public static void irq_0_1_line_hold() + { + Cpuint.cpunum_set_input_line(0, 1, LineState.HOLD_LINE); + } + public static void irq_0_6_line_hold() + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + public static void irq_1_0_line_hold() + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + public static void irq_2_0_line_hold() + { + Cpuint.cpunum_set_input_line(2, 0, LineState.HOLD_LINE); + } + public static void watchdog_reset_w() + { + Watchdog.watchdog_reset(); + } + public static void interrupt_reset() + { + int cpunum; + for (cpunum = 0; cpunum < Cpuexec.ncpu; cpunum++) + { + interrupt_enable[cpunum] = 1; + } + } + public static void clear_all_lines() + { + int inputcount = 0; + int line; + if (objcpunum == 0 && Cpuexec.cpu[0] == MC68000.m1) + { + inputcount = 8; + } + else + { + inputcount = 1; + } + Cpuint.cpunum_set_input_line(objcpunum, (int)LineState.INPUT_LINE_NMI, LineState.CLEAR_LINE); + for (line = 0; line < inputcount; line++) + { + Cpuint.cpunum_set_input_line(objcpunum, line, LineState.CLEAR_LINE); + } + } + public static void cpu_interrupt_enable(int cpunum, int enabled) + { + interrupt_enable[cpunum] = enabled; + if (enabled == 0) + { + objcpunum = cpunum; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Generic_clear_all_lines); + } + } + public static void interrupt_enable_w(byte data) + { + cpu_interrupt_enable(Cpuexec.activecpu, data); + } + public static void irqn_line_set(int cpunum, int line, int state) + { + if (interrupt_enable[cpunum] != 0) + { + Cpuint.cpunum_set_input_line(cpunum, line, (LineState)state); + } + } + public static void nmi_line_pulse0() + { + nmi_line_pulse(0); + } + public static void nmi_line_pulse(int cpunum) + { + irqn_line_set(cpunum, (int)LineState.INPUT_LINE_NMI, (int)LineState.PULSE_LINE); + } + public static void irq0_line_hold1() + { + irq0_line_hold(1); + } + public static void irq0_line_hold(int cpunum) + { + irqn_line_set(cpunum, 0, (int)LineState.HOLD_LINE); + } + public static void irq4_line_hold(int cpunum) + { + irqn_line_set(cpunum, 4, (int)LineState.HOLD_LINE); + } + public static void irq5_line_hold0() + { + irq5_line_hold(0); + } + public static void irq5_line_hold(int cpunum) + { + irqn_line_set(cpunum, 5, (int)LineState.HOLD_LINE); + } + public static ushort paletteram16_split(int offset) + { + return (ushort)(paletteram[offset] | (paletteram_2[offset] << 8)); + } + public static void buffer_spriteram_w() + { + AxiArray.Copy(spriteram, buffered_spriteram, spriteramLength); + } + public static void buffer_spriteram16_w() + { + AxiArray.Copy(spriteram16, buffered_spriteram16, spriteram16Length); + } + public static ushort paletteram16_le(int offset) + { + return (ushort)(paletteram[offset & ~1] | (paletteram[offset | 1] << 8)); + } + public static ushort paletteram16_be(int offset) + { + return (ushort)(paletteram[offset | 1] | (paletteram[offset & ~1] << 8)); + } + public static void set_color_444(int color, int rshift, int gshift, int bshift, ushort data) + { + Palette.palette_set_callback(color, Palette.make_rgb(Palette.pal4bit((byte)(data >> rshift)), Palette.pal4bit((byte)(data >> gshift)), Palette.pal4bit((byte)(data >> bshift)))); + } + public static void set_color_555(int color, int rshift, int gshift, int bshift, ushort data) + { + Palette.palette_set_callback(color, Palette.make_rgb(Palette.pal5bit((byte)(data >> rshift)), Palette.pal5bit((byte)(data >> gshift)), (int)Palette.pal5bit((byte)(data >> bshift)))); + } + public static void updateflip() + { + int width = Video.screenstate.width; + int height = Video.screenstate.height; + long period = Video.screenstate.frame_period; + RECT visarea = Video.screenstate.visarea; + Tmap.tilemap_set_flip(null, (byte)((Tilemap.TILEMAP_FLIPX & flip_screen_x) | (Tilemap.TILEMAP_FLIPY & flip_screen_y))); + if (flip_screen_x != 0) + { + int temp; + temp = width - visarea.min_x - 1; + visarea.min_x = width - visarea.max_x - 1; + visarea.max_x = temp; + } + if (flip_screen_y != 0) + { + int temp; + temp = height - visarea.min_y - 1; + visarea.min_y = height - visarea.max_y - 1; + visarea.max_y = temp; + } + Video.video_screen_configure(width, height, visarea, period); + } + public static void flip_screen_set(int on) + { + flip_screen_x_set(on); + flip_screen_y_set(on); + } + public static void flip_screen_x_set(int on) + { + if (on != 0) + { + on = ~0; + } + if (flip_screen_x != on) + { + flip_screen_x = on; + updateflip(); + } + } + public static void flip_screen_y_set(int on) + { + if (on != 0) + { + on = ~0; + } + if (flip_screen_y != on) + { + flip_screen_y = on; + updateflip(); + } + } + public static int flip_screen_get() + { + return flip_screen_x; + } + public static void paletteram_xxxxBBBBGGGGRRRR_le_w(int offset, byte data) + { + paletteram[offset] = data; + set_color_444(offset / 2, 0, 4, 8, paletteram16_le(offset)); + } + public static void paletteram16_xxxxRRRRGGGGBBBB_word_w(int offset, ushort data) + { + paletteram16[offset] = data; + set_color_444(offset, 8, 4, 0, paletteram16[offset]); + } + public static void paletteram16_xxxxRRRRGGGGBBBB_word_w1(int offset, byte data) + { + paletteram16[offset] = (ushort)((data << 8) | (paletteram16[offset] & 0xff)); + set_color_444(offset, 8, 4, 0, paletteram16[offset]); + } + public static void paletteram16_xxxxRRRRGGGGBBBB_word_w2(int offset, byte data) + { + paletteram16[offset] = (ushort)((paletteram16[offset] & 0xff00) | data); + set_color_444(offset, 8, 4, 0, paletteram16[offset]); + } + public static void paletteram_RRRRGGGGBBBBxxxx_be_w(int offset, byte data) + { + paletteram[offset] = data; + set_color_444(offset / 2, 12, 8, 4, paletteram16_be(offset)); + } + public static void paletteram_RRRRGGGGBBBBxxxx_split1_w(int offset, byte data) + { + paletteram[offset] = data; + set_color_444(offset, 12, 8, 4, paletteram16_split(offset)); + } + public static void paletteram_RRRRGGGGBBBBxxxx_split2_w(int offset, byte data) + { + paletteram_2[offset] = data; + set_color_444(offset, 12, 8, 4, paletteram16_split(offset)); + } + + public static void paletteram16_xBBBBBGGGGGRRRRR_word_w(int offset, ushort data) + { + paletteram16[offset] = data; + set_color_555(offset, 0, 5, 10, paletteram16[offset]); + } + public static void paletteram16_xBBBBBGGGGGRRRRR_word_w1(int offset, byte data) + { + paletteram16[offset] = (ushort)((data << 8) | (paletteram16[offset] & 0xff)); + set_color_555(offset, 0, 5, 10, paletteram16[offset]); + } + public static void paletteram16_xBBBBBGGGGGRRRRR_word_w2(int offset, byte data) + { + paletteram16[offset] = (ushort)((paletteram16[offset] & 0xff00) | data); + set_color_555(offset, 0, 5, 10, paletteram16[offset]); + } + public static void paletteram16_xRRRRRGGGGGBBBBB_word_w(int offset) + { + set_color_555(offset, 10, 5, 0, paletteram16[offset]); + } + public static void paletteram16_RRRRGGGGBBBBRGBx_word_w(int offset, ushort data) + { + paletteram16[offset] = data; + ushort data1 = paletteram16[offset]; + //TODO 通道修改,BGRA->RGBA + Palette.palette_set_callback(offset, (uint)((Palette.pal5bit((byte)(((data1 >> 11) & 0x1e) | ((data1 >> 3) & 0x01))) << 16) | (Palette.pal5bit((byte)(((data >> 7) & 0x1e) | ((data >> 2) & 0x01))) << 8) | Palette.pal5bit((byte)(((data >> 3) & 0x1e) | ((data >> 1) & 0x01))))); + } + public static void paletteram16_RRRRGGGGBBBBRGBx_word_w1(int offset, byte data) + { + paletteram16[offset] = (ushort)((data << 8) | (paletteram16[offset] & 0xff)); + ushort data1 = paletteram16[offset]; + //TODO 通道修改,BGRA->RGBA + Palette.palette_set_callback(offset, (uint)((Palette.pal5bit((byte)(((data1 >> 11) & 0x1e) | ((data1 >> 3) & 0x01))) << 16) | (Palette.pal5bit((byte)(((data >> 7) & 0x1e) | ((data >> 2) & 0x01))) << 8) | Palette.pal5bit((byte)(((data >> 3) & 0x1e) | ((data >> 1) & 0x01))))); + } + public static void paletteram16_RRRRGGGGBBBBRGBx_word_w2(int offset, byte data) + { + paletteram16[offset] = (ushort)((paletteram16[offset] & 0xff00) | data); + ushort data1 = paletteram16[offset]; + + //TODO 通道修改,BGRA->RGBA + Palette.palette_set_callback(offset, (uint)((Palette.pal5bit((byte)(((data1 >> 11) & 0x1e) | ((data1 >> 3) & 0x01))) << 16) | (Palette.pal5bit((byte)(((data >> 7) & 0x1e) | ((data >> 2) & 0x01))) << 8) | Palette.pal5bit((byte)(((data >> 3) & 0x1e) | ((data >> 1) & 0x01))))); + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Generic.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Generic.cs.meta new file mode 100644 index 00000000..007200f8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Generic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f9f3a2c45a1c6f4894485cfd85a0a21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Inptport.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Inptport.cs new file mode 100644 index 00000000..bc7f1fc5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Inptport.cs @@ -0,0 +1,926 @@ +using MAME.Core; + +namespace MAME.Core +{ + public class analog_field_state + { + //public byte shift; + public int adjdefvalue; + public int adjmin; + public int adjmax; + + public int sensitivity; + public bool reverse; + public int delta; + //public int centerdelta; + + public int accum; + public int previous; + //public int previousanalog; + + public int minimum; + public int maximum; + //public int center; + public int reverse_val; + + public long scalepos; + public long scaleneg; + public long keyscalepos; + public long keyscaleneg; + //public long positionalscale; + + public bool absolute; + public bool wraps; + //public byte autocenter; + public byte single_scale; + public bool interpolate; + public byte lastdigital; + } + public class input_port_private + { + public Atime last_frame_time; + public long last_delta_nsec; + } + public partial class Inptport + { + public static bool bReplayRead; + public delegate void loop_delegate(); + public static loop_delegate loop_inputports_callback, record_port_callback, replay_port_callback; + public static analog_field_state analog_p0, analog_p1, analog_p1x, analog_p1y; + public static input_port_private portdata; + public static void input_port_init() + { + portdata = new input_port_private(); + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + loop_inputports_callback = CPS.loop_inputports_cps1_6b; + record_port_callback = CPS.record_portC; + replay_port_callback = CPS.replay_portC; + analog_p0 = new analog_field_state(); + analog_p1 = new analog_field_state(); + analog_p0.adjdefvalue = 0; + analog_p1.adjdefvalue = 0; + analog_p0.sensitivity = 100; + analog_p1.sensitivity = 100; + analog_p0.reverse = false; + analog_p1.reverse = false; + analog_p0.delta = 20; + analog_p1.delta = 20; + analog_p0.minimum = 0; + analog_p1.minimum = 0; + analog_p0.maximum = 0x1ffe00; + analog_p1.maximum = 0x1ffe00; + analog_p0.reverse_val = 0x200000; + analog_p1.reverse_val = 0x200000; + analog_p0.scalepos = 0x8000; + analog_p1.scalepos = 0x8000; + analog_p0.scaleneg = 0x8000; + analog_p1.scaleneg = 0x8000; + analog_p0.absolute = false; + analog_p0.wraps = true; + analog_p0.interpolate = true; + analog_p1.absolute = false; + analog_p1.wraps = true; + analog_p1.interpolate = true; + break; + case "CPS2": + loop_inputports_callback = CPS.loop_inputports_cps2_2p6b; + record_port_callback = CPS.record_portC2; + replay_port_callback = CPS.replay_portC2; + analog_p0 = new analog_field_state(); + analog_p1 = new analog_field_state(); + analog_p0.adjdefvalue = 0; + analog_p1.adjdefvalue = 0; + analog_p0.sensitivity = 100; + analog_p1.sensitivity = 100; + analog_p0.reverse = false; + analog_p1.reverse = false; + analog_p0.delta = 20; + analog_p1.delta = 20; + analog_p0.minimum = 0; + analog_p1.minimum = 0; + analog_p0.maximum = 0x1ffe00; + analog_p1.maximum = 0x1ffe00; + analog_p0.reverse_val = 0x200000; + analog_p1.reverse_val = 0x200000; + analog_p0.scalepos = 0x8000; + analog_p1.scalepos = 0x8000; + analog_p0.scaleneg = 0x8000; + analog_p1.scaleneg = 0x8000; + analog_p0.absolute = false; + analog_p0.wraps = true; + analog_p0.interpolate = true; + analog_p1.absolute = false; + analog_p1.wraps = true; + analog_p1.interpolate = true; + break; + case "Data East": + loop_inputports_callback = Dataeast.loop_inputports_dataeast_pcktgal; + record_port_callback = Dataeast.record_port_pcktgal; + replay_port_callback = Dataeast.replay_port_pcktgal; + break; + case "Tehkan": + break; + case "Neo Geo": + loop_inputports_callback = Neogeo.loop_inputports_neogeo_standard; + record_port_callback = Neogeo.record_port; + replay_port_callback = Neogeo.replay_port; + analog_p0 = new analog_field_state(); + analog_p1 = new analog_field_state(); + analog_p0.adjdefvalue = 0; + analog_p1.adjdefvalue = 0; + analog_p0.sensitivity = 10; + analog_p1.sensitivity = 10; + analog_p0.reverse = true; + analog_p1.reverse = true; + analog_p0.delta = 20; + analog_p1.delta = 20; + analog_p0.minimum = 0; + analog_p1.minimum = 0; + analog_p0.maximum = 0x1fe00; + analog_p1.maximum = 0x1fe00; + analog_p0.reverse_val = 0x20000; + analog_p1.reverse_val = 0x20000; + analog_p0.scalepos = 0x8000; + analog_p1.scalepos = 0x8000; + analog_p0.scaleneg = 0x8000; + analog_p1.scaleneg = 0x8000; + analog_p0.absolute = false; + analog_p0.wraps = true; + analog_p0.interpolate = true; + analog_p1.absolute = false; + analog_p1.wraps = true; + analog_p1.interpolate = true; + break; + case "SunA8": + loop_inputports_callback = SunA8.loop_inputports_suna8_starfigh; + record_port_callback = SunA8.record_port_starfigh; + replay_port_callback = SunA8.replay_port_starfigh; + break; + case "Namco System 1": + loop_inputports_callback = Namcos1.loop_inputports_ns1_3b; + record_port_callback = Namcos1.record_port; + replay_port_callback = Namcos1.replay_port; + analog_p0 = new analog_field_state(); + analog_p1 = new analog_field_state(); + analog_p0.adjdefvalue = 0; + analog_p1.adjdefvalue = 0; + analog_p0.sensitivity = 30; + analog_p1.sensitivity = 30; + analog_p0.reverse = false; + analog_p1.reverse = false; + analog_p0.delta = 15; + analog_p1.delta = 15; + analog_p0.minimum = 0; + analog_p1.minimum = 0; + analog_p0.maximum = 0x1fe00; + analog_p1.maximum = 0x1fe00; + analog_p0.reverse_val = 0x20000; + analog_p1.reverse_val = 0x20000; + analog_p0.scalepos = 0x8000; + analog_p1.scalepos = 0x8000; + analog_p0.scaleneg = 0x8000; + analog_p1.scaleneg = 0x8000; + analog_p0.absolute = false; + analog_p0.wraps = true; + analog_p0.interpolate = true; + analog_p1.absolute = false; + analog_p1.wraps = true; + analog_p1.interpolate = true; + break; + case "IGS011": + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + loop_inputports_callback = IGS011.loop_inputports_igs011_drgnwrld; + record_port_callback = IGS011.record_port_drgnwrld; + replay_port_callback = IGS011.replay_port_drgnwrld; + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + loop_inputports_callback = IGS011.loop_inputports_igs011_lhb; + record_port_callback = IGS011.record_port_lhb; + replay_port_callback = IGS011.replay_port_lhb; + break; + case "lhb2": + loop_inputports_callback = IGS011.loop_inputports_igs011_lhb2; + record_port_callback = IGS011.record_port_lhb; + replay_port_callback = IGS011.replay_port_lhb; + break; + } + break; + case "PGM": + loop_inputports_callback = PGM.loop_inputports_pgm_standard; + record_port_callback = PGM.record_port; + replay_port_callback = PGM.replay_port; + break; + case "M72": + loop_inputports_callback = M72.loop_inputports_m72_common; + record_port_callback = M72.record_port; + replay_port_callback = M72.replay_port; + break; + case "M92": + loop_inputports_callback = M92.loop_inputports_m92_common; + record_port_callback = M92.record_port; + replay_port_callback = M92.replay_port; + break; + case "Taito": + record_port_callback = Taito.record_port_bublbobl; + replay_port_callback = Taito.replay_port_bublbobl; + analog_p1x = new analog_field_state(); + analog_p1x.adjdefvalue = 0x80; + analog_p1x.adjmin = 0; + analog_p1x.adjmax = 0xff; + analog_p1x.sensitivity = 25; + analog_p1x.reverse = false; + analog_p1x.delta = 15; + analog_p1x.minimum = -0x10000; + analog_p1x.maximum = 0x10000; + analog_p1x.absolute = true; + analog_p1x.wraps = false; + analog_p1x.interpolate = false; + analog_p1x.single_scale = 0; + analog_p1x.scalepos = 0x7f00; + analog_p1x.scaleneg = 0x8000; + analog_p1x.reverse_val = 0x200000; + analog_p1x.keyscalepos = 0x0000000204081020; + analog_p1x.keyscaleneg = 0x0000000200000000; + analog_p1y = new analog_field_state(); + analog_p1y.adjdefvalue = 0x80; + analog_p1y.adjmin = 0; + analog_p1y.adjmax = 0xff; + analog_p1y.sensitivity = 25; + analog_p1y.reverse = false; + analog_p1y.delta = 15; + analog_p1y.minimum = -0x10000; + analog_p1y.maximum = 0x10000; + analog_p1y.absolute = true; + analog_p1y.wraps = false; + analog_p1y.interpolate = false; + analog_p1y.single_scale = 0; + analog_p1y.scalepos = 0x7f00; + analog_p1y.scaleneg = 0x8000; + analog_p1y.reverse_val = 0x200000; + analog_p1y.keyscalepos = 0x0000000204081020; + analog_p1y.keyscaleneg = 0x0000000200000000; + break; + case "Taito B": + //loop_inputports_callback = Taitob.loop_inputports_taitob_pbobble; + record_port_callback = Taitob.record_port; + replay_port_callback = Taitob.replay_port; + break; + case "Konami 68000": + //loop_inputports_callback = Konami68000.loop_inputports_konami68000_ssriders; + record_port_callback = Konami68000.record_port; + replay_port_callback = Konami68000.replay_port; + break; + case "Capcom": + break; + } + switch (Machine.sName) + { + case "forgottn": + case "forgottna": + case "forgottnu": + case "forgottnue": + case "forgottnuc": + case "forgottnua": + case "forgottnuaa": + case "lostwrld": + case "lostwrldo": + loop_inputports_callback = CPS.loop_inputports_cps1_forgottn; + break; + case "sf2ebbl": + case "sf2ebbl2": + case "sf2ebbl3": + case "sf2amf2": + case "sf2m2": + case "sf2m4": + case "sf2m5": + case "sf2m6": + case "sf2m7": + case "sf2yyc": + case "sf2koryu": + loop_inputports_callback = CPS.loop_inputports_cps1_sf2hack; + break; + case "cworld2j": + case "cworld2ja": + case "cworld2jb": + case "qad": + case "qadjr": + case "qtono2j": + loop_inputports_callback = CPS.loop_inputports_cps1_cworld2j; + break; + case "pzloop2": + case "pzloop2j": + case "pzloop2jr1": + loop_inputports_callback = CPS.loop_inputports_cps2_pzloop2; + break; + case "ecofghtr": + loop_inputports_callback = CPS.loop_inputports_cps2_ecofghtr; + break; + case "qndream": + loop_inputports_callback = CPS.loop_inputports_cps2_qndream; + break; + case "pbaction": + case "pbaction2": + case "pbaction3": + case "pbaction4": + case "pbaction5": + loop_inputports_callback = Tehkan.loop_inputports_tehkan_pbaction; + record_port_callback = Tehkan.record_port_pbaction; + replay_port_callback = Tehkan.replay_port_pbaction; + break; + case "irrmaze": + loop_inputports_callback = Neogeo.loop_inputports_neogeo_irrmaze; + break; + case "quester": + case "questers": + loop_inputports_callback = Namcos1.loop_inputports_ns1_quester; + break; + case "berabohm": + loop_inputports_callback = Namcos1.loop_inputports_ns1_berabohm; + break; + case "faceoff": + loop_inputports_callback = Namcos1.loop_inputports_ns1_faceoff; + break; + case "tankfrce4": + loop_inputports_callback = Namcos1.loop_inputports_ns1_tankfrce4; + break; + /*case "": + case "": + loop_inputports_callback = IGS011.loop_inputports_igs011_drgnwrldj; + break;*/ + + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + loop_inputports_callback = Taito.loop_inputports_taito_tokio; + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "bub68705": + case "bublcave": + case "bublcave11": + case "bublcave10": + loop_inputports_callback = Taito.loop_inputports_taito_bublbobl; + break; + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "dland": + case "bbredux": + case "bublboblb": + case "boblcave": + loop_inputports_callback = Taito.loop_inputports_taito_boblbobl; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + loop_inputports_callback = Taito.loop_inputports_taito_opwolf; + record_port_callback = Taito.record_port_opwolf; + replay_port_callback = Taito.replay_port_opwolf; + break; + case "opwolfp": + loop_inputports_callback = Taito.loop_inputports_taito_opwolfp; + record_port_callback = Taito.record_port_opwolfp; + replay_port_callback = Taito.replay_port_opwolfp; + break; + case "pbobble": + loop_inputports_callback = Taitob.loop_inputports_taitob_pbobble; + record_port_callback = Taitob.record_port_pbobble; + replay_port_callback = Taitob.replay_port_pbobble; + break; + case "silentd": + case "silentdj": + case "silentdu": + loop_inputports_callback = Taitob.loop_inputports_taitob_silentd; + break; + case "cuebrick": + case "mia": + case "mia2": + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_cuebrick; + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "punkshot": + case "punkshot2": + case "punkshotj": + case "tmnt2": + case "ssriders": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_tmnt; + break; + case "blswhstl": + case "blswhstla": + case "detatwin": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_blswhstl; + break; + case "glfgreat": + case "glfgreatj": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_glfgreat; + break; + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_ssriders; + break; + case "qgakumon": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_qgakumon; + break; + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_thndrx2; + break; + case "prmrsocr": + case "prmrsocrj": + loop_inputports_callback = Konami68000.loop_inputports_konami68000_prmrsocr; + record_port_callback = Konami68000.record_port_prmrsocr; + replay_port_callback = Konami68000.replay_port_prmrsocr; + break; + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + loop_inputports_callback = Capcom.loop_inputports_gng; + record_port_callback = Capcom.record_port_gng; + replay_port_callback = Capcom.replay_port_gng; + break; + case "diamond": + loop_inputports_callback = Capcom.loop_inputports_diamond; + record_port_callback = Capcom.record_port_gng; + replay_port_callback = Capcom.replay_port_gng; + break; + case "sf": + loop_inputports_callback = Capcom.loop_inputports_sfus; + record_port_callback = Capcom.record_port_sf; + replay_port_callback = Capcom.replay_port_sf; + break; + case "sfua": + case "sfj": + loop_inputports_callback = Capcom.loop_inputports_sfjp; + record_port_callback = Capcom.record_port_sf; + replay_port_callback = Capcom.replay_port_sf; + break; + case "sfjan": + case "sfan": + case "sfp": + loop_inputports_callback = Capcom.loop_inputports_sfan; + record_port_callback = Capcom.record_port_sf; + replay_port_callback = Capcom.replay_port_sf; + break; + } + } + public static int apply_analog_min_max(analog_field_state analog, int value) + { + int adjmin = (analog.minimum * 100) / analog.sensitivity; + int adjmax = (analog.maximum * 100) / analog.sensitivity; + if (!analog.wraps) + { + if (value > adjmax) + value = adjmax; + else if (value < adjmin) + value = adjmin; + } + else + { + int adj1 = (512 * 100) / analog.sensitivity; + int adjdif = adjmax - adjmin + adj1; + if (analog.reverse) + { + while (value <= adjmin - adj1) + value += adjdif; + while (value > adjmax) + value -= adjdif; + } + else + { + while (value >= adjmax + adj1) + value -= adjdif; + while (value < adjmin) + value += adjdif; + } + } + return value; + } + public static uint input_port_read_direct(analog_field_state analog) + { + uint result; + int value; + long nsec_since_last; + value = analog.accum; + if (analog.interpolate && portdata.last_delta_nsec != 0) + { + nsec_since_last = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(EmuTimer.get_current_time(), portdata.last_frame_time)) / Attotime.ATTOSECONDS_PER_NANOSECOND; + value = (int)(analog.previous + ((long)(analog.accum - analog.previous) * nsec_since_last / portdata.last_delta_nsec)); + } + result = (uint)apply_analog_settings(value, analog); + return result; + } + public static int apply_analog_settings(int value, analog_field_state analog) + { + value = apply_analog_min_max(analog, value); + value = (int)((long)value * analog.sensitivity / 100); + if (analog.reverse) + { + value = analog.reverse_val - value; + } + if (value >= 0) + { + value = (int)((long)(value * analog.scalepos) >> 24); + } + else + { + value = (int)((long)(value * analog.scaleneg) >> 24); + } + value += analog.adjdefvalue; + return value; + } + public static void frame_update_callback() + { + if (Mame.mame_is_paused()) + { + return; + } + frame_update(); + Video.screenstate.frame_number++; + } + private static void frame_update() + { + Atime curtime = EmuTimer.get_current_time(); + portdata.last_delta_nsec = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(curtime, portdata.last_frame_time)) / Attotime.ATTOSECONDS_PER_NANOSECOND; + portdata.last_frame_time = curtime; + if (Mame.playState != Mame.PlayState.PLAY_REPLAYRUNNING) + { + if (Mame.is_foreground) + { + loop_inputports_callback(); + } + /*int i1 = (int)(Video.screenstate.frame_number % 4); + if (i1 == 0) + { + CPS.short1 = unchecked((short)0xfffb); + } + else if (i1 == 1) + { + CPS.short1 = unchecked((short)0xffce); + } + else if (i1 == 2) + { + CPS.short1 = unchecked((short)0xfff7); + } + else if (i1 == 3) + { + CPS.short1 = unchecked((short)0xffcd); + }*/ + } + if (Mame.playState == Mame.PlayState.PLAY_RECORDRUNNING) + { + record_port_callback(); + } + else if (Mame.playState == Mame.PlayState.PLAY_REPLAYRUNNING) + { + replay_port_callback(); + } + } + public static void frame_update_analog_field_forgottn_p0(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + if (Mouse.deltaY < 0) + { + keypressed = true; + delta += Mouse.deltaY * 0x200; + analog.lastdigital = 1; + } + if (Mouse.deltaY > 0) + { + keypressed = true; + delta += Mouse.deltaY * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_forgottn_p1(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_ecofghtr_p0(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + keypressed = true; + delta -= analog_p0.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + keypressed = true; + delta += analog_p0.delta * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_ecofghtr_p1(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_irrmaze_p0(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_irrmaze_p1(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_quester_p0(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_quester_p1(analog_field_state analog) + { + bool keypressed = false; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + analog.lastdigital = 0; + } + public static void frame_update_analog_field_opwolf_p1x(analog_field_state analog) + { + bool keypressed = false; + long keyscale; + int rawvalue; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + rawvalue = Mouse.deltaX; + if (rawvalue != 0) + { + delta = rawvalue; + analog.lastdigital = 0; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + if (Mouse.deltaX < 0) + { + keypressed = true; + delta += Mouse.deltaX * 0x200; + analog.lastdigital = 1; + } + if (Mouse.deltaX > 0) + { + keypressed = true; + delta += Mouse.deltaX * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + { + analog.lastdigital = 0; + } + } + public static void frame_update_analog_field_opwolf_p1y(analog_field_state analog) + { + bool keypressed = false; + long keyscale; + int rawvalue; + int delta = 0; + int value2; + value2 = apply_analog_min_max(analog, analog.accum); + analog.previous = analog.accum = value2; + rawvalue = Mouse.deltaY; + if (rawvalue != 0) + { + delta = rawvalue; + analog.lastdigital = 0; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + keypressed = true; + delta -= analog.delta * 0x200; + analog.lastdigital = 1; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + keypressed = true; + delta += analog.delta * 0x200; + analog.lastdigital = 2; + } + if (Mouse.deltaY < 0) + { + keypressed = true; + delta += Mouse.deltaY * 0x200; + analog.lastdigital = 1; + } + if (Mouse.deltaY > 0) + { + keypressed = true; + delta += Mouse.deltaY * 0x200; + analog.lastdigital = 2; + } + analog.accum += delta; + if (!keypressed) + { + analog.lastdigital = 0; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Inptport.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Inptport.cs.meta new file mode 100644 index 00000000..0e1339fc --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Inptport.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a61a8c2df12b28a44bc58244af0c7d57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/KeyStruct.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/KeyStruct.cs new file mode 100644 index 00000000..732fae4b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/KeyStruct.cs @@ -0,0 +1,111 @@ +using MAME.Core; +using System.Collections.Generic; + +namespace MAME.Core +{ + public partial class Inptport + { + private static List lks; + public static List lk; + public class KeyStruct + { + public Corekey key; + public char c; + public KeyStruct(Corekey _key, char _c) + { + key = _key; + c = _c; + } + } + public static char getcharbykey(Corekey key1) + { + char c1 = ' '; + foreach (KeyStruct ks in lks) + { + if (ks.key == key1) + { + c1 = ks.c; + break; + } + } + return c1; + } + public static void input_init() + { + lk = new List(); + lk.Add(Corekey.D1); + lk.Add(Corekey.D2); + lk.Add(Corekey.D3); + lk.Add(Corekey.D4); + lk.Add(Corekey.D5); + lk.Add(Corekey.D6); + lk.Add(Corekey.D7); + lk.Add(Corekey.D8); + lk.Add(Corekey.D9); + lk.Add(Corekey.D0); + lk.Add(Corekey.A); + lk.Add(Corekey.B); + lk.Add(Corekey.C); + lk.Add(Corekey.D); + lk.Add(Corekey.E); + lk.Add(Corekey.F); + lk.Add(Corekey.G); + lk.Add(Corekey.H); + lk.Add(Corekey.I); + lk.Add(Corekey.J); + lk.Add(Corekey.K); + lk.Add(Corekey.L); + lk.Add(Corekey.M); + lk.Add(Corekey.N); + lk.Add(Corekey.O); + lk.Add(Corekey.P); + lk.Add(Corekey.Q); + lk.Add(Corekey.R); + lk.Add(Corekey.S); + lk.Add(Corekey.T); + lk.Add(Corekey.U); + lk.Add(Corekey.V); + lk.Add(Corekey.W); + lk.Add(Corekey.X); + lk.Add(Corekey.Y); + lk.Add(Corekey.Z); + lks = new List(); + lks.Add(new KeyStruct(Corekey.D1, '1')); + lks.Add(new KeyStruct(Corekey.D2, '2')); + lks.Add(new KeyStruct(Corekey.D3, '3')); + lks.Add(new KeyStruct(Corekey.D4, '4')); + lks.Add(new KeyStruct(Corekey.D5, '5')); + lks.Add(new KeyStruct(Corekey.D6, '6')); + lks.Add(new KeyStruct(Corekey.D7, '7')); + lks.Add(new KeyStruct(Corekey.D8, '8')); + lks.Add(new KeyStruct(Corekey.D9, '9')); + lks.Add(new KeyStruct(Corekey.D0, '0')); + lks.Add(new KeyStruct(Corekey.A, 'a')); + lks.Add(new KeyStruct(Corekey.B, 'b')); + lks.Add(new KeyStruct(Corekey.C, 'c')); + lks.Add(new KeyStruct(Corekey.D, 'd')); + lks.Add(new KeyStruct(Corekey.E, 'e')); + lks.Add(new KeyStruct(Corekey.F, 'f')); + lks.Add(new KeyStruct(Corekey.G, 'g')); + lks.Add(new KeyStruct(Corekey.H, 'h')); + lks.Add(new KeyStruct(Corekey.I, 'i')); + lks.Add(new KeyStruct(Corekey.J, 'j')); + lks.Add(new KeyStruct(Corekey.K, 'k')); + lks.Add(new KeyStruct(Corekey.L, 'l')); + lks.Add(new KeyStruct(Corekey.M, 'm')); + lks.Add(new KeyStruct(Corekey.N, 'n')); + lks.Add(new KeyStruct(Corekey.O, 'o')); + lks.Add(new KeyStruct(Corekey.P, 'p')); + lks.Add(new KeyStruct(Corekey.Q, 'q')); + lks.Add(new KeyStruct(Corekey.R, 'r')); + lks.Add(new KeyStruct(Corekey.S, 's')); + lks.Add(new KeyStruct(Corekey.T, 't')); + lks.Add(new KeyStruct(Corekey.U, 'u')); + lks.Add(new KeyStruct(Corekey.V, 'v')); + lks.Add(new KeyStruct(Corekey.W, 'w')); + lks.Add(new KeyStruct(Corekey.X, 'x')); + lks.Add(new KeyStruct(Corekey.Y, 'y')); + lks.Add(new KeyStruct(Corekey.Z, 'z')); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/KeyStruct.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/KeyStruct.cs.meta new file mode 100644 index 00000000..08f51fa4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/KeyStruct.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b86a254d2e7ab1d4587aa83a6de7abf6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Keyboard.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Keyboard.cs new file mode 100644 index 00000000..7db9b908 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Keyboard.cs @@ -0,0 +1,277 @@ +using MAME.Core; +using System; +using System.Collections.Generic; + +namespace MAME.Core +{ + public class Keyboard + { + public static bool bF10; + + static IKeyboard mKeyboard; + + //const int CheckMaxEnumIdx = 33; + + class KeyState + { + public bool IsPressed; + public bool IsTriggered; + public bool WasPressed; + }; + private static Dictionary m_KeyStates = new Dictionary(); + + static ulong[] mKeysValue; + public static void InitializeInput(IKeyboard ikb) + { + mKeyboard = ikb; + List temp = new List(); + + #region 初始化m_KeyStates + m_KeyStates[MotionKey.None] = new KeyState(); + m_KeyStates[MotionKey.P1_INSERT_COIN] = new KeyState(); + m_KeyStates[MotionKey.P1_GAMESTART] = new KeyState(); + m_KeyStates[MotionKey.P1_UP] = new KeyState(); + m_KeyStates[MotionKey.P1_DOWN] = new KeyState(); + m_KeyStates[MotionKey.P1_LEFT] = new KeyState(); + m_KeyStates[MotionKey.P1_RIGHT] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_1] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_2] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_3] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_4] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_5] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_6] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_E] = new KeyState(); + m_KeyStates[MotionKey.P1_BTN_F] = new KeyState(); + m_KeyStates[MotionKey.P2_INSERT_COIN] = new KeyState(); + m_KeyStates[MotionKey.P2_GAMESTART] = new KeyState(); + m_KeyStates[MotionKey.P2_UP] = new KeyState(); + m_KeyStates[MotionKey.P2_DOWN] = new KeyState(); + m_KeyStates[MotionKey.P2_LEFT] = new KeyState(); + m_KeyStates[MotionKey.P2_RIGHT] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_1] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_2] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_3] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_4] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_5] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_6] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_E] = new KeyState(); + m_KeyStates[MotionKey.P2_BTN_F] = new KeyState(); + m_KeyStates[MotionKey.P3_INSERT_COIN] = new KeyState(); + m_KeyStates[MotionKey.P3_GAMESTART] = new KeyState(); + m_KeyStates[MotionKey.P3_UP] = new KeyState(); + m_KeyStates[MotionKey.P3_DOWN] = new KeyState(); + m_KeyStates[MotionKey.P3_LEFT] = new KeyState(); + m_KeyStates[MotionKey.P3_RIGHT] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_1] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_2] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_3] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_4] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_5] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_6] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_E] = new KeyState(); + m_KeyStates[MotionKey.P3_BTN_F] = new KeyState(); + m_KeyStates[MotionKey.P4_INSERT_COIN] = new KeyState(); + m_KeyStates[MotionKey.P4_GAMESTART] = new KeyState(); + m_KeyStates[MotionKey.P4_UP] = new KeyState(); + m_KeyStates[MotionKey.P4_DOWN] = new KeyState(); + m_KeyStates[MotionKey.P4_LEFT] = new KeyState(); + m_KeyStates[MotionKey.P4_RIGHT] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_1] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_2] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_3] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_4] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_5] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_6] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_E] = new KeyState(); + m_KeyStates[MotionKey.P4_BTN_F] = new KeyState(); + m_KeyStates[MotionKey.EMU_PAUSED] = new KeyState(); + m_KeyStates[MotionKey.Escape] = new KeyState(); + m_KeyStates[MotionKey.LeftShift] = new KeyState(); + m_KeyStates[MotionKey.RightShift] = new KeyState(); + m_KeyStates[MotionKey.FinalKey] = new KeyState(); + m_KeyStates[MotionKey.F10] = new KeyState(); + m_KeyStates[MotionKey.F9] = new KeyState(); + m_KeyStates[MotionKey.F8] = new KeyState(); + m_KeyStates[MotionKey.F7] = new KeyState(); + m_KeyStates[MotionKey.F6] = new KeyState(); + m_KeyStates[MotionKey.F5] = new KeyState(); + m_KeyStates[MotionKey.F4] = new KeyState(); + m_KeyStates[MotionKey.F3] = new KeyState(); + m_KeyStates[MotionKey.F2] = new KeyState(); + m_KeyStates[MotionKey.F1] = new KeyState(); + m_KeyStates[MotionKey.UNKNOW_Q] = new KeyState(); + m_KeyStates[MotionKey.UNKNOW_N] = new KeyState(); + m_KeyStates[MotionKey.UNKNOW_R] = new KeyState(); + m_KeyStates[MotionKey.UNKNOW_T] = new KeyState(); + m_KeyStates[MotionKey.UNKNOW_M] = new KeyState(); + m_KeyStates[MotionKey.UNKNOW_V] = new KeyState(); + m_KeyStates[MotionKey.UNKNOW_B] = new KeyState(); + + + + temp.Add(MotionKey.None); + temp.Add(MotionKey.P1_INSERT_COIN); + temp.Add(MotionKey.P1_GAMESTART); + temp.Add(MotionKey.P1_UP); + temp.Add(MotionKey.P1_DOWN); + temp.Add(MotionKey.P1_LEFT); + temp.Add(MotionKey.P1_RIGHT); + temp.Add(MotionKey.P1_BTN_1); + temp.Add(MotionKey.P1_BTN_2); + temp.Add(MotionKey.P1_BTN_3); + temp.Add(MotionKey.P1_BTN_4); + temp.Add(MotionKey.P1_BTN_5); + temp.Add(MotionKey.P1_BTN_6); + temp.Add(MotionKey.P1_BTN_E); + temp.Add(MotionKey.P1_BTN_F); + temp.Add(MotionKey.P2_INSERT_COIN); + temp.Add(MotionKey.P2_GAMESTART); + temp.Add(MotionKey.P2_UP); + temp.Add(MotionKey.P2_DOWN); + temp.Add(MotionKey.P2_LEFT); + temp.Add(MotionKey.P2_RIGHT); + temp.Add(MotionKey.P2_BTN_1); + temp.Add(MotionKey.P2_BTN_2); + temp.Add(MotionKey.P2_BTN_3); + temp.Add(MotionKey.P2_BTN_4); + temp.Add(MotionKey.P2_BTN_5); + temp.Add(MotionKey.P2_BTN_6); + temp.Add(MotionKey.P2_BTN_E); + temp.Add(MotionKey.P2_BTN_F); + temp.Add(MotionKey.P3_INSERT_COIN); + temp.Add(MotionKey.P3_GAMESTART); + temp.Add(MotionKey.P3_UP); + temp.Add(MotionKey.P3_DOWN); + temp.Add(MotionKey.P3_LEFT); + temp.Add(MotionKey.P3_RIGHT); + temp.Add(MotionKey.P3_BTN_1); + temp.Add(MotionKey.P3_BTN_2); + temp.Add(MotionKey.P3_BTN_3); + temp.Add(MotionKey.P3_BTN_4); + temp.Add(MotionKey.P3_BTN_5); + temp.Add(MotionKey.P3_BTN_6); + temp.Add(MotionKey.P3_BTN_E); + temp.Add(MotionKey.P3_BTN_F); + temp.Add(MotionKey.P4_INSERT_COIN); + temp.Add(MotionKey.P4_GAMESTART); + temp.Add(MotionKey.P4_UP); + temp.Add(MotionKey.P4_DOWN); + temp.Add(MotionKey.P4_LEFT); + temp.Add(MotionKey.P4_RIGHT); + temp.Add(MotionKey.P4_BTN_1); + temp.Add(MotionKey.P4_BTN_2); + temp.Add(MotionKey.P4_BTN_3); + temp.Add(MotionKey.P4_BTN_4); + temp.Add(MotionKey.P4_BTN_5); + temp.Add(MotionKey.P4_BTN_6); + temp.Add(MotionKey.P4_BTN_E); + temp.Add(MotionKey.P4_BTN_F); + temp.Add(MotionKey.EMU_PAUSED); + temp.Add(MotionKey.Escape); + temp.Add(MotionKey.LeftShift); + temp.Add(MotionKey.RightShift); + temp.Add(MotionKey.FinalKey); + temp.Add(MotionKey.F10); + temp.Add(MotionKey.F9); + temp.Add(MotionKey.F8); + temp.Add(MotionKey.F7); + temp.Add(MotionKey.F6); + temp.Add(MotionKey.F5); + temp.Add(MotionKey.F4); + temp.Add(MotionKey.F3); + temp.Add(MotionKey.F2); + temp.Add(MotionKey.F1); + temp.Add(MotionKey.UNKNOW_Q); + temp.Add(MotionKey.UNKNOW_N); + temp.Add(MotionKey.UNKNOW_R); + temp.Add(MotionKey.UNKNOW_T); + temp.Add(MotionKey.UNKNOW_M); + temp.Add(MotionKey.UNKNOW_V); + temp.Add(MotionKey.UNKNOW_B); + + mKeysValue = temp.ToArray(); + #endregion + } + + public static bool IsPressed(ulong key) + { + return m_KeyStates[key].IsPressed; + } + public static bool IsTriggered(ulong key) + { + return m_KeyStates[key].IsTriggered; + } + + public static void Update() + { + ulong currKeys = mKeyboard.GetPressedKeys(); + for (byte i = 0; i < mKeysValue.Length; i++) + { + //m_KeyStates[mKeyName[i]].IsPressed = false; + m_KeyStates[mKeysValue[i]].IsPressed = (currKeys & (ulong)mKeysValue[i]) > 0; + } + + //等待放行帧 + Machine.mainMotion.WaitNextFrame(); + + //foreach (MotionKey key in mKeyboard.GetPressedKeys()) + //{ + // m_KeyStates[key].IsPressed = true; + //} + + + + for (int i = 0; i < mKeysValue.Length; i++) + { + ulong key = mKeysValue[i]; + if (m_KeyStates[key].IsPressed) + { + if (m_KeyStates[key].WasPressed) + { + m_KeyStates[key].IsTriggered = false; + } + else + { + m_KeyStates[key].WasPressed = true; + m_KeyStates[key].IsTriggered = true; + } + } + else + { + m_KeyStates[key].WasPressed = false; + m_KeyStates[key].IsTriggered = false; + } + } + //byte finalIndex = CheckMaxEnumIdx; + //for (byte i = 0; i < finalIndex; i++) + //{ + // m_KeyStates[i].IsPressed = false; + //} + //foreach (MotionKey key in mKeyboard.GetPressedKeys()) + //{ + // m_KeyStates[(int)key].IsPressed = true; + //} + //for (int i = 0; i < finalIndex; i++) + //{ + // if (m_KeyStates[i].IsPressed) + // { + // if (m_KeyStates[i].WasPressed) + // { + // m_KeyStates[i].IsTriggered = false; + // } + // else + // { + // m_KeyStates[i].WasPressed = true; + // m_KeyStates[i].IsTriggered = true; + // } + // } + // else + // { + // m_KeyStates[i].WasPressed = false; + // m_KeyStates[i].IsTriggered = false; + // } + //} + + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Keyboard.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Keyboard.cs.meta new file mode 100644 index 00000000..49351d0a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Keyboard.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0e78f959ceb2bde40a8ea99e3f85609a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Machine.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Machine.cs new file mode 100644 index 00000000..04fe593a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Machine.cs @@ -0,0 +1,302 @@ +using System.Collections.Generic; +using System.IO; + +namespace MAME.Core +{ + public class Machine + { + public static string sName, sParent, sBoard, sDirection, sDescription, sManufacturer; + public static List lsParents; + public static MameMainMotion mainMotion; + public static RomInfo rom; + public static bool bRom; + public delegate void machine_delegate(); + public static machine_delegate machine_reset_callback; + public static void driver_init() + { + switch (Machine.sBoard) + { + case "Taito": + switch (Machine.sName) + { + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + Taito.driver_init_opwolf(); + break; + case "opwolfb": + Taito.driver_init_opwolfb(); + break; + case "opwolfp": + Taito.driver_init_opwolfp(); + break; + } + break; + } + } + public static void machine_start() + { + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + Eeprom.eeprom_init(); + CPS.video_start_cps(); + machine_reset_callback = CPS.machine_reset_cps; + break; + case "Data East": + machine_reset_callback = Dataeast.machine_reset_dataeast; + break; + case "Tehkan": + Tehkan.video_start_pbaction(); + machine_reset_callback = Tehkan.machine_reset_tehkan; + break; + case "Neo Geo": + Neogeo.nvram_handler_load_neogeo(); + Neogeo.machine_start_neogeo(); + Neogeo.video_start_neogeo(); + machine_reset_callback = Neogeo.machine_reset_neogeo; + break; + case "SunA8": + switch (Machine.sName) + { + case "starfigh": + SunA8.video_start_suna8_starfigh(); + break; + } + machine_reset_callback = SunA8.machine_reset_suna8; + break; + case "Namco System 1": + Namcos1.driver_init(); + Namcos1.video_start_namcos1(); + machine_reset_callback = Namcos1.machine_reset_namcos1; + break; + case "IGS011": + IGS011.video_start_igs011(); + machine_reset_callback = IGS011.machine_reset_igs011; + break; + case "PGM": + PGM.device_init(); + PGM.video_start_pgm(); + machine_reset_callback = PGM.machine_reset_pgm; + break; + case "M72": + M72.machine_start_m72(); + M72.video_start_m72(); + machine_reset_callback = M72.machine_reset_m72; + switch (Machine.sName) + { + case "ltswords": + case "kengo": + case "kengoa": + machine_reset_callback = M72.machine_reset_kengo; + break; + } + break; + case "M92": + M92.machine_start_m92(); + M92.video_start_m92(); + machine_reset_callback = M92.machine_reset_m92; + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + Taito.video_start_bublbobl(); + machine_reset_callback = Taito.machine_reset_null; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfp": + Taito.video_start_opwolf(); + machine_reset_callback = Taito.machine_reset_opwolf; + break; + case "opwolfb": + Taito.video_start_opwolf(); + machine_reset_callback = Taito.machine_reset_null; + break; + } + break; + case "Taito B": + Eeprom.eeprom_init(); + switch (Machine.sName) + { + case "pbobble": + Taitob.video_start_taitob_color_order1(); + machine_reset_callback = Taitob.machine_reset_mb87078; + break; + case "silentd": + case "silentdj": + case "silentdu": + Taitob.video_start_taitob_color_order2(); + machine_reset_callback = Taitob.machine_reset_mb87078; + break; + } + break; + case "Konami 68000": + Eeprom.eeprom_init(); + machine_reset_callback = Konami68000.machine_reset_konami68000; + switch (Machine.sName) + { + case "cuebrick": + case "mia": + case "mia2": + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + Konami68000.video_start_tmnt(); + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + Konami68000.video_start_punkshot(); + break; + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + Konami68000.video_start_lgtnfght(); + break; + case "blswhstl": + case "blswhstla": + case "detatwin": + Konami68000.video_start_blswhstl(); + break; + case "glfgreat": + case "glfgreatj": + Konami68000.video_start_glfgreat(); + break; + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + Konami68000.video_start_thndrx2(); + break; + case "prmrsocr": + case "prmrsocrj": + Konami68000.video_start_prmrsocr(); + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Capcom.video_start_gng(); + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + Capcom.video_start_sf(); + break; + } + machine_reset_callback = Capcom.machine_reset_capcom; + break; + } + } + public static byte[] GetNeogeoRom(string sFile) + { + byte[] bb1; + string path = System.IO.Path.Combine(Mame.RomRoot + "/neogeo/", sFile); + if (File.Exists(path)) + { + EmuLogger.Log($"Had File => {path}"); + return File.ReadAllBytes(path); + //FileStream fs1 = new FileStream(path, FileMode.Open); + //int n1 = (int)fs1.Length; + //bb1 = new byte[n1]; + //fs1.Read(bb1, 0, n1); + //fs1.Close(); + } + else + { + EmuLogger.Log($"Miss File => {path}"); + bb1 = null; + } + return bb1; + } + public static byte[] GetRom(string sFile) + { + foreach (string s1 in lsParents) + { + string path = System.IO.Path.Combine(Mame.RomRoot + "/" + s1 + "/", sFile); + if (File.Exists(path)) + { + EmuLogger.Log($"Had File => {path}"); + return File.ReadAllBytes(path); + } + else + { + EmuLogger.Log($"Miss File => {path}"); + } + } + return null; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Machine.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Machine.cs.meta new file mode 100644 index 00000000..2c9b38b2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Machine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86a5998a8de08cc42b807fb363192b99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mame.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mame.cs new file mode 100644 index 00000000..93f050b7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mame.cs @@ -0,0 +1,453 @@ +using MAME.Core; +using System.IO; + +namespace MAME.Core +{ + public class Mame + { + public enum PlayState + { + PLAY_RUNNING = 0, + PLAY_SAVE, + PLAY_LOAD, + PLAY_RESET, + PLAY_RECORDSTART, + PLAY_RECORDRUNNING, + PLAY_RECORDEND, + PLAY_REPLAYSTART, + PLAY_REPLAYRUNNING, + PLAY_REPLAYEND, + } + public static PlayState playState; + public static bool is_foreground; + public static bool paused; + public static bool exit_pending; + public static EmuTimer.emu_timer soft_reset_timer; + public static BinaryReader brRecord = null; + public static BinaryWriter bwRecord = null; + public static bool bPP = true; + public static string RomRoot = string.Empty; + public class AA + { + public int fr; + public string fi; + public AA(int i1, string s1) + { + fr = i1; + fi = s1; + } + } + public static AA[] aa = new AA[]{ + new AA(1055,"1"), + new AA(6547,"2"), + new AA(13955,"3") + }; + private static FileStream fsRecord = null; + + public static void mame_execute() + { + soft_reset(); + //mame_pause(true); + //开始不暂停 + mame_pause(false); + while (!exit_pending) + { + if (!paused) + { + Cpuexec.cpuexec_timeslice(); + } + else + { + //TODO 暂停时,不应该更新画面帧 + //Video.video_frame_update(); + } + /*if (bPP) + { + foreach (AA a in aa) + { + if (Video.screenstate.frame_number == a.fr) + { + mame_pause(true); + State.savestate_callback(new BinaryWriter(new FileStream(@"G:\VS2008\compare1\compare1\bin\Debug\sta1\silentd\" + a.fi + ".sta", FileMode.Create))); + bPP = false; + } + } + } + else + { + foreach (AA a in aa) + { + if (Video.screenstate.frame_number == a.fr + 1) + { + bPP = true; + } + } + }*/ + handlestate(); + } + } + + #region Update 推进方式 + + public static void mame_execute_UpdateMode_Start() + { + soft_reset(); + //mame_pause(true); + //开始不暂停 + mame_pause(false); + } + + public static void mame_execute_UpdateMode_NextFrame() + { + if (exit_pending) + return; + + long lastframe = Video.screenstate.frame_number; + //执行CPU命令,直到一次画面更新 + while (lastframe == Video.screenstate.frame_number) + { + if (!paused) + { + Cpuexec.cpuexec_timeslice(); + } + else + { + Video.video_frame_update(); + } + handlestate(); + } + } + #endregion + + public static void mame_schedule_soft_reset() + { + EmuTimer.timer_adjust_periodic(soft_reset_timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + mame_pause(false); + if (Cpuexec.activecpu >= 0) + { + Cpuexec.cpu[Cpuexec.activecpu].PendingCycles = -1; + } + } + private static void handlestate() + { + if (playState == PlayState.PLAY_SAVE) + { + mame_pause(true); + Motion.motion_handler_callback = handle_save; + } + else if (playState == PlayState.PLAY_LOAD) + { + mame_pause(true); + Motion.motion_handler_callback = handle_load; + } + else if (playState == PlayState.PLAY_RESET) + { + soft_reset(); + playState = PlayState.PLAY_RUNNING; + } + else if (playState == PlayState.PLAY_RECORDSTART) + { + mame_pause(true); + Motion.motion_handler_callback = handle_record; + } + else if (playState == PlayState.PLAY_RECORDEND) + { + handle_record(); + } + else if (playState == PlayState.PLAY_REPLAYSTART) + { + mame_pause(true); + Motion.motion_handler_callback = handle_replay; + } + else if (playState == PlayState.PLAY_REPLAYEND) + { + handle_replay(); + } + } + public static void init_machine() + { + Inptport.input_init(); + Palette.palette_init(); + Generic.generic_machine_init(); + EmuTimer.timer_init(); + soft_reset_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Mame_soft_reset, false); + Window.osd_init(); + Inptport.input_port_init(); + Cpuexec.cpuexec_init(); + Watchdog.watchdog_init(); + Cpuint.cpuint_init(); + Machine.driver_init(); + Video.video_init(); + Tilemap.tilemap_init(); + Crosshair.crosshair_init(); + Sound.sound_init(); + State.state_init(); + Machine.machine_start(); + } + public static void mame_pause(bool pause) + { + if (paused == pause) + return; + EmuLogger.Log($"mame_pause->{pause}"); + paused = pause; + Window.wininput_pause(paused); + Sound.sound_pause(paused); + } + public static bool mame_is_paused() + { + return (playState != PlayState.PLAY_RUNNING && playState != PlayState.PLAY_RECORDRUNNING && playState != PlayState.PLAY_REPLAYRUNNING) || paused; + } + public static void soft_reset() + { + Memory.memory_reset(); + Cpuint.cpuint_reset(); + Machine.machine_reset_callback(); + Generic.interrupt_reset(); + Cpuexec.cpuexec_reset(); + Watchdog.watchdog_internal_reset(); + Sound.sound_reset(); + playState = PlayState.PLAY_RUNNING; + EmuTimer.timer_set_global_time(EmuTimer.get_current_time()); + } + private static void handle_save() + { + //是否焦点 + is_foreground = true; + if (is_foreground) + { + Video.sDrawText = "Select position to save to"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; + if (Keyboard.IsTriggered(MotionKey.Escape)) + { + Video.sDrawText = "Save cancelled"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; + playState = PlayState.PLAY_RUNNING; + mame_pause(false); + Motion.motion_handler_callback = Motion.handler_ingame; + return; + } + } + } + private static void handle_load() + { + //是否焦点 + bool is_foreground = true; + if (is_foreground) + { + Video.sDrawText = "Select position to load from"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; + if (Keyboard.IsTriggered(MotionKey.Escape)) + { + Video.sDrawText = "Load cancelled"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; + playState = PlayState.PLAY_RUNNING; + mame_pause(false); + Motion.motion_handler_callback = Motion.handler_ingame; + return; + } + } + } + private static void handle_record() + { + //是否焦点 + bool is_foreground = true; + if (is_foreground) + { + if (playState == PlayState.PLAY_RECORDSTART) + { + Video.sDrawText = "Select position to record to"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; + if (Keyboard.IsTriggered(MotionKey.Escape)) + { + Video.sDrawText = "Record cancelled"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; + playState = PlayState.PLAY_RUNNING; + mame_pause(false); + Motion.motion_handler_callback = Motion.handler_ingame; + return; + } + } + else if (playState == PlayState.PLAY_RECORDEND) + { + Video.sDrawText = "Record end"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; + bwRecord.Close(); + bwRecord = null; + playState = PlayState.PLAY_RUNNING; + } + } + } + private static void handle_replay() + { + //是否焦点 + bool is_foreground = true; + if (is_foreground) + { + if (playState == PlayState.PLAY_REPLAYSTART) + { + Video.sDrawText = "Select position to replay from"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; + if (Keyboard.IsTriggered(MotionKey.Escape)) + { + Video.sDrawText = "Replay cancelled"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; + playState = PlayState.PLAY_RUNNING; + mame_pause(false); + Motion.motion_handler_callback = Motion.handler_ingame; + return; + } + } + } + if (playState == PlayState.PLAY_REPLAYEND) + { + Video.sDrawText = "Replay end"; + Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; + brRecord.Close(); + brRecord = null; + //mame_pause(true); + playState = PlayState.PLAY_RUNNING; + } + } + public unsafe static void postload() + { + int i; + switch (Machine.sBoard) + { + case "CPS-1": + for (i = 0; i < 3; i++) + { + CPS.ttmap[i].all_tiles_dirty = true; + } + YM2151.ym2151_postload(); + break; + case "CPS-1(QSound)": + case "CPS2": + for (i = 0; i < 3; i++) + { + CPS.ttmap[i].all_tiles_dirty = true; + } + break; + case "Data East": + Dataeast.bg_tilemap.all_tiles_dirty = true; + YM2203.FF2203[0].ym2203_postload(); + break; + case "Tehkan": + Tehkan.bg_tilemap.all_tiles_dirty = true; + Tehkan.fg_tilemap.all_tiles_dirty = true; + break; + case "Neo Geo": + Neogeo.regenerate_pens(); + YM2610.F2610.ym2610_postload(); + break; + case "Namco System 1": + for (i = 0; i < 6; i++) + { + Namcos1.ttmap[i].all_tiles_dirty = true; + } + YM2151.ym2151_postload(); + break; + case "IGS011": + break; + case "PGM": + PGM.pgm_tx_tilemap.all_tiles_dirty = true; + PGM.pgm_bg_tilemap.all_tiles_dirty = true; + break; + case "M72": + M72.bg_tilemap.all_tiles_dirty = true; + M72.fg_tilemap.all_tiles_dirty = true; + break; + case "M92": + for (i = 0; i < 3; i++) + { + M92.pf_layer[i].tmap.all_tiles_dirty = true; + M92.pf_layer[i].wide_tmap.all_tiles_dirty = true; + } + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + YM2203.FF2203[0].ym2203_postload(); + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + Taito.PC080SN_tilemap[0][0].all_tiles_dirty = true; + Taito.PC080SN_tilemap[0][1].all_tiles_dirty = true; + break; + } + break; + case "Taito B": + Taitob.bg_tilemap.all_tiles_dirty = true; + Taitob.fg_tilemap.all_tiles_dirty = true; + Taitob.tx_tilemap.all_tiles_dirty = true; + YM2610.F2610.ym2610_postload(); + break; + case "Konami 68000": + Konami68000.K052109_tilemap[0].all_tiles_dirty = true; + Konami68000.K052109_tilemap[1].all_tiles_dirty = true; + Konami68000.K052109_tilemap[2].all_tiles_dirty = true; + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Capcom.bg_tilemap.all_tiles_dirty = true; + Capcom.fg_tilemap.all_tiles_dirty = true; + Capcom.bg_tilemap.tilemap_set_scrollx(0, Capcom.scrollx[0] + 256 * Capcom.scrollx[1]); + Capcom.fg_tilemap.tilemap_set_scrollx(0, Capcom.scrolly[0] + 256 * Capcom.scrolly[1]); + YM2203.FF2203[0].ym2203_postload(); + YM2203.FF2203[1].ym2203_postload(); + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + Capcom.bg_tilemap.all_tiles_dirty = true; + Capcom.fg_tilemap.all_tiles_dirty = true; + Capcom.tx_tilemap.all_tiles_dirty = true; + Capcom.bg_tilemap.tilemap_set_scrollx(0, Capcom.bg_scrollx); + Capcom.fg_tilemap.tilemap_set_scrollx(0, Capcom.fg_scrollx); + break; + } + break; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mame.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mame.cs.meta new file mode 100644 index 00000000..49597c85 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e30f5098b492cd4cb60af6ab875f5e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Memory.cs new file mode 100644 index 00000000..6d994166 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Memory.cs @@ -0,0 +1,574 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe class Memory + { + //public static byte[] mainrom, audiorom, mainram, audioram; + + + #region //指针化mainrom + static byte[] mainrom_src; + static GCHandle mainrom_handle; + public static byte* mainrom; + public static int mainromLength; + public static bool mainrom_IsNull => mainrom == null; + public static void Set_mainrom(byte[] data) { mainrom_set = data; } + public static byte[] mainrom_set + { + set + { + mainrom_handle.ReleaseGCHandle(); + mainrom_src = value; + mainromLength = value.Length; + mainrom_src.GetObjectPtr(ref mainrom_handle, ref mainrom); + } + } + #endregion + + #region //指针化audiorom + static byte[] audiorom_src; + static GCHandle audiorom_handle; + public static byte* audiorom; + public static int audioromLength; + public static bool audiorom_IsNull => audiorom == null; + public static void Set_audiorom(byte[] data) { audiorom_set = data; } + public static byte[] audiorom_set + { + set + { + audiorom_handle.ReleaseGCHandle(); + audiorom_src = value; + audioromLength = value.Length; + audiorom_src.GetObjectPtr(ref audiorom_handle, ref audiorom); + } + } + #endregion + + #region //指针化mainram + static byte[] mainram_src; + static GCHandle mainram_handle; + public static byte* mainram; + public static int mainramLength; + public static bool mainram_IsNull => mainram == null; + public static void Set_mainram(byte[] data) { mainram_set = data; } + public static byte[] mainram_set + { + set + { + mainram_handle.ReleaseGCHandle(); + mainram_src = value; + mainramLength = value.Length; + mainram_src.GetObjectPtr(ref mainram_handle, ref mainram); + } + } + #endregion + + #region //指针化audioram + static byte[] audioram_src; + static GCHandle audioram_handle; + public static byte* audioram; + public static int audioramLength; + public static bool audioram_IsNull => audioram == null; + public static void Set_audioram(byte[] data) { audioram_set = data; } + public static byte[] audioram_set + { + set + { + audioram_handle.ReleaseGCHandle(); + audioram_src = value; + audioramLength = value.Length; + audioram_src.GetObjectPtr(ref audioram_handle, ref audioram); + } + } + #endregion + + + public static void memory_reset() + { + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + CPS.sbyte0 = -1; + CPS.short1 = -1; + CPS.short2 = -1; + CPS.sbyte3 = -1; + break; + case "CPS2": + CPS.short0 = -1; + CPS.short1 = -1; + CPS.short2 = -1; + break; + case "Data East": + Dataeast.byte1 = 0xff; + Dataeast.byte2 = 0xff; + break; + case "Tehkan": + Tehkan.byte0 = 0; + Tehkan.byte1 = 0; + Tehkan.byte2 = 0; + break; + case "Neo Geo": + Neogeo.short0 = unchecked((short)0xff00); + Neogeo.short1 = -1; + Neogeo.short2 = -1; + Neogeo.short3 = 0x3f; + Neogeo.short4 = unchecked((short)0xffc0); + Neogeo.short5 = unchecked((short)0xffff); + Neogeo.short6 = 0x03; + break; + case "Namco System 1": + Namcos1.byte0 = 0xff; + Namcos1.byte1 = 0xff; + Namcos1.byte2 = 0xff; + switch (Machine.sName) + { + case "faceoff": + Namcos1.byte00 = 0xff; + Namcos1.byte01 = 0xff; + Namcos1.byte02 = 0xff; + Namcos1.byte03 = 0xff; + break; + } + break; + case "IGS011": + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + IGS011.sbyte0 = -1; + IGS011.sbyte1 = -1; + IGS011.sbyte2 = -1; + IGS011.sbytec = -1; + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + IGS011.bkey0 = 0xff; + IGS011.bkey1 = 0xff; + IGS011.bkey2 = 0xff; + IGS011.bkey3 = 0xff; + IGS011.bkey4 = 0xff; + IGS011.sbytec = -1; + break; + } + break; + case "PGM": + PGM.short0 = -1; + PGM.short1 = -1; + PGM.short2 = -1; + PGM.short3 = 0xff; + PGM.short4 = 0; + break; + case "M72": + M72.ushort0 = 0xffff; + M72.ushort1 = 0xffff; + break; + case "M92": + M92.ushort0 = 0xffff; + M92.ushort1 = 0xff7f; + M92.ushort2 = 0xffff; + break; + case "Taito": + Taito.sbyte0 = unchecked((sbyte)0xf3); + Taito.sbyte1 = -1; + Taito.sbyte2 = -1; + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + Taito.sbyte0 = unchecked((sbyte)0xd3); + break; + case "sboblbobl": + Taito.sbyte0 = unchecked((sbyte)0x73); + break; + case "opwolf": + Taito.sbyte0 = unchecked((sbyte)0xfc); + break; + case "opwolfp": + Taito.sbyte2 = 0x3e; + Taito.sbyte3 = 0; + break; + } + break; + case "Taito B": + Taitob.sbyte0 = -1; + Taitob.sbyte1 = -1; + Taitob.sbyte2 = -1; + Taitob.sbyte3 = -1; + Taitob.sbyte4 = -1; + Taitob.sbyte5 = -1; + break; + case "Konami 68000": + Konami68000.sbyte0 = -1; + Konami68000.sbyte1 = -1; + Konami68000.sbyte2 = -1; + Konami68000.sbyte3 = -1; + Konami68000.sbyte4 = -1; + switch (Machine.sName) + { + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + Konami68000.sbyte0 = unchecked((sbyte)0xfb); + break; + case "prmrsocr": + case "prmrsocrj": + Konami68000.sbyte0 = unchecked((sbyte)0xef); + Konami68000.bytee = 0xfe; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Capcom.bytes = 0xff; + Capcom.byte1 = 0xff; + Capcom.byte2 = 0xff; + break; + case "sf": + Capcom.short0 = -1; + Capcom.short1 = -1; + break; + case "sfua": + case "sfj": + Capcom.short1 = -1; + Capcom.short2 = -1; + Capcom.shortc = -1; + break; + case "sfjan": + case "sfan": + case "sfp": + Capcom.short0 = -1; + Capcom.shortc = -1; + Capcom.sbyte1 = 0; + Capcom.sbyte2 = 0; + Capcom.sbyte3 = 0; + Capcom.sbyte4 = 0; + break; + } + break; + } + } + public static void memory_reset2() + { + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + CPS.sbyte0_old = 0; + CPS.short1_old = 0; + CPS.short2_old = 0; + CPS.sbyte3_old = 0; + break; + case "CPS2": + CPS.short0_old = 0; + CPS.short1_old = 0; + CPS.short2_old = 0; + break; + case "Data East": + Dataeast.byte1_old = 0; + Dataeast.byte2_old = 0; + break; + case "Tehkan": + Tehkan.byte0_old = 0; + Tehkan.byte1_old = 0; + Tehkan.byte2_old = 0; + break; + case "Neo Geo": + Neogeo.short0_old = 0; + Neogeo.short1_old = 0; + Neogeo.short2_old = 0; + Neogeo.short3_old = 0; + Neogeo.short4_old = 0; + break; + case "Namco System 1": + Namcos1.byte0_old = 0; + Namcos1.byte1_old = 0; + Namcos1.byte2_old = 0; + break; + case "IGS011": + IGS011.sbyte0_old = 0; + IGS011.sbyte1_old = 0; + IGS011.sbyte2_old = 0; + IGS011.sbytec_old = 0; + break; + case "PGM": + PGM.short0_old = 0; + PGM.short1_old = 0; + PGM.short2_old = 0; + PGM.short3_old = 0; + PGM.short4_old = 0; + break; + case "M72": + M72.ushort0_old = 0; + M72.ushort1_old = 0; + break; + case "M92": + M92.ushort0_old = 0; + M92.ushort1_old = 0; + M92.ushort2_old = 0; + break; + case "Taito": + Taito.sbyte0_old = 0; + Taito.sbyte1_old = 0; + Taito.sbyte2_old = 0; + Taito.sbyte3_old = 0; + break; + case "Taito B": + Taitob.dswb_old = 0; + Taitob.sbyte0_old = 0; + Taitob.sbyte1_old = 0; + Taitob.sbyte2_old = 0; + Taitob.sbyte3_old = 0; + Taitob.sbyte4_old = 0; + Taitob.sbyte5_old = 0; + break; + case "Konami 68000": + Konami68000.sbyte0_old = 0; + Konami68000.sbyte1_old = 0; + Konami68000.sbyte2_old = 0; + Konami68000.sbyte3_old = 0; + Konami68000.sbyte4_old = 0; + switch (Machine.sName) + { + case "prmrsocr": + case "prmrsocrj": + Konami68000.bytee = 0; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Capcom.bytes_old = 0; + Capcom.byte1_old = 0; + Capcom.byte2_old = 0; + break; + case "sf": + Capcom.short0_old = 0; + Capcom.short1_old = 0; + Capcom.shorts_old = 0; + break; + case "sfua": + case "sfj": + Capcom.short1_old = 0; + Capcom.short2_old = 0; + Capcom.shortc_old = 0; + break; + case "sfjan": + case "sfan": + case "sfp": + Capcom.short0_old = 0; + Capcom.shortc_old = 0; + Capcom.sbyte1_old = 0; + Capcom.sbyte2_old = 0; + Capcom.sbyte3_old = 0; + Capcom.sbyte4_old = 0; + break; + } + break; + } + } + + } + + public unsafe static class AxiMemoryEx + { + static HashSet GCHandles = new HashSet(); + + public static void Init() + { + FreeAllGCHandle(); + set_TempBuffer = new byte[0x20000]; + } + + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref uint* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (uint*)intptr; + } + + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref short* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (short*)intptr; + } + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref ushort* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (ushort*)intptr; + } + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref int* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (int*)intptr; + } + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref byte* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (byte*)intptr; + } + + static void GetObjectPtr(this object srcObj, ref GCHandle handle, out IntPtr intptr) + { + ReleaseGCHandle(ref handle); + handle = GCHandle.Alloc(srcObj, GCHandleType.Pinned); + GCHandles.Add(handle); + intptr = handle.AddrOfPinnedObject(); + } + + public static void ReleaseGCHandle(this ref GCHandle handle) + { + if (handle.IsAllocated) + handle.Free(); + GCHandles.Remove(handle); + } + + public static void FreeAllGCHandle() + { + foreach (var handle in GCHandles) + { + if (handle.IsAllocated) + handle.Free(); + } + GCHandles.Clear(); + } + + #region 指针化 TempBuffer + static byte[] TempBuffer_src; + static GCHandle TempBuffer_handle; + public static byte* TempBuffer; + public static byte[] set_TempBuffer + { + set + { + TempBuffer_handle.ReleaseGCHandle(); + if (value == null) + return; + TempBuffer_src = value; + TempBuffer_src.GetObjectPtr(ref TempBuffer_handle, ref TempBuffer); + } + } + #endregion + + public static void Write(this BinaryWriter bw, byte* bufferPtr, int offset, int count) + { + // 使用指针复制数据到临时数组 + Buffer.MemoryCopy(bufferPtr + offset, TempBuffer, 0, count); + // 使用BinaryWriter写入临时数组 + bw.Write(TempBuffer_src, 0, count); + } + public static void Write(this FileStream fs, byte* bufferPtr, int offset, int count) + { + // 使用指针复制数据到临时数组 + Buffer.MemoryCopy(bufferPtr + offset, TempBuffer, 0, count); + // 使用BinaryWriter写入临时数组 + fs.Write(TempBuffer_src, 0, count); + } + public static int Read(this FileStream fs, byte* bufferPtr, int offset, int count) + { + // 使用BinaryWriter写入临时数组 + count = fs.Read(TempBuffer_src, offset, count); + // 使用指针复制数据到临时数组 + Buffer.MemoryCopy(TempBuffer, bufferPtr + offset, 0, count); + return count; + } + } + + public unsafe static class AxiArray + { + + public static void Copy(byte* src, int srcindex, byte* target, int targetindex, int count) + { + int singlesize = sizeof(byte); + long totalBytesToCopy = count * singlesize; + Buffer.MemoryCopy(&src[srcindex], &target[targetindex], totalBytesToCopy, totalBytesToCopy); + } + public static void Copy(short* src, int srcindex, short* target, int targetindex, int count) + { + int singlesize = sizeof(short); + long totalBytesToCopy = count * singlesize; + Buffer.MemoryCopy(&src[srcindex], &target[targetindex], totalBytesToCopy, totalBytesToCopy); + } + public static void Copy(ushort* src, int srcindex, ushort* target, int targetindex, int count) + { + int singlesize = sizeof(ushort); + long totalBytesToCopy = count * singlesize; + Buffer.MemoryCopy(&src[srcindex], &target[targetindex], totalBytesToCopy, totalBytesToCopy); + } + + public static void Copy(byte* src, byte* target, int index, int count) + { + int singlesize = sizeof(byte); + long totalBytesToCopy = count * singlesize; + Buffer.MemoryCopy(&src[index], &target[index], totalBytesToCopy, totalBytesToCopy); + } + + public static void Copy(ushort* src, ushort* target, int index, int count) + { + int singlesize = sizeof(ushort); + long totalBytesToCopy = count * singlesize; + Buffer.MemoryCopy(&src[index], &target[index], totalBytesToCopy, totalBytesToCopy); + } + public static void Copy(ushort* src, ushort* target, int count) + { + int singlesize = sizeof(ushort); + long totalBytesToCopy = count * singlesize; + Buffer.MemoryCopy(src, target, totalBytesToCopy, totalBytesToCopy); + } + public static void Copy(byte* src, byte* target, int count) + { + int singlesize = sizeof(byte); + long totalBytesToCopy = count * singlesize; + Buffer.MemoryCopy(src, target, totalBytesToCopy, totalBytesToCopy); + } + public static void Clear(byte* data, int index, int lenght) + { + for (int i = index; i < lenght; i++, index++) + data[index] = 0; + } + public static void Clear(ushort* data, int index, int lenght) + { + for (int i = index; i < lenght; i++, index++) + data[index] = 0; + } + } + +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Memory.cs.meta new file mode 100644 index 00000000..6a62888d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 040e2c19304bdb24ab49a31b143359b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs new file mode 100644 index 00000000..afd81e1f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs @@ -0,0 +1,636 @@ +namespace MAME.Core +{ + /// + /// 原依赖Form的内容 + /// + public unsafe class Motion + { + private static uint UI_FILLCOLOR = Palette.make_argb(0xe0, 0x10, 0x10, 0x30); + public delegate void motion_delegate(); + public static motion_delegate motion_handler_callback, motion_update_callback; + public static bool single_step; + public static void ui_update_and_render() + { + motion_update_callback(); + motion_handler_callback(); + } + //public static void ui_updateC() + //{ + // //不再填充完整画布 + // //{ + // // int i; + // // int red, green, blue; + // // if (single_step || Mame.paused) + // // { + // // byte bright = 0xa7; + // // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // // { + // // red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + // // green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + // // blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + // // Video.bitmapcolor[i] = (int)Palette.make_argb(0xff, red, green, blue); + // // } + // // } + // // else + // // { + // // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // // { + // // Video.bitmapcolor[i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + // // } + // // } + // //} + + // { + // int i; + // int target_i = 0; + // int x, y; + // int red, green, blue; + + // int startX = Video.offsetx; + // int endX = Video.offsetx + Video.width; + // int startY = Video.offsety; + // int endY = Video.offsety + Video.height; + + // if (single_step || Mame.paused) + // { + // byte bright = 0xa7; + // for (y = startY; y < endY; y++) + // { + // int stepIndex = y * Video.fullwidth; + // for (x = startX; x < endX; x++, target_i++) + // { + // //i = y * Video.fullwidth + x; + // i = stepIndex + x; + // red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + // green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + // blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + // Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.make_argb(0xff, red, green, blue); + // } + // } + // } + // else + // { + + // for (y = startY; y < endY; y++) + // { + // int stepIndex = y * Video.fullwidth; + // for (x = startX; x < endX; x++, target_i++) + // { + // //i = y * Video.fullwidth + x; + // i = stepIndex + x; + // Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + // } + // } + // } + // } + //} + public unsafe static void ui_updateC() + { + //fixed (ushort* curbitmapPtr = &Video.bitmapbase_Ptrs[Video.curbitmap][0]) + //fixed (uint* entry_colorPtr = &Palette.entry_color[0]) + //fixed (int* bitmapcolorRectPtr = &Video.bitmapcolorRect_Ptrunsafe[0]) + { + //ushort* curbitmap = curbitmapPtr; + ushort* curbitmap = (ushort*)Video.bitmapbase_Ptrs[Video.curbitmap]; + //uint* entry_color = entry_colorPtr; + uint* entry_color = (uint*)Palette.entry_color_Ptr; + //int* bitmapcolorRect = bitmapcolorRectPtr; + int* bitmapcolorRect = (int*)Video.bitmapcolorRect_Ptr; + + /* + //不再填充完整画布 + //{ + // int i; + // int red, green, blue; + // if (single_step || Mame.paused) + // { + // byte bright = 0xa7; + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + // green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + // blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + // Video.bitmapcolor[i] = (int)Palette.make_argb(0xff, red, green, blue); + // } + // } + // else + // { + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // Video.bitmapcolor[i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + // } + // } + //} + */ + { + int i; + int target_i = 0; + int x, y; + int red, green, blue; + + int startX = Video.offsetx; + int endX = Video.offsetx + Video.width; + int startY = Video.offsety; + int endY = Video.offsety + Video.height; + + if (single_step || Mame.paused) + { + byte bright = 0xa7; + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + i = stepIndex + x; + red = (int)(((entry_color[curbitmap[i]] & 0xff0000) >> 16) * bright / 0xff); + green = (int)(((entry_color[curbitmap[i]] & 0xff00) >> 8) * bright / 0xff); + blue = (int)((entry_color[curbitmap[i]] & 0xff) * bright / 0xff); + bitmapcolorRect[target_i] = (int)Palette.make_argb(0xff, red, green, blue); + } + } + } + else + { + + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + i = stepIndex + x; + bitmapcolorRect[target_i] = (int)entry_color[curbitmap[i]]; + } + } + + //for (y = startY; y < endY; y++) + //{ + // int stepIndex = y * Video.fullwidth; + + // for (x = startX; x < endX; x++, target_i++) + // { + // i = stepIndex + x; + // bitmapcolorRect[target_i] = (int)entry_color[curbitmap[i]]; + // } + + // // 使用Marshal.Copy进行内存拷贝 + // Marshal.Copy(Palette.entry_color_Ptr,, Video.bitmapcolorRect_Ptr, endX - startX); + //} + } + } + } + } + public static void ui_updateTehkan() + { + //不再填充完整画布 + //{ + // int i; + // int red, green, blue; + // if (single_step || Mame.paused) + // { + // byte bright = 0xa7; + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // if (Video.bitmapbase_Ptrs[Video.curbitmap][i] < 0x100) + // { + // red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + // green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + // blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + // Video.bitmapcolor[i] = (int)Palette.make_argb(0xff, red, green, blue); + // } + // else + // { + // int i1 = 1; + // } + // } + // } + // else + // { + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // if (Video.bitmapbase_Ptrs[Video.curbitmap][i] < 0x100) + // { + // Video.bitmapcolor[i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + // } + // else + // { + // Video.bitmapcolor[i] = (int)Palette.entry_color[0]; + // } + // } + // } + //} + + { + int i; + int target_i = 0; + int x, y; + int red, green, blue; + + int startX = Video.offsetx; + int endX = Video.offsetx + Video.width; + int startY = Video.offsety; + int endY = Video.offsety + Video.height; + + if (single_step || Mame.paused) + { + byte bright = 0xa7; + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + if (Video.bitmapbase_Ptrs[Video.curbitmap][i] < 0x100) + { + red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.make_argb(0xff, red, green, blue); + } + else + { + int i1 = 1; + } + } + } + } + else + { + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + if (Video.bitmapbase_Ptrs[Video.curbitmap][i] < 0x100) + { + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + } + else + { + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.entry_color[0]; + } + } + } + } + } + } + public unsafe static void ui_updateN() + { + //不再填充完整画布 + //{ + // int i; + // int red, green, blue; + // if (single_step || Mame.paused) + // { + // byte bright = 0xa7; + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // red = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff0000) >> 16) * bright / 0xff; + // green = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff00) >> 8) * bright / 0xff; + // blue = (Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff) * bright / 0xff; + // Video.bitmapcolor[i] = (int)Palette.make_argb(0xff, red, green, blue); + // } + // } + // else + // { + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // Video.bitmapcolor[i] = (int)(0xff000000 | (uint)Video.bitmapbaseN_Ptrs[Video.curbitmap][i]); + // } + // } + //} + + { + int i; + int target_i = 0; + int x, y; + int red, green, blue; + + int startX = Video.offsetx; + int endX = Video.offsetx + Video.width; + int startY = Video.offsety; + int endY = Video.offsety + Video.height; + if (single_step || Mame.paused) + { + byte bright = 0xa7; + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + red = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff0000) >> 16) * bright / 0xff; + green = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff00) >> 8) * bright / 0xff; + blue = (Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff) * bright / 0xff; + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.make_argb(0xff, red, green, blue); + } + } + } + else + { + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)(0xff000000 | (uint)Video.bitmapbaseN_Ptrs[Video.curbitmap][i]); + } + } + } + } + } + public static void ui_updateNa() + { + //不再填充完整画布 + //{ + // int i; + // int red, green, blue; + // if (single_step || Mame.paused) + // { + // byte bright = 0xa7; + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + // green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + // blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + // Video.bitmapcolor[i] = (int)Palette.make_argb(0xff, red, green, blue); + // } + // } + // else + // { + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // Video.bitmapcolor[i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + // } + // } + //} + + { + int i; + int target_i = 0; + int x, y; + int red, green, blue; + + int startX = Video.offsetx; + int endX = Video.offsetx + Video.width; + int startY = Video.offsety; + int endY = Video.offsety + Video.height; + if (single_step || Mame.paused) + { + byte bright = 0xa7; + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.make_argb(0xff, red, green, blue); + } + } + } + else + { + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + } + } + } + } + } + public static void ui_updateIGS011() + { + //不再填充完整画布 + //{ + // int i; + // int red, green, blue; + // if (single_step || Mame.paused) + // { + // byte bright = 0xa7; + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + // green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + // blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + // Video.bitmapcolor[i] = (int)Palette.make_argb(0xff, red, green, blue); + // } + // } + // else + // { + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // Video.bitmapcolor[i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + // } + // } + //} + + { + int i; + int target_i = 0; + int x, y; + int red, green, blue; + + int startX = Video.offsetx; + int endX = Video.offsetx + Video.width; + int startY = Video.offsety; + int endY = Video.offsety + Video.height; + + if (single_step || Mame.paused) + { + byte bright = 0xa7; + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.make_argb(0xff, red, green, blue); + } + } + } + else + { + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + } + } + } + } + } + public static void ui_updatePGM() + { + //不再填充完整画布 + //{ + // int i; + // int red, green, blue; + // if (single_step || Mame.paused) + // { + // byte bright = 0xa7; + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + // green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + // blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + // Video.bitmapcolor[i] = (int)Palette.make_argb(0xff, red, green, blue); + // } + // } + // else + // { + // for (i = 0; i < Video.fullwidth * Video.fullheight; i++) + // { + // Video.bitmapcolor[i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + // } + // } + //} + + { + int i; + int target_i = 0; + int x, y; + int red, green, blue; + + int startX = Video.offsetx; + int endX = Video.offsetx + Video.width; + int startY = Video.offsety; + int endY = Video.offsety + Video.height; + + if (single_step || Mame.paused) + { + byte bright = 0xa7; + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + red = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); + green = (int)(((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); + blue = (int)((Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]] & 0xff) * bright / 0xff); + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.make_argb(0xff, red, green, blue); + } + } + } + else + { + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + //i = y * Video.fullwidth + x; + i = stepIndex + x; + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.entry_color[Video.bitmapbase_Ptrs[Video.curbitmap][i]]; + } + } + } + } + } + public static void handler_ingame() + { + Mame.is_foreground = true; + bool is_paused = Mame.mame_is_paused(); + if (single_step) + { + Mame.mame_pause(true); + single_step = false; + } + if (Mame.is_foreground) + { + if (Keyboard.IsPressed(MotionKey.F3)) + { + cpurun(); + Mame.playState = Mame.PlayState.PLAY_RESET; + } + if (Keyboard.IsTriggered(MotionKey.F7)) + { + cpurun(); + if (Keyboard.IsPressed(MotionKey.LeftShift) || Keyboard.IsPressed(MotionKey.RightShift)) + { + Mame.playState = Mame.PlayState.PLAY_SAVE; + } + else + { + Mame.playState = Mame.PlayState.PLAY_LOAD; + } + return; + } + if (Keyboard.IsTriggered(MotionKey.F8)) + { + cpurun(); + if (Keyboard.IsPressed(MotionKey.LeftShift) || Keyboard.IsPressed(MotionKey.RightShift)) + { + if (Mame.playState == Mame.PlayState.PLAY_RECORDRUNNING) + { + Mame.playState = Mame.PlayState.PLAY_RECORDEND; + } + else + { + Mame.playState = Mame.PlayState.PLAY_RECORDSTART; + } + } + else + { + Mame.playState = Mame.PlayState.PLAY_REPLAYSTART; + } + return; + } + if (Keyboard.IsTriggered(MotionKey.EMU_PAUSED)) + { + if (is_paused && (Keyboard.IsPressed(MotionKey.LeftShift) || Keyboard.IsPressed(MotionKey.RightShift))) + { + single_step = true; + Mame.mame_pause(false); + } + else + { + Mame.mame_pause(!Mame.mame_is_paused()); + } + } + if (Keyboard.IsTriggered(MotionKey.F10)) + { + Keyboard.bF10 = true; + bool b1 = Video.global_throttle; + Video.global_throttle = !b1; + } + } + } + public static void cpurun() + { + } + private static double ui_get_line_height() + { + int raw_font_pixel_height = 0x0b; + int target_pixel_height = 0xff; + double one_to_one_line_height; + double scale_factor; + one_to_one_line_height = (double)raw_font_pixel_height / (double)target_pixel_height; + scale_factor = 1.0; + return scale_factor * one_to_one_line_height; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs.meta new file mode 100644 index 00000000..c42a026a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 360c7dc5e5b2c964696b699c9a52eb7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mouse.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mouse.cs new file mode 100644 index 00000000..aeaade3c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mouse.cs @@ -0,0 +1,33 @@ +using MAME.Core; + +namespace MAME.Core +{ + public class Mouse + { + public static int deltaX, deltaY, oldX, oldY; + public static byte[] buttons; + static IMouse iMouse; + public static void InitialMouse(IMouse im) + { + iMouse = im; + } + + public static void Update() + { + int X, Y; + iMouse.MouseXY(out X, out Y, out byte[] MouseButtons); + deltaX = X - oldX; + deltaY = Y - oldY; + oldX = X; + oldY = Y; + buttons = MouseButtons; + + //MouseState mouseState = mouseDevice.CurrentMouseState; + //deltaX = mouseState.X - oldX; + //deltaY = mouseState.Y - oldY; + //oldX = mouseState.X; + //oldY = mouseState.Y; + //buttons = mouseState.GetMouseButtons(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mouse.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mouse.cs.meta new file mode 100644 index 00000000..5059a30f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Mouse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a83ce47c6bfa754690c818d4aa1cd51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Palette.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Palette.cs new file mode 100644 index 00000000..a89203df --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Palette.cs @@ -0,0 +1,358 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public class Palette + { + public static uint[] entry_color; + /** entry_color的指针管理 **/ + static GCHandle entry_color_handle; + public static IntPtr entry_color_Ptr; + /** end **/ + + public static float[] entry_contrast; + private static uint trans_uint; + private static int numcolors, numgroups; + //public static Color trans_color; + public delegate void palette_delegate(int index, uint rgb); + public static palette_delegate palette_set_callback; + public static void palette_init() + { + int index; + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + //trans_color = Color.Magenta; + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0xc00; + palette_set_callback = palette_entry_set_color1; + break; + case "Data East": + //trans_color = Color.Magenta; + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x200; + palette_set_callback = palette_entry_set_color2; + break; + case "Tehkan": + //trans_color = Color.Magenta; + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x100; + palette_set_callback = palette_entry_set_color2; + break; + case "SunA8": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x100; + palette_set_callback = palette_entry_set_color2; + break; + case "Namco System 1": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x2001; + palette_set_callback = palette_entry_set_color1; + break; + case "IGS011": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x800; + palette_set_callback = palette_entry_set_color1; + break; + case "PGM": + //trans_color = Color.Magenta; + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x901; + palette_set_callback = palette_entry_set_color2; + break; + case "M72": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x201; + palette_set_callback = palette_entry_set_color1; + break; + case "M92": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x801; + palette_set_callback = palette_entry_set_color2; + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + //trans_color = Color.Magenta; + //trans_color = Color.Black; + numcolors = 0x100; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + //trans_color = Color.Black; + numcolors = 0x2000; + break; + } + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + palette_set_callback = palette_entry_set_color2; + break; + case "Taito B": + //trans_color = Color.Magenta; + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x1000; + palette_set_callback = palette_entry_set_color3; + break; + case "Konami 68000": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x800; + palette_set_callback = palette_entry_set_color3; + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x100; + palette_set_callback = palette_entry_set_color2; + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + //trans_color = Color.Black; + trans_uint = 0x0;//(uint)trans_color.ToArgb(); + numcolors = 0x400; + palette_set_callback = palette_entry_set_color3; + break; + } + break; + } + + + //entry_color = new uint[numcolors]; + + + /** entry_color的指针管理 **/ + // 释放句柄 + if (entry_color != null && entry_color_handle.IsAllocated) + entry_color_handle.Free(); + + entry_color = new uint[numcolors]; + // 固定数组,防止垃圾回收器移动它 + entry_color_handle = GCHandle.Alloc(entry_color, GCHandleType.Pinned); + // 获取数组的指针 + entry_color_Ptr = entry_color_handle.AddrOfPinnedObject(); + /** end **/ + + + + entry_contrast = new float[numcolors]; + + + + for (index = 0; index < numcolors; index++) + { + palette_set_callback(index, make_argb(0xff, pal1bit((byte)(index >> 0)), pal1bit((byte)(index >> 1)), pal1bit((byte)(index >> 2)))); + } + switch (Machine.sBoard) + { + case "SunA8": + entry_color[0xff] = trans_uint; + break; + case "Namco System 1": + entry_color[0x2000] = trans_uint; + break; + case "PGM": + entry_color[0x900] = trans_uint; + break; + case "M72": + entry_color[0x200] = trans_uint; + break; + case "M92": + entry_color[0x800] = trans_uint; + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + entry_color[0xff] = trans_uint; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + break; + } + break; + case "Taito B": + entry_color[0] = trans_uint; + break; + case "Konami 68000": + entry_color[0] = trans_uint; + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + //entry_color[0] = trans_uint; + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + entry_color[0] = trans_uint; + break; + } + break; + } + } + public static void palette_entry_set_color1(int index, uint rgb) + { + if (index >= numcolors || entry_color[index] == rgb) + { + return; + } + if (index % 0x10 == 0x0f && rgb == 0) + { + entry_color[index] = trans_uint; + } + else + { + entry_color[index] = 0xff000000 | rgb; + } + } + public static void palette_entry_set_color2(int index, uint rgb) + { + if (index >= numcolors || entry_color[index] == rgb) + { + return; + } + entry_color[index] = 0xff000000 | rgb; + } + public static void palette_entry_set_color3(int index, uint rgb) + { + if (index >= numcolors || entry_color[index] == rgb || index == 0) + { + return; + } + entry_color[index] = 0xff000000 | rgb; + } + public static void palette_entry_set_contrast(int index, float contrast) + { + int groupnum; + if (index >= numcolors || entry_contrast[index] == contrast) + { + return; + } + entry_contrast[index] = contrast; + for (groupnum = 0; groupnum < numgroups; groupnum++) + { + //update_adjusted_color(palette, groupnum, index); + } + } + public static uint make_rgb(int r, int g, int b) + { + //return ((((uint)(r) & 0xff) << 16) | (((uint)(g) & 0xff) << 8) | ((uint)(b) & 0xff)); + //通道修改,BGRA->RGBA + return ((((uint)(b) & 0xff) << 16) | (((uint)(g) & 0xff) << 8) | ((uint)(r) & 0xff)); + } + public static uint make_argb(int a, int r, int g, int b) + { + //return ((((uint)(a) & 0xff) << 24) | (((uint)(r) & 0xff) << 16) | (((uint)(g) & 0xff) << 8) | ((uint)(b) & 0xff)); + //通道修改,BGRA->RGBA + return ((((uint)(a) & 0xff) << 24) | (((uint)(b) & 0xff) << 16) | (((uint)(g) & 0xff) << 8) | ((uint)(r) & 0xff)); + } + public static byte pal1bit(byte bits) + { + return (byte)(((bits & 1) != 0) ? 0xff : 0x00); + } + public static byte pal4bit(byte bits) + { + bits &= 0xf; + return (byte)((bits << 4) | bits); + } + public static byte pal5bit(byte bits) + { + bits &= 0x1f; + return (byte)((bits << 3) | (bits >> 2)); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Palette.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Palette.cs.meta new file mode 100644 index 00000000..bf076c1d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Palette.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0abd7dd5b663eb44b28d34fab1c6119 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Pd4900a.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Pd4900a.cs new file mode 100644 index 00000000..5e6b23f7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Pd4900a.cs @@ -0,0 +1,360 @@ +using System.IO; + +namespace MAME.Core +{ + public class Pd4900a + { + public struct pd4990a_s + { + public int seconds; + public int minutes; + public int hours; + public int days; + public int month; + public int year; + public int weekday; + } + public static pd4990a_s pd4990a; + public static uint shiftlo, shifthi; + public static int retraces = 0; /* Assumes 60 retraces a second */ + public static int testwaits = 0; + public static int maxwaits = 1; /*switch test every frame*/ + public static int testbit = 0; /* Pulses a bit in order to simulate */ + public static int outputbit = 0; + public static int bitno = 0; + public static byte reading = 0; + public static byte writting = 0; + public static int clock_line = 0; + public static int command_line = 0; //?? + public static void pd4990a_init() + { + pd4990a.seconds = 0x00; /* seconds BCD */ + pd4990a.minutes = 0x00; /* minutes BCD */ + pd4990a.hours = 0x00; /* hours BCD */ + pd4990a.days = 0x09; /* days BCD */ + pd4990a.month = 9; /* month Hexadecimal form */ + pd4990a.year = 0x73; /* year BCD */ + pd4990a.weekday = 1; /* weekday BCD */ + } + public static void pd4990a_addretrace() + { + ++testwaits; + if (testwaits >= maxwaits) + { + testbit ^= 1; + testwaits = 0; + } + retraces++; + if (retraces < 60) + return; + retraces = 0; + pd4990a.seconds++; + if ((pd4990a.seconds & 0x0f) < 10) + return; + pd4990a.seconds &= 0xf0; + pd4990a.seconds += 0x10; + if (pd4990a.seconds < 0x60) + return; + pd4990a.seconds = 0; + pd4990a.minutes++; + if ((pd4990a.minutes & 0x0f) < 10) + return; + pd4990a.minutes &= 0xf0; + pd4990a.minutes += 0x10; + if (pd4990a.minutes < 0x60) + return; + pd4990a.minutes = 0; + pd4990a.hours++; + if ((pd4990a.hours & 0x0f) < 10) + return; + pd4990a.hours &= 0xf0; + pd4990a.hours += 0x10; + if (pd4990a.hours < 0x24) + return; + pd4990a.hours = 0; + pd4990a_increment_day(); + } + private static void pd4990a_increment_day() + { + int real_year; + pd4990a.days++; + if ((pd4990a.days & 0x0f) >= 10) + { + pd4990a.days &= 0xf0; + pd4990a.days += 0x10; + } + pd4990a.weekday++; + if (pd4990a.weekday == 7) + pd4990a.weekday = 0; + + switch (pd4990a.month) + { + case 1: + case 3: + case 5: + case 7: + case 8: + case 10: + case 12: + if (pd4990a.days == 0x32) + { + pd4990a.days = 1; + pd4990a_increment_month(); + } + break; + case 2: + real_year = (pd4990a.year >> 4) * 10 + (pd4990a.year & 0xf); + if ((real_year % 4) != 0 && ((real_year % 100) == 0 || (real_year % 400) != 0)) + { + if (pd4990a.days == 0x29) + { + pd4990a.days = 1; + pd4990a_increment_month(); + } + } + else + { + if (pd4990a.days == 0x30) + { + pd4990a.days = 1; + pd4990a_increment_month(); + } + } + break; + case 4: + case 6: + case 9: + case 11: + if (pd4990a.days == 0x31) + { + pd4990a.days = 1; + pd4990a_increment_month(); + } + break; + } + } + private static void pd4990a_increment_month() + { + pd4990a.month++; + if (pd4990a.month == 13) + { + pd4990a.month = 1; + pd4990a.year++; + if ((pd4990a.year & 0x0f) >= 10) + { + pd4990a.year &= 0xf0; + pd4990a.year += 0x10; + } + if (pd4990a.year == 0xA0) + pd4990a.year = 0; + } + } + private static void pd4990a_readbit() + { + switch (bitno) + { + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + outputbit = (pd4990a.seconds >> bitno) & 0x01; + break; + case 0x08: + case 0x09: + case 0x0a: + case 0x0b: + case 0x0c: + case 0x0d: + case 0x0e: + case 0x0f: + outputbit = (pd4990a.minutes >> (bitno - 0x08)) & 0x01; + break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + outputbit = (pd4990a.hours >> (bitno - 0x10)) & 0x01; + break; + case 0x18: + case 0x19: + case 0x1a: + case 0x1b: + case 0x1c: + case 0x1d: + case 0x1e: + case 0x1f: + outputbit = (pd4990a.days >> (bitno - 0x18)) & 0x01; + break; + case 0x20: + case 0x21: + case 0x22: + case 0x23: + outputbit = (pd4990a.weekday >> (bitno - 0x20)) & 0x01; + break; + case 0x24: + case 0x25: + case 0x26: + case 0x27: + outputbit = (pd4990a.month >> (bitno - 0x24)) & 0x01; + break; + case 0x28: + case 0x29: + case 0x2a: + case 0x2b: + case 0x2c: + case 0x2d: + case 0x2e: + case 0x2f: + outputbit = (pd4990a.year >> (bitno - 0x28)) & 0x01; + break; + case 0x30: + case 0x31: + case 0x32: + case 0x33: + //unknown + break; + } + } + private static void pd4990a_resetbitstream() + { + shiftlo = 0; + shifthi = 0; + bitno = 0; + } + private static void pd4990a_writebit(byte bit) + { + if (bitno <= 31) //low part + shiftlo |= (uint)(bit << bitno); + else //high part + shifthi |= (uint)(bit << (bitno - 32)); + } + private static void pd4990a_nextbit() + { + ++bitno; + if (reading != 0) + pd4990a_readbit(); + if (reading != 0 && bitno == 0x34) + { + reading = 0; + pd4990a_resetbitstream(); + } + } + private static byte pd4990a_getcommand() + { + //Warning: problems if the 4 bits are in different + //parts, It's very strange that this case could happen. + if (bitno <= 31) + return (byte)(shiftlo >> (bitno - 4)); + else + return (byte)(shifthi >> (bitno - 32 - 4)); + } + private static void pd4990a_update_date() + { + pd4990a.seconds = (int)((shiftlo >> 0) & 0xff); + pd4990a.minutes = (int)((shiftlo >> 8) & 0xff); + pd4990a.hours = (int)((shiftlo >> 16) & 0xff); + pd4990a.days = (int)((shiftlo >> 24) & 0xff); + pd4990a.weekday = (int)((shifthi >> 0) & 0x0f); + pd4990a.month = (int)((shifthi >> 4) & 0x0f); + pd4990a.year = (int)((shifthi >> 8) & 0xff); + } + private static void pd4990a_process_command() + { + switch (pd4990a_getcommand()) + { + case 0x1: //load output register + bitno = 0; + if (reading != 0) + pd4990a_readbit(); //prepare first bit + shiftlo = 0; + shifthi = 0; + break; + case 0x2: + writting = 0; //store register to current date + pd4990a_update_date(); + break; + case 0x3: //start reading + reading = 1; + break; + case 0x7: //switch testbit every frame + maxwaits = 1; + break; + case 0x8: //switch testbit every half-second + maxwaits = 30; + break; + } + pd4990a_resetbitstream(); + } + private static void pd4990a_serial_control(byte data) + { + //Check for command end + if (command_line != 0 && (data & 4) == 0) //end of command + { + pd4990a_process_command(); + } + command_line = data & 4; + if (clock_line != 0 && (data & 2) == 0) //clock lower edge + { + pd4990a_writebit((byte)(data & 1)); + pd4990a_nextbit(); + } + clock_line = data & 2; + } + public static void pd4990a_control_16_w(byte data) + { + pd4990a_serial_control((byte)(data & 0x7)); + } + public static void SaveStateBinary(BinaryWriter writer) + { + writer.Write(pd4990a.seconds); + writer.Write(pd4990a.minutes); + writer.Write(pd4990a.hours); + writer.Write(pd4990a.days); + writer.Write(pd4990a.month); + writer.Write(pd4990a.year); + writer.Write(pd4990a.weekday); + writer.Write(shiftlo); + writer.Write(shifthi); + writer.Write(retraces); + writer.Write(testwaits); + writer.Write(maxwaits); + writer.Write(testbit); + writer.Write(outputbit); + writer.Write(bitno); + writer.Write(reading); + writer.Write(writting); + writer.Write(clock_line); + writer.Write(command_line); + } + public static void LoadStateBinary(BinaryReader reader) + { + pd4990a.seconds = reader.ReadInt32(); + pd4990a.minutes = reader.ReadInt32(); + pd4990a.hours = reader.ReadInt32(); + pd4990a.days = reader.ReadInt32(); + pd4990a.month = reader.ReadInt32(); + pd4990a.year = reader.ReadInt32(); + pd4990a.weekday = reader.ReadInt32(); + shiftlo = reader.ReadUInt32(); + shifthi = reader.ReadUInt32(); + retraces = reader.ReadInt32(); + testwaits = reader.ReadInt32(); + maxwaits = reader.ReadInt32(); + testbit = reader.ReadInt32(); + outputbit = reader.ReadInt32(); + bitno = reader.ReadInt32(); + reading = reader.ReadByte(); + writting = reader.ReadByte(); + clock_line = reader.ReadInt32(); + command_line = reader.ReadInt32(); + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Pd4900a.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Pd4900a.cs.meta new file mode 100644 index 00000000..74073737 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Pd4900a.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27ffe801b103b0a49b81c6d0a458e03b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/RomInfo.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/RomInfo.cs new file mode 100644 index 00000000..3cff492f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/RomInfo.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; + +namespace MAME.Core +{ + public class RomInfo + { + public static List romList; + public static Dictionary dictName2Rom; + public static RomInfo Rom; + public string Name, Board; + public string Parent; + public string Direction; + public string Description; + public string Year; + public string Manufacturer; + public string M1Default, M1Stop, M1Min, M1Max, M1Subtype; + public static ushort IStop; + public RomInfo() + { + + } + public static RomInfo GetRomByName(string s1) + { + if (!dictName2Rom.TryGetValue(s1, out RomInfo info)) + return null; + return info; + } + public static string GetParent(string s1) + { + string sParent = ""; + foreach (RomInfo ri in romList) + { + if (s1 == ri.Name) + { + sParent = ri.Parent; + break; + } + } + return sParent; + } + public static List GetParents(string s1) + { + string sChild, sParent; + List ls1 = new List(); + sChild = s1; + while (sChild != "") + { + ls1.Add(sChild); + sParent = GetParent(sChild); + sChild = sParent; + } + return ls1; + } + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/RomInfo.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/RomInfo.cs.meta new file mode 100644 index 00000000..3cbd9dd0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/RomInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57dfa34089e07b94c80df0ce7e98de80 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/State.cs new file mode 100644 index 00000000..2f9421f3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/State.cs @@ -0,0 +1,250 @@ +using System.IO; + +namespace MAME.Core +{ + public class State + { + public delegate void savestate_delegate(BinaryWriter sw); + public delegate void loadstate_delegate(BinaryReader sr); + public static savestate_delegate savestate_callback; + public static loadstate_delegate loadstate_callback; + public static void state_init() + { + switch (Machine.sBoard) + { + case "CPS-1": + savestate_callback = CPS.SaveStateBinaryC; + loadstate_callback = CPS.LoadStateBinaryC; + break; + case "CPS-1(QSound)": + savestate_callback = CPS.SaveStateBinaryQ; + loadstate_callback = CPS.LoadStateBinaryQ; + break; + case "CPS2": + savestate_callback = CPS.SaveStateBinaryC2; + loadstate_callback = CPS.LoadStateBinaryC2; + break; + case "Data East": + switch (Machine.sName) + { + case "pcktgal": + case "pcktgalb": + case "pcktgal2": + case "pcktgal2j": + case "spool3": + case "spool3i": + savestate_callback = Dataeast.SaveStateBinary_pcktgal; + loadstate_callback = Dataeast.LoadStateBinary_pcktgal; + break; + } + break; + case "Tehkan": + switch (Machine.sName) + { + case "pbaction": + case "pbaction2": + case "pbaction3": + case "pbaction4": + case "pbaction5": + savestate_callback = Tehkan.SaveStateBinary_pbaction; + loadstate_callback = Tehkan.LoadStateBinary_pbaction; + break; + } + break; + case "Neo Geo": + savestate_callback = Neogeo.SaveStateBinary; + loadstate_callback = Neogeo.LoadStateBinary; + break; + case "Namco System 1": + savestate_callback = Namcos1.SaveStateBinary; + loadstate_callback = Namcos1.LoadStateBinary; + break; + case "IGS011": + savestate_callback = IGS011.SaveStateBinary; + loadstate_callback = IGS011.LoadStateBinary; + break; + case "PGM": + savestate_callback = PGM.SaveStateBinary; + loadstate_callback = PGM.LoadStateBinary; + break; + case "M72": + savestate_callback = M72.SaveStateBinary; + loadstate_callback = M72.LoadStateBinary; + break; + case "M92": + savestate_callback = M92.SaveStateBinary; + loadstate_callback = M92.LoadStateBinary; + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + savestate_callback = Taito.SaveStateBinary_tokio; + loadstate_callback = Taito.LoadStateBinary_tokio; + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "bublcave": + case "bublcave11": + case "bublcave10": + savestate_callback = Taito.SaveStateBinary_bublbobl; + loadstate_callback = Taito.LoadStateBinary_bublbobl; + break; + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "dland": + case "bbredux": + case "bublboblb": + case "boblcave": + savestate_callback = Taito.SaveStateBinary_boblbobl; + loadstate_callback = Taito.LoadStateBinary_boblbobl; + break; + case "bub68705": + savestate_callback = Taito.SaveStateBinary_bub68705; + loadstate_callback = Taito.LoadStateBinary_bub68705; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + savestate_callback = Taito.SaveStateBinary_opwolf; + loadstate_callback = Taito.LoadStateBinary_opwolf; + break; + } + break; + case "Taito B": + savestate_callback = Taitob.SaveStateBinary; + loadstate_callback = Taitob.LoadStateBinary; + break; + case "Konami 68000": + switch (Machine.sName) + { + case "cuebrick"://ym K052109 K051960 + savestate_callback = Konami68000.SaveStateBinary_cuebrick; + loadstate_callback = Konami68000.LoadStateBinary_cuebrick; + break; + case "mia"://ym k007232 K052109 K051960 + savestate_callback = Konami68000.SaveStateBinary_mia; + loadstate_callback = Konami68000.LoadStateBinary_mia; + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po"://ym k007232 upd samples K052109 K051960 + savestate_callback = Konami68000.SaveStateBinary_tmnt; + loadstate_callback = Konami68000.LoadStateBinary_tmnt; + break; + case "punkshot": + case "punkshot2": + case "punkshotj"://ym k053260 K052109 K051960 + savestate_callback = Konami68000.SaveStateBinary_punkshot; + loadstate_callback = Konami68000.LoadStateBinary_punkshot; + break; + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon"://ym k053260 K052109 K053245 + savestate_callback = Konami68000.SaveStateBinary_lgtnfght; + loadstate_callback = Konami68000.LoadStateBinary_lgtnfght; + break; + case "blswhstl": + case "blswhstla": + case "detatwin"://ym k053260 K052109 K053245 eeprom bytee + savestate_callback = Konami68000.SaveStateBinary_blswhstl; + loadstate_callback = Konami68000.LoadStateBinary_blswhstl; + break; + case "glfgreat": + case "glfgreatj"://k053260 K052109 K053245 + savestate_callback = Konami68000.SaveStateBinary_glfgreat; + loadstate_callback = Konami68000.LoadStateBinary_glfgreat; + break; + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon"://ym k053260 K052109 K053245 eeprom tmnt2_1c0800 + savestate_callback = Konami68000.SaveStateBinary_tmnt2; + loadstate_callback = Konami68000.LoadStateBinary_tmnt2; + break; + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd"://ym k053260 K052109 K053245 eeprom + savestate_callback = Konami68000.SaveStateBinary_ssriders; + loadstate_callback = Konami68000.LoadStateBinary_ssriders; + break; + case "thndrx2": + case "thndrx2a": + case "thndrx2j"://ym k053260 K052109 K051960 eeprom + savestate_callback = Konami68000.SaveStateBinary_thndrx2; + loadstate_callback = Konami68000.LoadStateBinary_thndrx2; + break; + case "prmrsocr": + case "prmrsocrj"://k054539 K052109 K053245 eeprom + savestate_callback = Konami68000.SaveStateBinary_prmrsocr; + loadstate_callback = Konami68000.LoadStateBinary_prmrsocr; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + savestate_callback = Capcom.SaveStateBinary_gng; + loadstate_callback = Capcom.LoadStateBinary_gng; + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + savestate_callback = Capcom.SaveStateBinary_sf; + loadstate_callback = Capcom.LoadStateBinary_sf; + break; + } + break; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/State.cs.meta new file mode 100644 index 00000000..354cf2cb --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b921d697bbf8b0b45a45d4a6a8676a0b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Tilemap.cs new file mode 100644 index 00000000..2ebb25c9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Tilemap.cs @@ -0,0 +1,452 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + enum trans_t + { + WHOLLY_TRANSPARENT, + WHOLLY_OPAQUE, + MASKED + } + public struct RECT + { + public int min_x; + public int min_y; + public int max_x; + public int max_y; + } + public unsafe partial class Tmap + { + public int laynum; + public int rows; + public int cols; + public int tilewidth; + public int tileheight; + public int width; + public int height; + public int videoram_offset; + public bool enable; + public byte attributes; + public bool all_tiles_dirty; + public int palette_offset; + public byte priority; + public int scrollrows; + public int scrollcols; + public int[] rowscroll; + public int[] colscroll; + public int dx; + public int dx_flipped; + public int dy; + public int dy_flipped; + public ushort[] pixmap; + public byte[,] flagsmap; + public byte[,] tileflags; + public byte[,] pen_to_flags; + //public byte[] pen_data; + public int mask, value; + public int total_elements; + public Action tile_update3; + public Action tilemap_draw_instance3; + + #region //指针化 pen_data + byte[] pen_data_src; + GCHandle pen_data_handle; + public byte* pen_data; + public int pen_dataLength; + public bool pen_data_IsNull => pen_data == null; + public byte[] pen_data_set + { + set + { + pen_data_handle.ReleaseGCHandle(); + pen_data_src = value; + pen_dataLength = value.Length; + pen_data_src.GetObjectPtr(ref pen_data_handle, ref pen_data); + } + } + #endregion + + public int effective_rowscroll(int index) + { + int value; + if ((attributes & Tilemap.TILEMAP_FLIPY) != 0) + { + index = scrollrows - 1 - index; + } + if ((attributes & Tilemap.TILEMAP_FLIPX) == 0) + { + value = dx - rowscroll[index]; + } + else + { + value = Tilemap.screen_width - width - (dx_flipped - rowscroll[index]); + } + if (value < 0) + { + value = width - (-value) % width; + } + else + { + value %= width; + } + return value; + } + public int effective_colscroll(int index) + { + int value; + if ((attributes & Tilemap.TILEMAP_FLIPX) != 0) + { + index = scrollcols - 1 - index; + } + if ((attributes & Tilemap.TILEMAP_FLIPY) == 0) + { + value = dy - colscroll[index]; + } + else + { + value = Tilemap.screen_height - height - (dy_flipped - colscroll[index]); + } + if (value < 0) + { + value = height - (-value) % height; + } + else + { + value %= height; + } + return value; + } + public void tilemap_set_palette_offset(int offset) + { + palette_offset = offset; + } + public static void tilemap_set_flip(Tmap tmap, byte _attributes) + { + if (tmap == null) + { + foreach (Tmap t1 in Tilemap.lsTmap) + { + if (t1.attributes != _attributes) + { + t1.attributes = _attributes; + } + } + } + else if (tmap.attributes != _attributes) + { + tmap.attributes = _attributes; + tmap.mappings_update(); + } + } + public void get_row_col(int index, out int row, out int col) + { + if ((attributes & Tilemap.TILEMAP_FLIPX) != 0) + { + col = cols - 1 - index % cols; + } + else + { + col = index % cols; + } + if ((attributes & Tilemap.TILEMAP_FLIPY) != 0) + { + row = rows - 1 - index / cols; + } + else + { + row = index / cols; + } + } + public void tilemap_mark_tile_dirty(int row, int col) + { + tileflags[row, col] = Tilemap.TILE_FLAG_DIRTY; + } + public void tilemap_set_scroll_rows(int scroll_rows) + { + scrollrows = scroll_rows; + } + public void tilemap_set_scroll_cols(int scroll_cols) + { + scrollcols = scroll_cols; + } + public void tilemap_set_scrolldx(int _dx, int _dx2) + { + dx = _dx; + dx_flipped = _dx2; + } + public void tilemap_set_scrolldy(int _dy, int _dy2) + { + dy = _dy; + dy_flipped = _dy2; + } + public void tilemap_set_scrollx(int which, int value) + { + if (which < scrollrows) + { + rowscroll[which] = value; + } + } + public void tilemap_set_scrolly(int which, int value) + { + if (which < scrollcols) + { + colscroll[which] = value; + } + } + public RECT sect_rect(RECT dst, RECT src) + { + RECT dst2 = dst; + if (src.min_x > dst.min_x) + { + dst2.min_x = src.min_x; + } + if (src.max_x < dst.max_x) + { + dst2.max_x = src.max_x; + } + if (src.min_y > dst.min_y) + { + dst2.min_y = src.min_y; + } + if (src.max_y < dst.max_y) + { + dst2.max_y = src.max_y; + } + return dst2; + } + public void tilemap_draw_primask(RECT cliprect, int flags, byte _priority) + { + int xpos, ypos; + if (!enable) + { + return; + } + mask = 0x0f | flags; + value = flags; + priority = _priority; + if (all_tiles_dirty) + { + Array.Copy(Tilemap.bbFF, tileflags, cols * rows); + all_tiles_dirty = false; + } + if (scrollrows == 1 && scrollcols == 1) + { + int scrollx = effective_rowscroll(0); + int scrolly = effective_colscroll(0); + for (ypos = scrolly - height; ypos <= cliprect.max_y; ypos += height) + { + for (xpos = scrollx - width; xpos <= cliprect.max_x; xpos += width) + { + tilemap_draw_instance3(cliprect, xpos, ypos); + } + } + } + else if (scrollcols == 1) + { + RECT rect = cliprect; + int rowheight = height / scrollrows; + int scrolly = effective_colscroll(0); + int currow, nextrow; + for (ypos = scrolly - height; ypos <= cliprect.max_y; ypos += height) + { + int firstrow = Math.Max((cliprect.min_y - ypos) / rowheight, 0); + int lastrow = Math.Min((cliprect.max_y - ypos) / rowheight, scrollrows - 1); + for (currow = firstrow; currow <= lastrow; currow = nextrow) + { + int scrollx = effective_rowscroll(currow); + for (nextrow = currow + 1; nextrow <= lastrow; nextrow++) + { + if (effective_rowscroll(nextrow) != scrollx) + { + break; + } + } + rect.min_y = currow * rowheight + ypos; + rect.max_y = nextrow * rowheight - 1 + ypos; + rect = sect_rect(rect, cliprect); + for (xpos = scrollx - width; xpos <= cliprect.max_x; xpos += width) + { + tilemap_draw_instance3(rect, xpos, ypos); + } + } + } + } + else if (scrollrows == 1) + { + int i1 = 1; + } + } + public void mappings_update() + { + all_tiles_dirty = true; + } + } + public unsafe class Tilemap + { + public static List lsTmap = new List(); + public static byte[,] priority_bitmap; + public static byte[,] bb00, bbFF; + //public static byte[] bb0F; + public static int screen_width, screen_height; + private static int INVALID_LOGICAL_INDEX = -1; + public static byte TILEMAP_PIXEL_TRANSPARENT = 0x00; + private static byte TILEMAP_PIXEL_CATEGORY_MASK = 0x0f; /* category is stored in the low 4 bits */ + public static byte TILE_FLAG_DIRTY = 0xff; + public static byte TILEMAP_PIXEL_LAYER0 = 0x10; + public static byte TILE_FLIPX = 0x01; /* draw this tile horizontally flipped */ + public static byte TILE_FLIPY = 0x02; /* draw this tile vertically flipped */ + public static byte TILEMAP_FLIPX = TILE_FLIPX; /* draw the tilemap horizontally flipped */ + public static byte TILEMAP_FLIPY = TILE_FLIPY; /* draw the tilemap vertically flipped */ + + #region //指针化 bb0F + static byte[] bb0F_src; + static GCHandle bb0F_handle; + public static byte* bb0F; + public static int bb0FLength; + public static bool bb0F_IsNull => bb0F == null; + public static byte[] bb0F_set + { + set + { + bb0F_handle.ReleaseGCHandle(); + bb0F_src = value; + bb0FLength = value.Length; + bb0F_src.GetObjectPtr(ref bb0F_handle, ref bb0F); + } + } + #endregion + + public static void tilemap_init() + { + int i, j; + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + CPS.tilemap_init(); + break; + case "Data East": + screen_width = 0x100; + screen_height = 0x100; + Dataeast.tilemap_init(); + break; + case "Tehkan": + screen_width = 0x100; + screen_height = 0x100; + Tehkan.tilemap_init(); + break; + case "Namco System 1": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + Namcos1.tilemap_init(); + break; + case "PGM": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + PGM.tilemap_init(); + break; + case "M72": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + M72.tilemap_init(); + break; + case "M92": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + M92.tilemap_init(); + break; + case "Taito": + screen_width = 0x140; + screen_height = 0x100; + priority_bitmap = new byte[0x100, 0x140]; + Taito.tilemap_init(); + break; + case "Taito B": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + Taitob.tilemap_init(); + break; + case "Konami 68000": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + Konami68000.tilemap_init(); + break; + case "Capcom": + screen_width = 0x200; + screen_height = 0x200; + priority_bitmap = new byte[0x200, 0x200]; + Capcom.tilemap_init(); + break; + } + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + case "Data East": + case "Tehkan": + case "Namco System 1": + case "PGM": + case "M72": + case "Taito": + case "Taito B": + case "Konami 68000": + bb0F_set = new byte[0x400]; + bbFF = new byte[0x80, 0x40]; + for (i = 0; i < 0x80; i++) + { + for (j = 0; j < 0x40; j++) + { + bbFF[i, j] = 0xff; + } + } + for (i = 0; i < 0x400; i++) + { + bb0F[i] = 0x0f; + } + break; + case "M92": + screen_height = 0x100; + bbFF = new byte[0x80, 0x40]; + bb00 = new byte[0x200, 0x200]; + for (i = 0; i < 0x200; i++) + { + for (j = 0; j < 0x200; j++) + { + bb00[i, j] = 0; + } + } + for (i = 0; i < 0x80; i++) + { + for (j = 0; j < 0x40; j++) + { + bbFF[i, j] = 0xff; + } + } + break; + case "Capcom": + bbFF = new byte[0x800, 0x10]; + for (i = 0; i < 0x800; i++) + { + for (j = 0; j < 0x10; j++) + { + bbFF[i, j] = 0xff; + } + } + break; + } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Tilemap.cs.meta new file mode 100644 index 00000000..eeeb4cc0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf267c143f4dd3148aecfec0b1547f32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Video.cs new file mode 100644 index 00000000..9397fb74 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Video.cs @@ -0,0 +1,1127 @@ +using MAME.Core; +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public struct screen_state + { + public int width; /* current width (HTOTAL) */ + public int height; /* current height (VTOTAL) */ + public RECT visarea; /* current visible area (HBLANK end/start, VBLANK end/start) */ + public int last_partial_scan; /* scanline of last partial update */ + public long frame_period; /* attoseconds per frame */ + public long vblank_period; /* attoseconds per VBLANK period */ + public long scantime; /* attoseconds per scanline */ + public long pixeltime; /* attoseconds per pixel */ + public Atime vblank_start_time; + public Atime vblank_end_time; + public long frame_number; + }; + unsafe partial class Video + { + public static bool flip_screen_x, flip_screen_y; + public static long frame_number_obj; + public static Atime frame_update_time; + public static screen_state screenstate; + public static int video_attributes; + private static int PAUSED_REFRESH_RATE = 30, VIDEO_UPDATE_AFTER_VBLANK = 4; + public static EmuTimer.emu_timer vblank_begin_timer, vblank_end_timer; + public static EmuTimer.emu_timer scanline0_timer, scanline_timer; + private static Atime speed_last_emutime, overall_emutime; + private static long speed_last_realtime, overall_real_ticks; + private static double speed_percent; + private static uint throttle_history, overall_valid_counter, overall_real_seconds; + private static int[] popcount; + //public static ushort[][] bitmapbase; + //public static int[][] bitmapbaseN; + //public static int[] bitmapcolor; + + /** bitmapcolor的指针管理 **/ + public static ushort[][] bitmapbase; //还有 部分 Array.Copy 在引用 + static GCHandle[] bitmapbase_handles; + public static ushort*[] bitmapbase_Ptrs; + /** end **/ + + /** bitmapbaseN的指针管理 **/ + public static int[][] bitmapbaseN; //还有 部分 Array.Copy 在引用 + static GCHandle[] bitmapbaseN_handles; + public static int*[] bitmapbaseN_Ptrs; + /** end **/ + + /** bitmapcolor的指针管理 **/ + //不再拷贝完整画布 + //public static int[] bitmapcolor; + //static GCHandle bitmapcolor_handle; + //public static IntPtr bitmapcolor_Ptr; + + public static int[] bitmapcolorRect; + static GCHandle bitmapcolorRect_handle; + public static IntPtr bitmapcolorRect_Ptr; + public static int* bitmapcolorRect_Ptrunsafe; + /** end **/ + + public static int fullwidth, fullheight; + public static bool global_throttle; + public static int scanline_param; + public static RECT new_clip; + public static int curbitmap; + public static string sDrawText; + public static long popup_text_end; + public static int iMode, nMode; + //private static BitmapData bitmapData; + public static int offsetx, offsety, width, height; + public delegate void video_delegate(); + public static video_delegate video_update_callback, video_eof_callback; + private static int NEOGEO_HBEND = 0x01e;//30 /* this should really be 29.5 */ + private static int NEOGEO_HBSTART = 0x15e;//350 /* this should really be 349.5 */ + private static int NEOGEO_VTOTAL = 0x108;//264 + private static int NEOGEO_VBEND = 0x010; + private static int NEOGEO_VBSTART = 0x0f0;//240 + private static int NEOGEO_VBLANK_RELOAD_HPOS = 0x11f;//287 + + + #region 抽象出去 + static Action Act_SubmitVideo; + + public static void BindFunc(IVideoPlayer Ivp) + { + Act_SubmitVideo -= Act_SubmitVideo; + + Act_SubmitVideo += Ivp.SubmitVideo; + } + + static void SubmitVideo(int[] Bitmap, long frame_number) + { + Act_SubmitVideo.Invoke(Bitmap, frame_number); + } + #endregion + + public static void video_init() + { + Wintime.wintime_init(); + global_throttle = true; + Motion.motion_handler_callback = Motion.handler_ingame; + sDrawText = ""; + popup_text_end = 0; + popcount = new int[256]{ + 0,1,1,2,1,2,2,3, 1,2,2,3,2,3,3,4, 1,2,2,3,2,3,3,4, 2,3,3,4,3,4,4,5, + 1,2,2,3,2,3,3,4, 2,3,3,4,3,4,4,5, 2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6, + 1,2,2,3,2,3,3,4, 2,3,3,4,3,4,4,5, 2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6, + 2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6, 3,4,4,5,4,5,5,6, 4,5,5,6,5,6,6,7, + 1,2,2,3,2,3,3,4, 2,3,3,4,3,4,4,5, 2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6, + 2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6, 3,4,4,5,4,5,5,6, 4,5,5,6,5,6,6,7, + 2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6, 3,4,4,5,4,5,5,6, 4,5,5,6,5,6,6,7, + 3,4,4,5,4,5,5,6, 4,5,5,6,5,6,6,7, 4,5,5,6,5,6,6,7, 5,6,6,7,6,7,7,8 + }; + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + screenstate.width = 0x200; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0x1ff; + screenstate.visarea.min_y = 0; + screenstate.visarea.max_y = 0x1ff; + fullwidth = 0x200; + fullheight = 0x200; + frame_update_time = new Atime(0, (long)(1e18 / 59.61));//59.61Hz + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updateC; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x200]; + bitmapbase[1] = new ushort[0x200 * 0x200]; + video_update_callback = CPS.video_update_cps1; + video_eof_callback = CPS.video_eof_cps1; + break; + case "CPS2": + screenstate.width = 0x200; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0x1ff; + screenstate.visarea.min_y = 0; + screenstate.visarea.max_y = 0x1ff; + fullwidth = 0x200; + fullheight = 0x200; + frame_update_time = new Atime(0, (long)(1e18 / 8000000) * 512 * 262);//59.637404580152669Hz + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updateC; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x200]; + bitmapbase[1] = new ushort[0x200 * 0x200]; + video_update_callback = CPS.video_update_cps1; + video_eof_callback = CPS.video_eof_cps1; + break; + case "Data East": + screenstate.width = 0x100; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0xff; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + fullwidth = 0x100; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updateC; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x100 * 0x100]; + bitmapbase[1] = new ushort[0x100 * 0x100]; + video_update_callback = Dataeast.video_update_pcktgal; + video_eof_callback = Dataeast.video_eof_pcktgal; + switch (Machine.sName) + { + case "pcktgal": + case "pcktgalb": + case "pcktgal2": + case "pcktgal2j": + case "spool3": + case "spool3i": + Dataeast.palette_init_pcktgal(Dataeast.prom); + break; + } + break; + case "Tehkan": + screenstate.width = 0x100; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0xff; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + fullwidth = 0x100; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updateTehkan; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x100 * 0x100]; + bitmapbase[1] = new ushort[0x100 * 0x100]; + video_update_callback = Tehkan.video_update_pbaction; + video_eof_callback = Tehkan.video_eof_pbaction; + break; + case "Neo Geo": + screenstate.width = 384; + screenstate.height = 264; + screenstate.visarea.min_x = NEOGEO_HBEND;//30 + screenstate.visarea.max_x = NEOGEO_HBSTART - 1;//349 + screenstate.visarea.min_y = NEOGEO_VBEND;//16 + screenstate.visarea.max_y = NEOGEO_VBSTART - 1;//239 + fullwidth = 384; + fullheight = 264; + frame_update_time = new Atime(0, (long)(1e18 / 6000000) * screenstate.width * screenstate.height);//59.1856060608428Hz + screenstate.vblank_period = (long)(1e18 / 6000000) * 384 * (264 - 224); + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updateN; + bitmapbaseN = new int[2][]; + bitmapbaseN[0] = new int[384 * 264]; + bitmapbaseN[1] = new int[384 * 264]; + video_update_callback = Neogeo.video_update_neogeo; + video_eof_callback = Neogeo.video_eof_neogeo; + break; + case "SunA8": + screenstate.width = 0x100; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.min_x = 0xff; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + fullwidth = 0x100; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = (long)(1e12 * 2500); + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x100 * 0x100]; + bitmapbase[1] = new ushort[0x100 * 0x100]; + video_update_callback = SunA8.video_update_suna8; + video_eof_callback = SunA8.video_eof_suna8; + break; + case "Namco System 1": + screenstate.width = 0x200; + screenstate.height = 0x200; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0x1ff; + screenstate.visarea.min_y = 0; + screenstate.visarea.max_y = 0x1ff; + fullwidth = 0x200; + fullheight = 0x200; + frame_update_time = new Atime(0, (long)(1e18 / 60.606060)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updateNa; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x200]; + bitmapbase[1] = new ushort[0x200 * 0x200]; + video_update_callback = Namcos1.video_update_namcos1; + video_eof_callback = Namcos1.video_eof_namcos1; + break; + case "IGS011": + screenstate.width = 0x200; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0x1ff; + screenstate.visarea.min_y = 0; + screenstate.visarea.max_y = 0xef; + fullwidth = 0x200; + fullheight = 0x200; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updateIGS011; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x200]; + bitmapbase[1] = new ushort[0x200 * 0x200]; + video_update_callback = IGS011.video_update_igs011; + video_eof_callback = IGS011.video_eof_igs011; + break; + case "PGM": + screenstate.width = 0x200; + screenstate.height = 0x200; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0x1bf; + screenstate.visarea.min_y = 0; + screenstate.visarea.max_y = 0xdf; + fullwidth = 0x200; + fullheight = 0x200; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x200]; + bitmapbase[1] = new ushort[0x200 * 0x200]; + video_update_callback = PGM.video_update_pgm; + video_eof_callback = PGM.video_eof_pgm; + break; + case "M72": + screenstate.width = 0x200; + screenstate.height = 0x11c; + screenstate.visarea.min_x = 0x40; + screenstate.visarea.max_x = 0x1bf; + screenstate.visarea.min_y = 0; + screenstate.visarea.max_y = 0xff; + fullwidth = 0x200; + fullheight = 0x200; + frame_update_time = new Atime(0, (long)(1e18 / 8000000) * screenstate.width * screenstate.height); + screenstate.vblank_period = (long)(1e18 / 8000000) * 512 * (284 - 256); + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x200];//0x11c + bitmapbase[1] = new ushort[0x200 * 0x200];//0x11c + video_update_callback = M72.video_update_m72; + video_eof_callback = M72.video_eof_m72; + break; + case "M92": + screenstate.width = 0x200; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0x50; + screenstate.visarea.max_x = 0x18f; + screenstate.visarea.min_y = 0x8; + screenstate.visarea.max_y = 0xf7; + fullwidth = 0x200; + fullheight = 0x200; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x200]; + bitmapbase[1] = new ushort[0x200 * 0x200]; + video_update_callback = M92.video_update_m92; + video_eof_callback = M92.video_eof_m92; + break; + case "Taito": + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + screenstate.width = 0x100; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 255; + screenstate.visarea.min_y = 16; + screenstate.visarea.max_y = 240 - 1; + fullwidth = 0x100; + fullheight = 0x100; + frame_update_time = new Atime(0, 0x003c372a18883411); + screenstate.vblank_period = 0;// (long)(1e18 * 0.00256); + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x100 * 0x100]; + bitmapbase[1] = new ushort[0x100 * 0x100]; + video_update_callback = Taito.video_update_bublbobl; + video_eof_callback = Taito.video_eof_taito; + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + screenstate.width = 0x140; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0x13f; + screenstate.visarea.min_y = 8; + screenstate.visarea.max_y = 0xf7; + fullwidth = 0x140; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0;// (long)(1e18 * 0.00256); + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x140 * 0x100]; + bitmapbase[1] = new ushort[0x140 * 0x100]; + video_update_callback = Taito.video_update_opwolf; + video_eof_callback = Taito.video_eof_taito; + break; + } + break; + case "Taito B": + screenstate.width = 0x200; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0;//0 + screenstate.visarea.max_x = 320 - 1;//319 + screenstate.visarea.min_y = 16;//16 + screenstate.visarea.max_y = 240 - 1;//239 + fullwidth = 0x200; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x100]; + bitmapbase[1] = new ushort[0x200 * 0x100]; + video_update_callback = Taitob.video_update_taitob; + video_eof_callback = Taitob.video_eof_taitob; + break; + case "Konami 68000": + screenstate.width = 0x200; + screenstate.height = 0x100; + fullwidth = 0x200; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = (long)(1e12 * 2500); + video_attributes = 0x34; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x100]; + bitmapbase[1] = new ushort[0x200 * 0x100]; + video_eof_callback = Konami68000.video_eof; + switch (Machine.sName) + { + case "cuebrick": + screenstate.visarea.min_x = 0x68; + screenstate.visarea.max_x = 0x197; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_update_callback = Konami68000.video_update_mia; + break; + case "mia": + case "mia2": + screenstate.visarea.min_x = 0x68; + screenstate.visarea.max_x = 0x197; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_attributes = 0x30; + video_update_callback = Konami68000.video_update_mia; + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + screenstate.visarea.min_x = 0x60; + screenstate.visarea.max_x = 0x19f; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_attributes = 0x30; + video_update_callback = Konami68000.video_update_mia; + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + screenstate.visarea.min_x = 0x70; + screenstate.visarea.max_x = 0x18f; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_update_callback = Konami68000.video_update_punkshot; + break; + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + screenstate.visarea.min_x = 0x60; + screenstate.visarea.max_x = 0x19f; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_update_callback = Konami68000.video_update_lgtnfght; + break; + case "blswhstl": + case "blswhstla": + case "detatwin": + screenstate.visarea.min_x = 0x60; + screenstate.visarea.max_x = 0x19f; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_update_callback = Konami68000.video_update_lgtnfght; + video_eof_callback = Konami68000.video_eof_blswhstl; + break; + case "glfgreat": + case "glfgreatj": + case "prmrsocr": + case "prmrsocrj": + screenstate.visarea.min_x = 0x70; + screenstate.visarea.max_x = 0x18f; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_update_callback = Konami68000.video_update_glfgreat; + break; + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + screenstate.visarea.min_x = 0x68; + screenstate.visarea.max_x = 0x197; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_update_callback = Konami68000.video_update_tmnt2; + break; + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + screenstate.visarea.min_x = 0x70; + screenstate.visarea.max_x = 0x18f; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_update_callback = Konami68000.video_update_tmnt2; + break; + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + screenstate.visarea.min_x = 0x70; + screenstate.visarea.max_x = 0x18f; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + video_attributes = 0x30; + video_update_callback = Konami68000.video_update_thndrx2; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + screenstate.width = 0x100; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0; + screenstate.visarea.max_x = 0xff; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + fullwidth = 0x100; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x100 * 0x100]; + bitmapbase[1] = new ushort[0x100 * 0x100]; + video_update_callback = Capcom.video_update_gng; + video_eof_callback = Capcom.video_eof_gng; + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + screenstate.width = 0x200; + screenstate.height = 0x100; + screenstate.visarea.min_x = 0x40; + screenstate.visarea.max_x = 0x1bf; + screenstate.visarea.min_y = 0x10; + screenstate.visarea.max_y = 0xef; + fullwidth = 0x200; + fullheight = 0x100; + frame_update_time = new Atime(0, (long)(1e18 / 60)); + screenstate.vblank_period = 0; + video_attributes = 0; + Motion.motion_update_callback = Motion.ui_updatePGM; + bitmapbase = new ushort[2][]; + bitmapbase[0] = new ushort[0x200 * 0x100]; + bitmapbase[1] = new ushort[0x200 * 0x100]; + video_update_callback = Capcom.video_update_sf; + video_eof_callback = Capcom.video_eof; + break; + } + break; + } + screenstate.frame_period = frame_update_time.attoseconds; + screenstate.scantime = screenstate.frame_period / screenstate.height; + screenstate.pixeltime = screenstate.frame_period / (screenstate.height * screenstate.width); + screenstate.frame_number = 0; + + + /** bitmapbase的指针管理 **/ + // 释放句柄 + if (bitmapbase_handles != null) + { + for (int i = 0; i < bitmapbase_handles.Length; i++) + { + if (bitmapbase_handles[i].IsAllocated) + bitmapbase_handles[i].Free(); + } + bitmapbase_handles = null; + bitmapbase_Ptrs = null; + } + + if (bitmapbase != null) + { + bitmapbase_handles = new GCHandle[bitmapbase.Length]; + bitmapbase_Ptrs = new ushort*[bitmapbase.Length]; + for (int i = 0; i < bitmapbase.Length; i++) + { + bitmapbase_handles[i] = GCHandle.Alloc(bitmapbase[i], GCHandleType.Pinned); + bitmapbase_Ptrs[i] = (ushort*)bitmapbase_handles[i].AddrOfPinnedObject(); + } + } + + + if (bitmapbaseN_handles != null) + { + for (int i = 0; i < bitmapbaseN_handles.Length; i++) + { + if (bitmapbaseN_handles[i].IsAllocated) + bitmapbaseN_handles[i].Free(); + } + bitmapbaseN_handles = null; + bitmapbaseN_Ptrs = null; + } + + if (bitmapbaseN != null) + { + bitmapbaseN_handles = new GCHandle[bitmapbaseN.Length]; + bitmapbaseN_Ptrs = new int*[bitmapbaseN.Length]; + for (int i = 0; i < bitmapbaseN.Length; i++) + { + bitmapbaseN_handles[i] = GCHandle.Alloc(bitmapbaseN[i], GCHandleType.Pinned); + bitmapbaseN_Ptrs[i] = (int*)bitmapbaseN_handles[i].AddrOfPinnedObject(); + } + } + + /** end **/ + + //bitmapcolor = new int[Video.fullwidth * Video.fullheight]; + /** bitmapcolor的指针管理 **/ + //不再拷贝完整画布 + //if (bitmapcolor != null) + //{ + // // 释放句柄 + // if (bitmapcolor_handle.IsAllocated) + // { + // bitmapcolor_handle.Free(); + // } + //} + //bitmapcolor = new int[Video.fullwidth * Video.fullheight]; + //// 固定数组,防止垃圾回收器移动它 + //bitmapcolor_handle = GCHandle.Alloc(bitmapcolor, GCHandleType.Pinned); + //// 获取数组的指针 + //bitmapcolor_Ptr = bitmapcolor_handle.AddrOfPinnedObject(); + + + + + // 释放句柄 + if (bitmapcolorRect != null && bitmapcolorRect_handle.IsAllocated) + bitmapcolorRect_handle.Free(); + + bitmapcolorRect = new int[width * height]; + // 固定数组,防止垃圾回收器移动它 + bitmapcolorRect_handle = GCHandle.Alloc(bitmapcolorRect, GCHandleType.Pinned); + // 获取数组的指针 + bitmapcolorRect_Ptr = bitmapcolorRect_handle.AddrOfPinnedObject(); + + bitmapcolorRect_Ptrunsafe = (int*)bitmapcolorRect_Ptr; + /** end **/ + + + + + + vblank_begin_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Video_vblank_begin_callback, false); + EmuTimer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER); + scanline0_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Video_scanline0_callback, false); + EmuTimer.timer_adjust_periodic(scanline0_timer, video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + vblank_end_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Video_vblank_end_callback, false); + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "Namco System 1": + case "M92": + case "Taito B": + break; + case "CPS2": + Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 262); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + case "Tehkan": + Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 2); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + case "Neo Geo": + break; + case "SunA8": + Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 0x100); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger2, false); + break; + case "IGS011": + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + case "lhb2": + Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 5); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + } + break; + case "M72": + Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 128); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + case "Taito": + switch (Machine.sName) + { + case "bub68705": + Cpuexec.cpu[3].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 2); + Cpuexec.cpu[3].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + } + break; + case "Konami 68000": + switch (Machine.sName) + { + case "cuebrick": + Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 10); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); + break; + } + break; + } + screenstate.vblank_start_time = Attotime.ATTOTIME_ZERO; + screenstate.vblank_end_time = new Atime(0, screenstate.vblank_period); + } + public static void video_screen_configure(int width, int height, RECT visarea, long frame_period) + { + screenstate.width = width; + screenstate.height = height; + screenstate.visarea = visarea; + //realloc_screen_bitmaps(screen); + screenstate.frame_period = frame_period; + screenstate.scantime = frame_period / height; + screenstate.pixeltime = frame_period / (height * width); + /*if (config->vblank == 0 && !config->oldstyle_vblank_supplied) + state->vblank_period = state->scantime * (height - (visarea->max_y + 1 - visarea->min_y)); + else + state->vblank_period = config->vblank; + if (video_screen_get_vpos(screen) == 0) + timer_adjust_oneshot(state->scanline0_timer, attotime_zero, 0); + else + timer_adjust_oneshot(state->scanline0_timer, video_screen_get_time_until_pos(screen, 0, 0), 0); + timer_adjust_oneshot(state->vblank_begin_timer, video_screen_get_time_until_vblank_start(screen), 0); + update_refresh_speed(screen->machine);*/ + } + public static bool video_screen_update_partial(int scanline) + { + new_clip = screenstate.visarea; + bool result = false; + if (screenstate.last_partial_scan > new_clip.min_y) + { + new_clip.min_y = screenstate.last_partial_scan; + } + if (scanline < new_clip.max_y) + { + new_clip.max_y = scanline; + } + if (new_clip.min_y <= new_clip.max_y) + { + video_update_callback(); + result = true; + } + screenstate.last_partial_scan = scanline + 1; + return result; + } + public static int video_screen_get_vpos() + { + long delta = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(EmuTimer.get_current_time(), screenstate.vblank_start_time)); + int vpos; + delta += screenstate.pixeltime / 2; + vpos = (int)(delta / screenstate.scantime); + return (screenstate.visarea.max_y + 1 + vpos) % screenstate.height; + } + public static bool video_screen_get_vblank() + { + return (Attotime.attotime_compare(EmuTimer.get_current_time(), screenstate.vblank_end_time) < 0); + } + public static Atime video_screen_get_time_until_pos(int vpos, int hpos) + { + long curdelta = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(EmuTimer.get_current_time(), screenstate.vblank_start_time)); + long targetdelta; + vpos += screenstate.height - (screenstate.visarea.max_y + 1); + vpos %= screenstate.height; + targetdelta = vpos * screenstate.scantime + hpos * screenstate.pixeltime; + if (targetdelta <= curdelta + screenstate.pixeltime / 2) + targetdelta += screenstate.frame_period; + while (targetdelta <= curdelta) + targetdelta += screenstate.frame_period; + return new Atime(0, targetdelta - curdelta); + } + public static Atime video_screen_get_time_until_vblank_start() + { + return video_screen_get_time_until_pos(Video.screenstate.visarea.max_y + 1, 0); + } + public static Atime video_screen_get_time_until_vblank_end() + { + Atime ret; + Atime current_time = EmuTimer.get_current_time(); + if (video_screen_get_vblank()) + { + ret = Attotime.attotime_sub(screenstate.vblank_end_time, current_time); + } + else + { + ret = Attotime.attotime_sub(Attotime.attotime_add_attoseconds(screenstate.vblank_end_time, screenstate.frame_period), current_time); + } + return ret; + } + private static bool effective_throttle() + { + // if (mame_is_paused(machine) || ui_is_menu_active()) + // return true; + // if (global.fastforward) + // return false; + return global_throttle; + } + public static void vblank_begin_callback() + { + screenstate.vblank_start_time = EmuTimer.global_basetime;// Timer.get_current_time(); + screenstate.vblank_end_time = Attotime.attotime_add_attoseconds(screenstate.vblank_start_time, screenstate.vblank_period); + Cpuexec.on_vblank(); + //垂直同步 + if ((video_attributes & VIDEO_UPDATE_AFTER_VBLANK) == 0) + { + video_frame_update(); + } + EmuTimer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER); + if (screenstate.vblank_period == 0) + { + vblank_end_callback(); + } + else + { + EmuTimer.timer_adjust_periodic(vblank_end_timer, video_screen_get_time_until_vblank_end(), Attotime.ATTOTIME_NEVER); + } + } + public static void vblank_end_callback() + { + int i; + //垂直同步 + if ((video_attributes & VIDEO_UPDATE_AFTER_VBLANK) != 0) + { + video_frame_update(); + } + } + public static void scanline0_callback() + { + screenstate.last_partial_scan = 0; + EmuTimer.timer_adjust_periodic(scanline0_timer, video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + } + public static void scanline_update_callback() + { + int scanline = scanline_param; + video_screen_update_partial(scanline); + scanline++; + if (scanline > screenstate.visarea.max_y) + { + scanline = screenstate.visarea.min_y; + } + scanline_param = scanline; + EmuTimer.timer_adjust_periodic(scanline_timer, video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + } + public static void video_frame_update() + { + Atime current_time = EmuTimer.global_basetime; + if (!Mame.paused) + { + finish_screen_updates(); + } + Keyboard.Update(); + Mouse.Update(); + Inptport.frame_update_callback(); + Motion.ui_update_and_render(); + //if (Machine.mainMotion.cheatmotion.lockState == CheatMotion.LockState.LOCK_FRAME) + //{ + // Machine.mainMotion.cheatmotion.ApplyCheat(); + //} + GDIDraw(); + + if (effective_throttle()) + { + //不执行该函数,避免Thread.Sleep (暂时确认无逻辑依赖) + //废弃 + //update_throttle(current_time); + } + + Window.osd_update(false); + //UI.ui_input_frame_update(); + recompute_speed(current_time); + if (Mame.paused) + { + //Thread.Sleep(5); + } + else + { + video_eof_callback(); + } + } + private static void finish_screen_updates() + { + video_screen_update_partial(screenstate.visarea.max_y); + curbitmap = 1 - curbitmap; + } + //废弃 + //private static void update_throttle(Atime emutime) + //{ + // long real_delta_attoseconds; + // long emu_delta_attoseconds; + // long real_is_ahead_attoseconds; + // long attoseconds_per_tick; + // long ticks_per_second; + // long target_ticks; + // long diff_ticks; + // ticks_per_second = Wintime.ticks_per_second; + // attoseconds_per_tick = Attotime.ATTOSECONDS_PER_SECOND / ticks_per_second; + // if (Mame.mame_is_paused()) + // { + // throttle_emutime = Attotime.attotime_sub_attoseconds(emutime, Attotime.ATTOSECONDS_PER_SECOND / PAUSED_REFRESH_RATE); + // throttle_realtime = throttle_emutime; + // } + // emu_delta_attoseconds = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(emutime, throttle_emutime)); + // if (emu_delta_attoseconds < 0 || emu_delta_attoseconds > Attotime.ATTOSECONDS_PER_SECOND / 10) + // { + // goto resync; + // } + // diff_ticks = Wintime.osd_ticks() - throttle_last_ticks; + // throttle_last_ticks += diff_ticks; + // if (diff_ticks >= ticks_per_second) + // { + // goto resync; + // } + // real_delta_attoseconds = diff_ticks * attoseconds_per_tick; + // throttle_emutime = emutime; + // throttle_realtime = Attotime.attotime_add_attoseconds(throttle_realtime, real_delta_attoseconds); + // throttle_history = (throttle_history << 1) | Convert.ToUInt32(emu_delta_attoseconds > real_delta_attoseconds); + // real_is_ahead_attoseconds = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(throttle_emutime, throttle_realtime)); + // if ((real_is_ahead_attoseconds < -Attotime.ATTOSECONDS_PER_SECOND / 10) || (real_is_ahead_attoseconds < 0 && popcount[throttle_history & 0xff] < 6)) + // { + // goto resync; + // } + // if (real_is_ahead_attoseconds < 0) + // { + // return; + // } + // target_ticks = throttle_last_ticks + real_is_ahead_attoseconds / attoseconds_per_tick; + // diff_ticks = throttle_until_ticks(target_ticks) - throttle_last_ticks; + // throttle_last_ticks += diff_ticks; + // throttle_realtime = Attotime.attotime_add_attoseconds(throttle_realtime, diff_ticks * attoseconds_per_tick); + // return; + //resync: + // throttle_realtime = throttle_emutime = emutime; + //} + //废弃 + //private static long throttle_until_ticks(long target_ticks) + //{ + // long minimum_sleep = Wintime.ticks_per_second / 1000; + // long current_ticks = Wintime.osd_ticks(); + // long new_ticks; + // while (current_ticks < target_ticks) + // { + // long delta; + // bool slept = false; + // delta = (target_ticks - current_ticks) * 1000 / (1000 + average_oversleep); + // if (delta >= minimum_sleep) + // { + // Wintime.osd_sleep(delta); + // slept = true; + // } + // new_ticks = Wintime.osd_ticks(); + // if (slept) + // { + // long actual_ticks = new_ticks - current_ticks; + // if (actual_ticks > delta) + // { + // long oversleep_milliticks = 1000 * (actual_ticks - delta) / delta; + // average_oversleep = (average_oversleep * 99 + oversleep_milliticks) / 100; + + // } + // } + // current_ticks = new_ticks; + // } + // return current_ticks; + //} + private static void recompute_speed(Atime emutime) + { + long delta_emutime; + if (speed_last_realtime == 0 || Mame.mame_is_paused()) + { + speed_last_realtime = Wintime.osd_ticks(); + speed_last_emutime = emutime; + } + delta_emutime = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(emutime, speed_last_emutime)); + if (delta_emutime > Attotime.ATTOSECONDS_PER_SECOND / 4) + { + long realtime = Wintime.osd_ticks(); + long delta_realtime = realtime - speed_last_realtime; + long tps = Wintime.ticks_per_second; + speed_percent = (double)delta_emutime * (double)tps / ((double)delta_realtime * (double)Attotime.ATTOSECONDS_PER_SECOND); + speed_last_realtime = realtime; + speed_last_emutime = emutime; + overall_valid_counter++; + if (overall_valid_counter >= 4) + { + overall_real_ticks += delta_realtime; + while (overall_real_ticks >= tps) + { + overall_real_ticks -= tps; + overall_real_seconds++; + } + overall_emutime = Attotime.attotime_add_attoseconds(overall_emutime, delta_emutime); + } + } + } + public static void flip_screen_set_no_update(bool on) + { + flip_screen_x = on; + } + public static bool flip_screen_get() + { + return flip_screen_x; + } + public static void SaveStateBinary(BinaryWriter writer) + { + writer.Write(scanline_param); + writer.Write(screenstate.last_partial_scan); + writer.Write(screenstate.vblank_start_time.seconds); + writer.Write(screenstate.vblank_start_time.attoseconds); + writer.Write(screenstate.vblank_end_time.seconds); + writer.Write(screenstate.vblank_end_time.attoseconds); + writer.Write(screenstate.frame_number); + } + public static void LoadStateBinary(BinaryReader reader) + { + scanline_param = reader.ReadInt32(); + screenstate.last_partial_scan = reader.ReadInt32(); + screenstate.vblank_start_time.seconds = reader.ReadInt32(); + screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); + screenstate.vblank_end_time.seconds = reader.ReadInt32(); + screenstate.vblank_end_time.attoseconds = reader.ReadInt64(); + screenstate.frame_number = reader.ReadInt64(); + } + } + +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Video.cs.meta new file mode 100644 index 00000000..1b5104c7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a59d0bc00ac6b764a9c70fd6c770958f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/VideoSubmit.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/VideoSubmit.cs new file mode 100644 index 00000000..53205c5a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/VideoSubmit.cs @@ -0,0 +1,177 @@ +using System; + +namespace MAME.Core +{ + partial class Video + { + //public delegate Bitmap drawcrosshairdelegate(Bitmap bm1); + //public static drawcrosshairdelegate drawcrosshair; + + + public delegate int[] drawcrosshairdelegate(int[] bm1); + public static drawcrosshairdelegate drawcrosshair; + + //public static Bitmap drawcrosshair_null(Bitmap bm1) + //{ + // Bitmap bm2 = bm1; + // return bm2; + //} + + public static int[] drawcrosshair_null(int[] bm1) + { + return bm1; + } + //public static Bitmap drawcrosshair_opwolf(Bitmap bm1) + //{ + // Bitmap bm2 = bm1; + // Graphics g = Graphics.FromImage(bm2); + // g.DrawImage(MultiplyAlpha(Crosshair.global.bitmap[0], (float)Crosshair.global.fade / 0xff), new Rectangle(Crosshair.global.x[0] - 10, Crosshair.global.y[0] - 10, 20, 20), new Rectangle(0, 0, 100, 100), GraphicsUnit.Pixel); + // g.Dispose(); + // return bm2; + //} + + public static int[] drawcrosshair_opwolf(int[] bm1) + { + int[] bm2 = bm1; + //TODO + return bm2; + } + + /* 替换代码 + * public static Bitmap MultiplyAlpha(Bitmap bitmap, float factor) + { + Bitmap result = new Bitmap(bitmap.Width, bitmap.Height); + using (Graphics graphics = Graphics.FromImage(result)) + { + ColorMatrix colorMatrix = new ColorMatrix(); + colorMatrix.Matrix33 = factor; + ImageAttributes imageAttributes = new ImageAttributes(); + imageAttributes.SetColorMatrix(colorMatrix); + graphics.DrawImage(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height), 0, 0, bitmap.Width, bitmap.Height, GraphicsUnit.Pixel, imageAttributes); + } + return result; + }*/ + + + ///// + ///// + ///// + ///// + ///// + ///// + //public static int[] MultiplyAlpha(int[] bitmap, float factor) + //{ + // int[] result = (int[])bitmap.Clone(); + // for (int i = 0; i < result.Length; i++) + // { + // Color originalColor = AxiColor.FromArgb(result[i]); + // byte newAlpha = (byte)Math.Min(255, (int)(originalColor.a * factor)); + // Color newColor = new Color + // { + // r = originalColor.r, + // g = originalColor.g, + // b = originalColor.b, + // a = newAlpha + // }; + // result[i] = AxiColor.ToArgb(newColor); + // } + // return result; + //} + + //public static void GDIDraw() + //{ + // try + // { + // bitmapData = bitmapGDI.LockBits(new Rectangle(0, 0, Video.fullwidth, Video.fullheight), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); + // Marshal.Copy(Video.bitmapcolor, 0, bitmapData.Scan0, Video.fullwidth * Video.fullheight); + // bitmapGDI.UnlockBits(bitmapData); + // if (Wintime.osd_ticks() < popup_text_end) + // { + // Machine.mainMotion.tsslStatus = sDrawText; + // } + // else + // { + // popup_text_end = 0; + // if (Mame.paused) + // { + // Machine.mainMotion.tsslStatus = "pause"; + // } + // else + // { + // switch (Mame.playState) + // { + // case Mame.PlayState.PLAY_RECORDRUNNING: + // Machine.mainMotion.tsslStatus = "record"; + // break; + // case Mame.PlayState.PLAY_REPLAYRUNNING: + // Machine.mainMotion.tsslStatus = "replay"; + // break; + // default: + // Machine.mainMotion.tsslStatus = "run"; + // break; + // } + // } + // } + // //bbmp[iMode] = drawcrosshair((Bitmap)bitmapGDI.Clone(new Rectangle(offsetx, offsety, width, height), PixelFormat.Format32bppArgb)); + // bbmp[iMode] = drawcrosshair(bitmapGDI.Clone(new Rectangle(offsetx, offsety, width, height))); + // switch (Machine.sDirection) + // { + // case "": + // break; + // case "90": + // bbmp[iMode].RotateFlip(RotateFlipType.Rotate90FlipNone); + // break; + // case "180": + // bbmp[iMode].RotateFlip(RotateFlipType.Rotate180FlipNone); + // break; + // case "270": + // bbmp[iMode].RotateFlip(RotateFlipType.Rotate270FlipNone); + // break; + // } + // //Machine.mainMotion.pictureBox1.Image = bbmp[iMode]; + // SubmitVideo(bbmp[iMode]); + // } + // catch + // { + + // } + //} + + + public static void GDIDraw() + { + try + { + //TODO + //int[] TempData = AxiBitmapEx.CloneIntColorArr(Video.bitmapcolor, Video.fullwidth, Video.fullheight, new Rectangle(offsetx, offsety, width, height)); + //drawcrosshair(TempData); + //bbmp[iMode] = drawcrosshair(bitmapGDI.Clone(new Rectangle(offsetx, offsety, width, height))); + //switch (Machine.sDirection) + //{ + // case "": + // break; + // case "90": + // bbmp[iMode].RotateFlip(RotateFlipType.Rotate90FlipNone); + // break; + // case "180": + // bbmp[iMode].RotateFlip(RotateFlipType.Rotate180FlipNone); + // break; + // case "270": + // bbmp[iMode].RotateFlip(RotateFlipType.Rotate270FlipNone); + // break; + //} + //Machine.mainMotion.pictureBox1.Image = bbmp[iMode]; + + //AxiBitmapEx.CloneIntColorArr(Video.bitmapcolor,Video.bitmapcolorRect, Video.fullwidth, Video.fullheight, new Rectangle(offsetx, offsety, width, height)); + SubmitVideo(Video.bitmapcolorRect, Video.screenstate.frame_number); + //SubmitVideo(Video.bitmapcolor); + } + catch (Exception ex) + { + + } + } + + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/VideoSubmit.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/VideoSubmit.cs.meta new file mode 100644 index 00000000..783d698d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/VideoSubmit.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59ac86e0728d3cd40b74e1f87733ffd7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Watchdog.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Watchdog.cs new file mode 100644 index 00000000..1b49f61b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Watchdog.cs @@ -0,0 +1,60 @@ +namespace MAME.Core +{ + public class Watchdog + { + public static bool watchdog_enabled; + public static EmuTimer.emu_timer watchdog_timer; + public static Atime watchdog_time; + public static void watchdog_init() + { + watchdog_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Watchdog_watchdog_callback, false); + switch (Machine.sBoard) + { + case "CPS-1": + case "CPS-1(QSound)": + case "CPS2": + case "Data East": + case "Tehkan": + case "Namco System 1": + case "IGS011": + case "PGM": + case "M72": + case "M92": + case "Taito": + case "Taito B": + case "Konami 68000": + case "Capcom": + watchdog_time = Attotime.ATTOTIME_ZERO; + break; + case "Neo Geo": + watchdog_time = new Atime(0, (long)128762e12); + break; + } + } + public static void watchdog_internal_reset() + { + watchdog_enabled = false; + watchdog_reset(); + watchdog_enabled = true; + } + public static void watchdog_callback() + { + Mame.mame_schedule_soft_reset(); + } + public static void watchdog_reset() + { + if (!watchdog_enabled) + { + EmuTimer.timer_adjust_periodic(watchdog_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + } + else if (Attotime.attotime_compare(watchdog_time, Attotime.ATTOTIME_ZERO) != 0) + { + EmuTimer.timer_adjust_periodic(watchdog_timer, watchdog_time, Attotime.ATTOTIME_NEVER); + } + else + { + EmuTimer.timer_adjust_periodic(watchdog_timer, new Atime(3, 0), Attotime.ATTOTIME_NEVER); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Watchdog.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Watchdog.cs.meta new file mode 100644 index 00000000..86359f46 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Watchdog.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 08a9eef8f97129f468087dbbf49ff09d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Window.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Window.cs new file mode 100644 index 00000000..26e61396 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Window.cs @@ -0,0 +1,93 @@ +namespace MAME.Core +{ + public class Window + { + //private static MameMainMotion _myParentForm; + //[DllImport("kernel32.dll ")] + //private static extern uint GetTickCount(); + + /// + /// 操作系统启动以来的毫秒数 + /// + /// + private static uint GetTickCount() + { + //return (uint)Wintime._stopwatch.ElapsedMilliseconds; + return AxiTimeSpan.itime.GetTickCount(); + } + + public static bool input_enabled, input_paused, mouse_enabled, lightgun_enabled; + public static uint last_poll, last_event_check; + private static bool _CursorShown = true; + public static void osd_update(bool skip_redraw) + { + if (!skip_redraw) + { + //winwindow_video_window_update(); + } + winwindow_process_events(true); + wininput_poll(); + //check_osd_inputs(machine); + } + public static void winwindow_process_events(bool ingame) + { + last_event_check = GetTickCount(); + } + public static void wininput_poll() + { + if (input_enabled) + { + last_poll = GetTickCount(); + winwindow_process_events_periodic(); + } + } + public static void winwindow_process_events_periodic() + { + uint currticks = GetTickCount(); + if (currticks - last_event_check < 1000 / 8) + { + return; + } + winwindow_process_events(true); + } + public static void osd_init() + { + wininput_init(); + } + public static void wininput_init() + { + input_enabled = true; + switch (Machine.sName) + { + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + mouse_enabled = true; + lightgun_enabled = false; + break; + default: + mouse_enabled = false; + lightgun_enabled = false; + break; + } + wininput_poll(); + } + public static void wininput_pause(bool paused) + { + input_paused = paused; + } + public static bool wininput_should_hide_mouse() + { + if (input_paused || !input_enabled) + return false; + if (!mouse_enabled && !lightgun_enabled) + return false; + //if (win_window_list != NULL && win_has_menu(win_window_list)) + // return false; + return true; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Window.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Window.cs.meta new file mode 100644 index 00000000..dd726570 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Window.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 218158910d74d424c9521d9bff147310 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Wintime.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Wintime.cs new file mode 100644 index 00000000..18e5a218 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Wintime.cs @@ -0,0 +1,59 @@ +using System.Diagnostics; +using System.Threading; + +namespace MAME.Core +{ + public class Wintime + { + //[DllImport("kernel32.dll ")] + //public static extern bool QueryPerformanceCounter(ref long lpPerformanceCount); + //[DllImport("kernel32.dll")] + //private static extern bool QueryPerformanceFrequency(ref long PerformanceFrequency); + + #region 跨平台等效实现 + //public static Stopwatch _stopwatch = Stopwatch.StartNew(); + //private static long _lastReportedCount = 0; + + public static bool QueryPerformanceCounter(ref long lpPerformanceCount) + { + //lpPerformanceCount = _stopwatch.ElapsedTicks; + return AxiTimeSpan.itime.QueryPerformanceCounter(ref lpPerformanceCount); + } + + public static bool QueryPerformanceFrequency(ref long PerformanceFrequency) + { + //PerformanceFrequency = Stopwatch.Frequency; + return AxiTimeSpan.itime.QueryPerformanceFrequency(ref PerformanceFrequency); + } + #endregion + + + public static long ticks_per_second; + public static void wintime_init() + { + long b = 0; + QueryPerformanceFrequency(ref b); + ticks_per_second = b; + } + public static long osd_ticks() + { + long a = 0; + QueryPerformanceCounter(ref a); + return a; + } + + //废弃 + //public static void osd_sleep(long duration) + //{ + // int msec; + // msec = (int)(duration * 1000 / ticks_per_second); + // if (msec >= 2) + // { + // msec -= 2; + // throw new System.NotImplementedException(); + // //TODO 是否该暂停 + // Thread.Sleep(msec); + // } + //} + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Wintime.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Wintime.cs.meta new file mode 100644 index 00000000..febe247b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Wintime.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7602bf3d83699f240a840c17b0f6c3e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame.meta new file mode 100644 index 00000000..4b76cad6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53b14dcaf2b54224da371a324bffc6c5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom.meta new file mode 100644 index 00000000..d08e92e1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e412a49617d838041b3fe648ef7edc85 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Capcom.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Capcom.cs new file mode 100644 index 00000000..f6c7b4fd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Capcom.cs @@ -0,0 +1,653 @@ +using cpu.m68000; +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Capcom + { + //public static byte[] audiorom2; + public static int basebankmain, basebanksnd1; + //public static byte[] /*gfx1rom,*/ /*gfx2rom, */gfx3rom, gfx4rom, gfx5rom, gfx12rom, gfx22rom, gfx32rom, gfx42rom; + + #region //指针化 audiorom2 + static byte[] audiorom2_src; + static GCHandle audiorom2_handle; + public static byte* audiorom2; + public static int audiorom2Length; + public static bool audiorom2_IsNull => audiorom2 == null; + public static byte[] audiorom2_set + { + set + { + audiorom2_handle.ReleaseGCHandle(); + audiorom2_src = value; + audiorom2Length = value.Length; + audiorom2_src.GetObjectPtr(ref audiorom2_handle, ref audiorom2); + } + } + #endregion + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + #region //指针化 gfx3rom + static byte[] gfx3rom_src; + static GCHandle gfx3rom_handle; + public static byte* gfx3rom; + public static int gfx3romLength; + public static bool gfx3rom_IsNull => gfx3rom == null; + public static byte[] gfx3rom_set + { + set + { + gfx3rom_handle.ReleaseGCHandle(); + gfx3rom_src = value; + gfx3romLength = value.Length; + gfx3rom_src.GetObjectPtr(ref gfx3rom_handle, ref gfx3rom); + } + } + #endregion + + #region //指针化 gfx4rom + static byte[] gfx4rom_src; + static GCHandle gfx4rom_handle; + public static byte* gfx4rom; + public static int gfx4romLength; + public static bool gfx4rom_IsNull => gfx4rom == null; + public static byte[] gfx4rom_set + { + set + { + gfx4rom_handle.ReleaseGCHandle(); + gfx4rom_src = value; + gfx4romLength = value.Length; + gfx4rom_src.GetObjectPtr(ref gfx4rom_handle, ref gfx4rom); + } + } + #endregion + + #region //指针化 gfx5rom + static byte[] gfx5rom_src; + static GCHandle gfx5rom_handle; + public static byte* gfx5rom; + public static int gfx5romLength; + public static bool gfx5rom_IsNull => gfx5rom == null; + public static byte[] gfx5rom_set + { + set + { + gfx5rom_handle.ReleaseGCHandle(); + gfx5rom_src = value; + gfx5romLength = value.Length; + gfx5rom_src.GetObjectPtr(ref gfx5rom_handle, ref gfx5rom); + } + } + #endregion + + #region //指针化 gfx12rom + static byte[] gfx12rom_src; + static GCHandle gfx12rom_handle; + public static byte* gfx12rom; + public static int gfx12romLength; + public static bool gfx12rom_IsNull => gfx12rom == null; + public static byte[] gfx12rom_set + { + set + { + gfx12rom_handle.ReleaseGCHandle(); + gfx12rom_src = value; + gfx12romLength = value.Length; + gfx12rom_src.GetObjectPtr(ref gfx12rom_handle, ref gfx12rom); + } + } + #endregion + + #region //指针化 gfx22rom + static byte[] gfx22rom_src; + static GCHandle gfx22rom_handle; + public static byte* gfx22rom; + public static int gfx22romLength; + public static bool gfx22rom_IsNull => gfx22rom == null; + public static byte[] gfx22rom_set + { + set + { + gfx22rom_handle.ReleaseGCHandle(); + gfx22rom_src = value; + gfx22romLength = value.Length; + gfx22rom_src.GetObjectPtr(ref gfx22rom_handle, ref gfx22rom); + } + } + #endregion + + #region //指针化 gfx32rom + static byte[] gfx32rom_src; + static GCHandle gfx32rom_handle; + public static byte* gfx32rom; + public static int gfx32romLength; + public static bool gfx32rom_IsNull => gfx32rom == null; + public static byte[] gfx32rom_set + { + set + { + gfx32rom_handle.ReleaseGCHandle(); + gfx32rom_src = value; + gfx32romLength = value.Length; + gfx32rom_src.GetObjectPtr(ref gfx32rom_handle, ref gfx32rom); + } + } + #endregion + + #region //指针化 gfx42rom + static byte[] gfx42rom_src; + static GCHandle gfx42rom_handle; + public static byte* gfx42rom; + public static int gfx42romLength; + public static bool gfx42rom_IsNull => gfx42rom == null; + public static byte[] gfx42rom_set + { + set + { + gfx42rom_handle.ReleaseGCHandle(); + gfx42rom_src = value; + gfx42romLength = value.Length; + gfx42rom_src.GetObjectPtr(ref gfx42rom_handle, ref gfx42rom); + } + } + #endregion + + + public static ushort dsw1, dsw2; + public static byte bytedsw1, bytedsw2; + public static ushort[] sf_objectram, sf_videoram; + public static int[] scale = new int[8] { 0x00, 0x40, 0xe0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }; + public static void CapcomInit() + { + int i, n; + Machine.bRom = true; + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + Generic.spriteram_set = new byte[0x200]; + Generic.buffered_spriteram_set = new byte[0x200]; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + gfx22rom_set = Machine.GetRom("gfx2.rom"); + n = gfx22romLength; + gfx2rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx2rom[i * 2] = (byte)(gfx22rom[i] >> 4); + gfx2rom[i * 2 + 1] = (byte)(gfx22rom[i] & 0x0f); + } + gfx32rom_set = Machine.GetRom("gfx3.rom"); + n = gfx32romLength; + gfx3rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx3rom[i * 2] = (byte)(gfx32rom[i] >> 4); + gfx3rom[i * 2 + 1] = (byte)(gfx32rom[i] & 0x0f); + } + Memory.Set_mainram(new byte[0x1e00]); + Memory.Set_audioram(new byte[0x800]); + Generic.paletteram_set = new byte[0x100]; + Generic.paletteram_2_set = new byte[0x100]; + if (Memory.mainrom_IsNull|| Memory.audiorom_IsNull || gfx12rom == null || gfx22rom == null || gfx32rom == null) + { + Machine.bRom = false; + } + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + sf_objectram = new ushort[0x1000]; + sf_videoram = new ushort[0x800]; + Generic.paletteram16_set = new ushort[0x400]; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + audiorom2_set = Machine.GetRom("audio2.rom"); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + gfx22rom_set = Machine.GetRom("gfx2.rom"); + n = gfx22romLength; + gfx2rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx2rom[i * 2] = (byte)(gfx22rom[i] >> 4); + gfx2rom[i * 2 + 1] = (byte)(gfx22rom[i] & 0x0f); + } + gfx32rom_set = Machine.GetRom("gfx3.rom"); + n = gfx32romLength; + gfx3rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx3rom[i * 2] = (byte)(gfx32rom[i] >> 4); + gfx3rom[i * 2 + 1] = (byte)(gfx32rom[i] & 0x0f); + } + gfx42rom_set = Machine.GetRom("gfx4.rom"); + n = gfx42romLength; + gfx4rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx4rom[i * 2] = (byte)(gfx42rom[i] >> 4); + gfx4rom[i * 2 + 1] = (byte)(gfx42rom[i] & 0x0f); + } + gfx5rom_set = Machine.GetRom("gfx5.rom"); + Memory.Set_mainram(new byte[0x6000]); + Memory.Set_audioram(new byte[0x800]); + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || gfx12rom == null || gfx22rom == null || gfx32rom == null || gfx42rom == null || gfx5rom == null) + { + Machine.bRom = false; + } + break; + } + if (Machine.bRom) + { + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + bytedsw1 = 0xdf; + bytedsw2 = 0xfb; + break; + case "diamond": + bytedsw1 = 0x81; + bytedsw2 = 0x07; + break; + case "sf": + case "sfua": + case "sfj": + dsw1 = 0xdfff; + dsw2 = 0xfbff; + shorts = unchecked((short)0xff7f); + break; + case "sfjan": + case "sfan": + case "sfp": + dsw1 = 0xdfff; + dsw2 = 0xffff; + shorts = unchecked((short)0xff7f); + break; + } + } + } + public static ushort dummy_r() + { + return 0xffff; + } + public static void sf_coin_w() + { + /*if (ACCESSING_BITS_0_7) + { + coin_counter_w(0, data & 0x01); + coin_counter_w(1, data & 0x02); + coin_lockout_w(0, ~data & 0x10); + coin_lockout_w(1, ~data & 0x20); + coin_lockout_w(2, ~data & 0x40); + }*/ + } + public static void sf_coin_w2() + { + + } + public static void soundcmd_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + Sound.soundlatch_w((ushort)(data & 0xff)); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + } + public static void soundcmd_w2(byte data) + { + Sound.soundlatch_w((ushort)(data & 0xff)); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + public static void write_dword(int offset, int data) + { + MC68000.m1.WriteWord(offset, (short)(data >> 16)); + MC68000.m1.WriteWord(offset + 2, (short)data); + } + public static void protection_w(ushort data) + { + int[,] maplist = new int[4, 10] { + { 1, 0, 3, 2, 4, 5, 6, 7, 8, 9 }, + { 4, 5, 6, 7, 1, 0, 3, 2, 8, 9 }, + { 3, 2, 1, 0, 6, 7, 4, 5, 8, 9 }, + { 6, 7, 4, 5, 3, 2, 1, 0, 8, 9 } + }; + int map; + map = maplist[MC68000.m1.ReadByte(0xffc006), (MC68000.m1.ReadByte(0xffc003) << 1) + (MC68000.m1.ReadWord(0xffc004) >> 8)]; + switch (MC68000.m1.ReadByte(0xffc684)) + { + case 1: + { + int base1; + base1 = 0x1b6e8 + 0x300e * map; + write_dword(0xffc01c, 0x16bfc + 0x270 * map); + write_dword(0xffc020, base1 + 0x80); + write_dword(0xffc024, base1); + write_dword(0xffc028, base1 + 0x86); + write_dword(0xffc02c, base1 + 0x8e); + write_dword(0xffc030, base1 + 0x20e); + write_dword(0xffc034, base1 + 0x30e); + write_dword(0xffc038, base1 + 0x38e); + write_dword(0xffc03c, base1 + 0x40e); + write_dword(0xffc040, base1 + 0x80e); + write_dword(0xffc044, base1 + 0xc0e); + write_dword(0xffc048, base1 + 0x180e); + write_dword(0xffc04c, base1 + 0x240e); + write_dword(0xffc050, 0x19548 + 0x60 * map); + write_dword(0xffc054, 0x19578 + 0x60 * map); + break; + } + case 2: + { + int[] delta1 = new int[10]{ + 0x1f80, 0x1c80, 0x2700, 0x2400, 0x2b80, 0x2e80, 0x3300, 0x3600, 0x3a80, 0x3d80 + }; + int[] delta2 = new int[10]{ + 0x2180, 0x1800, 0x3480, 0x2b00, 0x3e00, 0x4780, 0x5100, 0x5a80, 0x6400, 0x6d80 + }; + int d1 = delta1[map] + 0xc0; + int d2 = delta2[map]; + MC68000.m1.WriteWord(0xffc680, (short)d1); + MC68000.m1.WriteWord(0xffc682, (short)d2); + MC68000.m1.WriteWord(0xffc00c, 0xc0); + MC68000.m1.WriteWord(0xffc00e, 0); + sf_fg_scroll_w((ushort)d1); + sf_bg_scroll_w((ushort)d2); + break; + } + case 4: + { + int pos = MC68000.m1.ReadByte(0xffc010); + pos = (pos + 1) & 3; + MC68000.m1.WriteByte(0xffc010, (sbyte)pos); + if (pos == 0) + { + int d1 = MC68000.m1.ReadWord(0xffc682); + int off = MC68000.m1.ReadWord(0xffc00e); + if (off != 512) + { + off++; + d1++; + } + else + { + off = 0; + d1 -= 512; + } + MC68000.m1.WriteWord(0xffc682, (short)d1); + MC68000.m1.WriteWord(0xffc00e, (short)off); + sf_bg_scroll_w((ushort)d1); + } + break; + } + default: + { + break; + } + } + } + public static void protection_w1(byte data) + { + int[,] maplist = new int[4, 10] { + { 1, 0, 3, 2, 4, 5, 6, 7, 8, 9 }, + { 4, 5, 6, 7, 1, 0, 3, 2, 8, 9 }, + { 3, 2, 1, 0, 6, 7, 4, 5, 8, 9 }, + { 6, 7, 4, 5, 3, 2, 1, 0, 8, 9 } + }; + int map; + map = maplist[MC68000.m1.ReadByte(0xffc006), (MC68000.m1.ReadByte(0xffc003) << 1) + (MC68000.m1.ReadWord(0xffc004) >> 8)]; + switch (MC68000.m1.ReadByte(0xffc684)) + { + case 1: + { + int base1; + base1 = 0x1b6e8 + 0x300e * map; + write_dword(0xffc01c, 0x16bfc + 0x270 * map); + write_dword(0xffc020, base1 + 0x80); + write_dword(0xffc024, base1); + write_dword(0xffc028, base1 + 0x86); + write_dword(0xffc02c, base1 + 0x8e); + write_dword(0xffc030, base1 + 0x20e); + write_dword(0xffc034, base1 + 0x30e); + write_dword(0xffc038, base1 + 0x38e); + write_dword(0xffc03c, base1 + 0x40e); + write_dword(0xffc040, base1 + 0x80e); + write_dword(0xffc044, base1 + 0xc0e); + write_dword(0xffc048, base1 + 0x180e); + write_dword(0xffc04c, base1 + 0x240e); + write_dword(0xffc050, 0x19548 + 0x60 * map); + write_dword(0xffc054, 0x19578 + 0x60 * map); + break; + } + case 2: + { + int[] delta1 = new int[10]{ + 0x1f80, 0x1c80, 0x2700, 0x2400, 0x2b80, 0x2e80, 0x3300, 0x3600, 0x3a80, 0x3d80 + }; + int[] delta2 = new int[10]{ + 0x2180, 0x1800, 0x3480, 0x2b00, 0x3e00, 0x4780, 0x5100, 0x5a80, 0x6400, 0x6d80 + }; + int d1 = delta1[map] + 0xc0; + int d2 = delta2[map]; + MC68000.m1.WriteWord(0xffc680, (short)d1); + MC68000.m1.WriteWord(0xffc682, (short)d2); + MC68000.m1.WriteWord(0xffc00c, 0xc0); + MC68000.m1.WriteWord(0xffc00e, 0); + sf_fg_scroll_w1((byte)(d1 >> 8)); + sf_bg_scroll_w((byte)(d2 >> 8)); + break; + } + case 4: + { + int pos = MC68000.m1.ReadByte(0xffc010); + pos = (pos + 1) & 3; + MC68000.m1.WriteByte(0xffc010, (sbyte)pos); + if (pos == 0) + { + int d1 = MC68000.m1.ReadWord(0xffc682); + int off = MC68000.m1.ReadWord(0xffc00e); + if (off != 512) + { + off++; + d1++; + } + else + { + off = 0; + d1 -= 512; + } + MC68000.m1.WriteWord(0xffc682, (short)d1); + MC68000.m1.WriteWord(0xffc00e, (short)off); + sf_bg_scroll_w((byte)(d1 >> 8)); + } + break; + } + default: + { + break; + } + } + } + public static void protection_w2(byte data) + { + int[,] maplist = new int[4, 10] { + { 1, 0, 3, 2, 4, 5, 6, 7, 8, 9 }, + { 4, 5, 6, 7, 1, 0, 3, 2, 8, 9 }, + { 3, 2, 1, 0, 6, 7, 4, 5, 8, 9 }, + { 6, 7, 4, 5, 3, 2, 1, 0, 8, 9 } + }; + int map; + map = maplist[MC68000.m1.ReadByte(0xffc006), (MC68000.m1.ReadByte(0xffc003) << 1) + (MC68000.m1.ReadWord(0xffc004) >> 8)]; + switch (MC68000.m1.ReadByte(0xffc684)) + { + case 1: + { + int base1; + base1 = 0x1b6e8 + 0x300e * map; + write_dword(0xffc01c, 0x16bfc + 0x270 * map); + write_dword(0xffc020, base1 + 0x80); + write_dword(0xffc024, base1); + write_dword(0xffc028, base1 + 0x86); + write_dword(0xffc02c, base1 + 0x8e); + write_dword(0xffc030, base1 + 0x20e); + write_dword(0xffc034, base1 + 0x30e); + write_dword(0xffc038, base1 + 0x38e); + write_dword(0xffc03c, base1 + 0x40e); + write_dword(0xffc040, base1 + 0x80e); + write_dword(0xffc044, base1 + 0xc0e); + write_dword(0xffc048, base1 + 0x180e); + write_dword(0xffc04c, base1 + 0x240e); + write_dword(0xffc050, 0x19548 + 0x60 * map); + write_dword(0xffc054, 0x19578 + 0x60 * map); + break; + } + case 2: + { + int[] delta1 = new int[10]{ + 0x1f80, 0x1c80, 0x2700, 0x2400, 0x2b80, 0x2e80, 0x3300, 0x3600, 0x3a80, 0x3d80 + }; + int[] delta2 = new int[10]{ + 0x2180, 0x1800, 0x3480, 0x2b00, 0x3e00, 0x4780, 0x5100, 0x5a80, 0x6400, 0x6d80 + }; + int d1 = delta1[map] + 0xc0; + int d2 = delta2[map]; + MC68000.m1.WriteWord(0xffc680, (short)d1); + MC68000.m1.WriteWord(0xffc682, (short)d2); + MC68000.m1.WriteWord(0xffc00c, 0xc0); + MC68000.m1.WriteWord(0xffc00e, 0); + sf_fg_scroll_w((byte)d1); + sf_bg_scroll_w((byte)d2); + break; + } + case 4: + { + int pos = MC68000.m1.ReadByte(0xffc010); + pos = (pos + 1) & 3; + MC68000.m1.WriteByte(0xffc010, (sbyte)pos); + if (pos == 0) + { + int d1 = MC68000.m1.ReadWord(0xffc682); + int off = MC68000.m1.ReadWord(0xffc00e); + if (off != 512) + { + off++; + d1++; + } + else + { + off = 0; + d1 -= 512; + } + MC68000.m1.WriteWord(0xffc682, (short)d1); + MC68000.m1.WriteWord(0xffc00e, (short)off); + sf_bg_scroll_w((byte)d1); + } + break; + } + default: + { + break; + } + } + } + public static ushort button1_r() + { + return (ushort)((scale[sbyte3] << 8) | scale[sbyte1]); + } + public static ushort button2_r() + { + return (ushort)((scale[sbyte4] << 8) | scale[sbyte2]); + } + public static void msm5205_w(int offset, byte data) + { + MSM5205.msm5205_reset_w(offset, (data >> 7) & 1); + /* ?? bit 6?? */ + MSM5205.msm5205_data_w(offset, data); + MSM5205.msm5205_vclk_w(offset, 1); + MSM5205.msm5205_vclk_w(offset, 0); + } + public static void irq_handler(int irq) + { + Cpuint.cpunum_set_input_line(1, 0, (irq != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void machine_reset_capcom() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Capcom.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Capcom.cs.meta new file mode 100644 index 00000000..6b9f86ca --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Capcom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d7e3f253770f9d4293d4990a2b1aa39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Drawgfx.cs new file mode 100644 index 00000000..71987932 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Drawgfx.cs @@ -0,0 +1,200 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_gng(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 0x10 - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x100) + { + ex = 0x100 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x10 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 0x40 + 0x10 * color; + blockmove_8toN_transpen16_gng(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx); + } + public static void blockmove_8toN_transpen16_gng(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsety, int offsetx) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * 0x100; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0x0f) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x100 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + public static void common_drawgfx_sf(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 0x10 - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x200) + { + ex = 0x200 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x10 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x11c) + { + ey = 0x11c - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 0x200 + 0x10 * color; + blockmove_8toN_transpen16_sf(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx); + } + public static void blockmove_8toN_transpen16_sf(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsety, int offsetx) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * 0x100; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0x0f) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Drawgfx.cs.meta new file mode 100644 index 00000000..87209994 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4e15941ba134ac4590bef5008e964cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Gng.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Gng.cs new file mode 100644 index 00000000..b6b43d21 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Gng.cs @@ -0,0 +1,171 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Capcom + { + //public static byte[] gng_fgvideoram, gng_bgvideoram; + //public static byte[] scrollx, scrolly; + + #region //指针化 gng_fgvideoram + static byte[] gng_fgvideoram_src; + static GCHandle gng_fgvideoram_handle; + public static byte* gng_fgvideoram; + public static int gng_fgvideoramLength; + public static bool gng_fgvideoram_IsNull => gng_fgvideoram == null; + public static byte[] gng_fgvideoram_set + { + set + { + gng_fgvideoram_handle.ReleaseGCHandle(); + gng_fgvideoram_src = value; + gng_fgvideoramLength = value.Length; + gng_fgvideoram_src.GetObjectPtr(ref gng_fgvideoram_handle, ref gng_fgvideoram); + } + } + #endregion + + #region //指针化 gng_bgvideoram + static byte[] gng_bgvideoram_src; + static GCHandle gng_bgvideoram_handle; + public static byte* gng_bgvideoram; + public static int gng_bgvideoramLength; + public static bool gng_bgvideoram_IsNull => gng_bgvideoram == null; + public static byte[] gng_bgvideoram_set + { + set + { + gng_bgvideoram_handle.ReleaseGCHandle(); + gng_bgvideoram_src = value; + gng_bgvideoramLength = value.Length; + gng_bgvideoram_src.GetObjectPtr(ref gng_bgvideoram_handle, ref gng_bgvideoram); + } + } + #endregion + + #region //指针化 scrollx + static byte[] scrollx_src; + static GCHandle scrollx_handle; + public static byte* scrollx; + public static int scrollxLength; + public static bool scrollx_IsNull => scrollx == null; + public static byte[] scrollx_set + { + set + { + scrollx_handle.ReleaseGCHandle(); + if (value == null) + return; + scrollx_src = value; + scrollxLength = value.Length; + scrollx_src.GetObjectPtr(ref scrollx_handle, ref scrollx); + } + } + #endregion + + #region //指针化 scrolly + static byte[] scrolly_src; + static GCHandle scrolly_handle; + public static byte* scrolly; + public static int scrollyLength; + public static bool scrolly_IsNull => scrolly == null; + public static byte[] scrolly_set + { + set + { + scrolly_handle.ReleaseGCHandle(); + if (value == null) + return; + scrolly_src = value; + scrollyLength = value.Length; + scrolly_src.GetObjectPtr(ref scrolly_handle, ref scrolly); + } + } + #endregion + + public static void gng_bankswitch_w(byte data) + { + if (data == 4) + { + basebankmain = 0x4000; + } + else + { + basebankmain = 0x10000 + 0x2000 * (data & 0x03); + } + } + public static void gng_coin_counter_w(int offset, byte data) + { + Generic.coin_counter_w(offset, data); + } + public static void video_start_gng() + { + gng_fgvideoram_set = new byte[0x800]; + gng_bgvideoram_set = new byte[0x800]; + scrollx_set = new byte[2]; + scrolly_set = new byte[2]; + } + public static void gng_fgvideoram_w(int offset, byte data) + { + gng_fgvideoram[offset] = data; + int row, col; + row = (offset & 0x3ff) / 0x20; + col = (offset & 0x3ff) % 0x20; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void gng_bgvideoram_w(int offset, byte data) + { + gng_bgvideoram[offset] = data; + int row, col; + row = (offset & 0x3ff) % 0x20; + col = (offset & 0x3ff) / 0x20; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void gng_bgscrollx_w(int offset, byte data) + { + scrollx[offset] = data; + bg_tilemap.tilemap_set_scrollx(0, scrollx[0] + 256 * scrollx[1]); + } + public static void gng_bgscrolly_w(int offset, byte data) + { + scrolly[offset] = data; + bg_tilemap.tilemap_set_scrolly(0, scrolly[0] + 256 * scrolly[1]); + } + public static void gng_flipscreen_w(byte data) + { + Generic.flip_screen_set(~data & 1); + } + public static void draw_sprites_gng(RECT cliprect) + { + int offs; + for (offs = 0x200 - 4; offs >= 0; offs -= 4) + { + byte attributes = Generic.buffered_spriteram[offs + 1]; + int sx = Generic.buffered_spriteram[offs + 3] - 0x100 * (attributes & 0x01); + int sy = Generic.buffered_spriteram[offs + 2]; + int flipx = attributes & 0x04; + int flipy = attributes & 0x08; + if (Generic.flip_screen_get() != 0) + { + sx = 240 - sx; + sy = 240 - sy; + flipx = (flipx == 0 ? 1 : 0); + flipy = (flipy == 0 ? 1 : 0); + } + Drawgfx.common_drawgfx_gng(gfx3rom, Generic.buffered_spriteram[offs] + ((attributes << 2) & 0x300), (attributes >> 4) & 3, flipx, flipy, sx, sy, cliprect); + } + } + public static void video_update_gng() + { + bg_tilemap.tilemap_draw_primask(Video.screenstate.visarea, 0x20, 0); + draw_sprites_gng(Video.screenstate.visarea); + bg_tilemap.tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + fg_tilemap.tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + } + public static void video_eof_gng() + { + Generic.buffer_spriteram_w(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Gng.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Gng.cs.meta new file mode 100644 index 00000000..75b5a887 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Gng.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f011af2679f14340aed40ff30b6bcb9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Input.cs new file mode 100644 index 00000000..c6828b5d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Input.cs @@ -0,0 +1,963 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class Capcom + { + public static void loop_inputports_gng() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + bytes &= unchecked((byte)~0x40); + } + else + { + bytes |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + bytes &= unchecked((byte)~0x80); + } + else + { + bytes |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + bytes &= unchecked((byte)~0x01); + } + else + { + bytes |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + bytes &= unchecked((byte)~0x02); + } + else + { + bytes |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte1 &= unchecked((byte)~0x01); + } + else + { + byte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte1 &= unchecked((byte)~0x02); + } + else + { + byte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte1 &= unchecked((byte)~0x04); + } + else + { + byte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte1 &= unchecked((byte)~0x08); + } + else + { + byte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte1 &= unchecked((byte)~0x10); + } + else + { + byte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte1 &= unchecked((byte)~0x20); + } + else + { + byte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + byte2 &= unchecked((byte)~0x01); + } + else + { + byte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + byte2 &= unchecked((byte)~0x02); + } + else + { + byte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + byte2 &= unchecked((byte)~0x04); + } + else + { + byte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + bytes &= unchecked((byte)~0x20); + } + else + { + bytes |= 0x20; + } + } + public static void loop_inputports_diamond() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + bytes &= unchecked((byte)~0x40); + } + else + { + bytes |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + bytes &= unchecked((byte)~0x80); + } + else + { + bytes |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + bytes &= unchecked((byte)~0x01); + } + else + { + bytes |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + bytes &= unchecked((byte)~0x02); + } + else + { + bytes |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte1 &= unchecked((byte)~0x01); + } + else + { + byte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte1 &= unchecked((byte)~0x02); + } + else + { + byte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte1 &= unchecked((byte)~0x04); + } + else + { + byte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte1 &= unchecked((byte)~0x08); + } + else + { + byte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte1 &= unchecked((byte)~0x10); + } + else + { + byte1 |= 0x10; + } + } + public static void loop_inputports_sfus() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short0 &= ~0x0001; + } + else + { + short0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short0 &= ~0x0002; + } + else + { + short0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + shorts &= ~0x0001; + } + else + { + shorts |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + shorts &= ~0x0002; + } + else + { + shorts |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short1 &= ~0x0001; + } + else + { + short1 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short1 &= ~0x0002; + } + else + { + short1 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short1 &= ~0x0004; + } + else + { + short1 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short1 &= ~0x0008; + } + else + { + short1 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short1 &= ~0x0010; + } + else + { + short1 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short1 &= ~0x0020; + } + else + { + short1 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short1 &= ~0x0040; + } + else + { + short1 |= 0x0040; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + short1 &= ~0x0080; + } + else + { + short1 |= 0x0080; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + short0 &= ~0x0004; + } + else + { + short0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short1 &= ~0x0100; + } + else + { + short1 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short1 &= ~0x0200; + } + else + { + short1 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short1 &= ~0x0400; + } + else + { + short1 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short1 &= ~0x0800; + } + else + { + short1 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short1 &= ~0x2000; + } + else + { + short1 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short1 &= ~0x4000; + } + else + { + short1 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + short1 &= unchecked((short)~0x8000); + } + else + { + short1 |= unchecked((short)0x8000); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + shorts &= ~0x0004; + } + else + { + shorts |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x40; + } + else + { + //sbyte0 |= 0x40; + } + } + public static void loop_inputports_sfjp() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + shortc &= ~0x0001; + } + else + { + shortc |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + shortc &= ~0x0002; + } + else + { + shortc |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + shorts &= ~0x0001; + } + else + { + shorts |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + shorts &= ~0x0002; + } + else + { + shorts |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short1 &= ~0x0001; + } + else + { + short1 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short1 &= ~0x0002; + } + else + { + short1 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short1 &= ~0x0004; + } + else + { + short1 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short1 &= ~0x0008; + } + else + { + short1 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short1 &= ~0x0100; + } + else + { + short1 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short1 &= ~0x0200; + } + else + { + short1 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short1 &= ~0x0400; + } + else + { + short1 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + short1 &= ~0x2000; + } + else + { + short1 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + short1 &= ~0x4000; + } + else + { + short1 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short2 &= ~0x0001; + } + else + { + short2 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short2 &= ~0x0002; + } + else + { + short2 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short2 &= ~0x0004; + } + else + { + short2 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short2 &= ~0x0008; + } + else + { + short2 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short2 &= ~0x0200; + } + else + { + short2 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short2 &= ~0x0400; + } + else + { + short2 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short2 &= ~0x1000; + } + else + { + short2 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + short2 &= ~0x2000; + } + else + { + short2 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + short2 &= ~0x4000; + } + else + { + short2 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + shorts &= ~0x0004; + } + else + { + shorts |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x40; + } + else + { + //sbyte0 |= 0x40; + } + } + public static void loop_inputports_sfan() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + shortc &= ~0x0001; + } + else + { + shortc |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + shortc &= ~0x0002; + } + else + { + shortc |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + shorts &= ~0x0001; + } + else + { + shorts |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + shorts &= ~0x0002; + } + else + { + shorts |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short0 &= ~0x0001; + } + else + { + short0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short0 &= ~0x0002; + } + else + { + short0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short0 &= ~0x0004; + } + else + { + short0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short0 &= ~0x0008; + } + else + { + short0 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 |= 0x01; + } + else + { + sbyte1 &= ~0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 |= 0x02; + } + else + { + sbyte1 &= ~0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + sbyte1 |= 0x04; + } + else + { + sbyte1 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + sbyte2 |= 0x01; + } + else + { + sbyte2 &= ~0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + sbyte2 |= 0x02; + } + else + { + sbyte2 &= ~0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + sbyte2 |= 0x04; + } + else + { + sbyte2 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short0 &= ~0x0800; + } + else + { + short0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte3 |= 0x01; + } + else + { + sbyte3 &= ~0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte3 |= 0x02; + } + else + { + sbyte3 &= ~0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + sbyte3 |= 0x04; + } + else + { + sbyte3 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + sbyte4 |= 0x01; + } + else + { + sbyte4 &= ~0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + sbyte4 &= ~0x02; + } + else + { + sbyte4 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + sbyte4 |= 0x04; + } + else + { + sbyte4 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + shorts &= ~0x0004; + } + else + { + shorts |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x40; + } + else + { + //sbyte0 |= 0x40; + } + } + public static void record_port_gng() + { + if (bytes != bytes_old || byte1 != byte1_old || byte2 != byte2_old) + { + bytes_old = bytes; + byte1_old = byte1; + byte2_old = byte2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(bytes); + Mame.bwRecord.Write(byte1); + Mame.bwRecord.Write(byte2); + } + } + public static void replay_port_gng() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + bytes_old = Mame.brRecord.ReadByte(); + byte1_old = Mame.brRecord.ReadByte(); + byte2_old = Mame.brRecord.ReadByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + bytes = bytes_old; + byte1 = byte1_old; + byte2 = byte2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + public static void record_port_sf() + { + if (short0 != short0_old || short1 != short1_old || short2 != short2_old || shorts != shorts_old || shortc != shortc_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old || sbyte3 != sbyte3_old || sbyte4 != sbyte4_old) + { + short0_old = short0; + short1_old = short1; + short2_old = short2; + shorts_old = shorts; + shortc_old = shortc; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + sbyte3_old = sbyte3; + sbyte4_old = sbyte4; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(short0); + Mame.bwRecord.Write(short1); + Mame.bwRecord.Write(short2); + Mame.bwRecord.Write(shorts); + Mame.bwRecord.Write(shortc); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbyte3); + Mame.bwRecord.Write(sbyte4); + } + } + public static void replay_port_sf() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + short0_old = Mame.brRecord.ReadInt16(); + short1_old = Mame.brRecord.ReadInt16(); + short2_old = Mame.brRecord.ReadInt16(); + shorts_old = Mame.brRecord.ReadInt16(); + shortc_old = Mame.brRecord.ReadInt16(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbyte3_old = Mame.brRecord.ReadSByte(); + sbyte4_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + short0 = short0_old; + short1 = short1_old; + short2 = short2_old; + shorts = shorts_old; + shortc = shortc_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + sbyte3 = sbyte3_old; + sbyte4 = sbyte4_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Input.cs.meta new file mode 100644 index 00000000..2c93dd10 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb6f3a737f1352e43926cf8749b08d6f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Memory.cs new file mode 100644 index 00000000..d3f4c5d5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Memory.cs @@ -0,0 +1,1326 @@ +using cpu.z80; + +namespace MAME.Core +{ + public unsafe partial class Capcom + { + public static sbyte sbyte1, sbyte2, sbyte3, sbyte4; + public static sbyte sbyte1_old, sbyte2_old, sbyte3_old, sbyte4_old; + public static short short0, short1, short2, shorts, shortc; + public static short short0_old, short1_old, short2_old, shorts_old, shortc_old; + public static byte bytes, byte1, byte2; + public static byte bytes_old, byte1_old, byte2_old; + public static byte MReadOpByte_gng(ushort address) + { + byte result = 0; + if (address <= 0x1dff) + { + result = Memory.mainram[address]; + } + else if (address >= 0x4000 && address <= 0x5fff) + { + int offset = address - 0x4000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address >= 0x6000 && address <= 0xffff) + { + result = Memory.mainrom[address]; + } + else + { + int i1 = 1; + } + return result; + } + public static byte MReadByte_gng(ushort address) + { + byte result = 0; + if (address <= 0x1dff) + { + result = Memory.mainram[address]; + } + else if (address >= 0x1e00 && address <= 0x1fff) + { + int offset = address - 0x1e00; + result = Generic.spriteram[offset]; + } + else if (address >= 0x2000 && address <= 0x27ff) + { + int offset = address - 0x2000; + result = gng_fgvideoram[offset]; + } + else if (address >= 0x2800 && address <= 0x2fff) + { + int offset = address - 0x2800; + result = gng_bgvideoram[offset]; + } + else if (address == 0x3000) + { + result = bytes; + } + else if (address == 0x3001) + { + int offset = (address - 0x3001) / 2; + result = byte1; + } + else if (address == 0x3002) + { + int offset = (address - 0x3002) / 2; + result = byte2; + } + else if (address == 0x3003) + { + int offset = (address - 0x3003) / 2; + result = bytedsw1; + } + else if (address == 0x3004) + { + int offset = (address - 0x3004) / 2; + result = bytedsw2; + } + else if (address == 0x3c00) + { + result = 0; + } + else if (address >= 0x4000 && address <= 0x5fff) + { + int offset = address - 0x4000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address >= 0x6000 && address <= 0xffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte MReadByte_diamond(ushort address) + { + byte result = 0; + if (address <= 0x1dff) + { + result = Memory.mainram[address]; + } + else if (address >= 0x1e00 && address <= 0x1fff) + { + int offset = address - 0x1e00; + result = Generic.spriteram[offset]; + } + else if (address >= 0x2000 && address <= 0x27ff) + { + int offset = address - 0x2000; + result = gng_fgvideoram[offset]; + } + else if (address >= 0x2800 && address <= 0x2fff) + { + int offset = address - 0x2800; + result = gng_bgvideoram[offset]; + } + else if (address == 0x3000) + { + result = bytes; + } + else if (address == 0x3001) + { + int offset = (address - 0x3001) / 2; + result = byte1; + } + else if (address == 0x3002) + { + int offset = (address - 0x3002) / 2; + result = byte2; + } + else if (address == 0x3003) + { + int offset = (address - 0x3003) / 2; + result = bytedsw1; + } + else if (address == 0x3004) + { + int offset = (address - 0x3004) / 2; + result = bytedsw2; + } + else if (address == 0x3c00) + { + result = 0; + } + else if (address >= 0x4000 && address <= 0x5fff) + { + int offset = address - 0x4000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address == 0x6000) + { + result = 0; + } + else if (address >= 0x6001 && address <= 0xffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static void MWriteByte_gng(ushort address, byte value) + { + if (address <= 0x1dff) + { + Memory.mainram[address] = value; + } + else if (address >= 0x1e00 && address <= 0x1fff) + { + int offset = address - 0x1e00; + Generic.spriteram[offset] = value; + } + else if (address >= 0x2000 && address <= 0x27ff) + { + int offset = address - 0x2000; + gng_fgvideoram_w(offset, value); + } + else if (address >= 0x2800 && address <= 0x2fff) + { + int offset = address - 0x2800; + gng_bgvideoram_w(offset, value); + } + else if (address >= 0x3800 && address <= 0x38ff) + { + int offset = address - 0x3800; + Generic.paletteram_RRRRGGGGBBBBxxxx_split2_w(offset, value); + } + else if (address >= 0x3900 && address <= 0x39ff) + { + int offset = address - 0x3900; + Generic.paletteram_RRRRGGGGBBBBxxxx_split1_w(offset, value); + } + else if (address == 0x3a00) + { + Sound.soundlatch_w(value); + } + else if (address >= 0x3b08 && address <= 0x3b09) + { + int offset = address - 0x3b08; + gng_bgscrollx_w(offset, value); + } + else if (address >= 0x3b0a && address <= 0x3b0b) + { + int offset = address - 0x3b0a; + gng_bgscrolly_w(offset, value); + } + else if (address == 0x3c00) + { + int i1 = 1; + } + else if (address == 0x3d00) + { + gng_flipscreen_w(value); + } + else if (address >= 0x3d02 && address <= 0x3d03) + { + int offset = address - 0x3d02; + gng_coin_counter_w(offset, value); + } + else if (address == 0x3e00) + { + gng_bankswitch_w(value); + } + else if (address >= 0x4000 && address <= 0xffff) + { + Memory.mainrom[address] = value; + } + } + public static byte ZReadOp_gng(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_gng(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + result = Memory.audioram[offset]; + } + else if (address == 0xc800) + { + result = (byte)Sound.soundlatch_r(); + } + else + { + result = 0; + } + return result; + } + public static void ZWriteMemory_gng(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + Memory.audioram[offset] = value; + } + else if (address == 0xe000) + { + YM2203.ym2203_control_port_0_w(value); + } + else if (address == 0xe001) + { + YM2203.ym2203_write_port_0_w(value); + } + else if (address == 0xe002) + { + YM2203.ym2203_control_port_1_w(value); + } + else if (address == 0xe003) + { + YM2203.ym2203_write_port_1_w(value); + } + } + public static sbyte MReadOpByte_sfus(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x04ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MReadByte_sf(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x04ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(sf_videoram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)sf_videoram[offset]; + } + } + else if (address >= 0xc00000 && address <= 0xc00001) + { + if (address % 2 == 0) + { + result = (sbyte)(shortc >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)shortc; + } + } + else if (address >= 0xc00002 && address <= 0xc00003) + { + if (address % 2 == 0) + { + result = (sbyte)(short0 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)short0; + } + } + else if (address >= 0xc00004 && address <= 0xc00005) + { + if (address % 2 == 0) + { + result = (sbyte)(button1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)button1_r(); + } + } + else if (address >= 0xc00006 && address <= 0xc00007) + { + if (address % 2 == 0) + { + result = (sbyte)(button2_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)button2_r(); + } + } + else if (address >= 0xc00008 && address <= 0xc00009) + { + if (address % 2 == 0) + { + result = (sbyte)(dsw1 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0xc0000a && address <= 0xc0000b) + { + if (address % 2 == 0) + { + result = (sbyte)(dsw2 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dsw2; + } + } + else if (address >= 0xc0000c && address <= 0xc0000d) + { + if (address % 2 == 0) + { + result = (sbyte)(shorts >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)shorts; + } + } + else if (address >= 0xc0000e && address <= 0xc0000f) + { + if (address % 2 == 0) + { + result = (sbyte)(dummy_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dummy_r(); + } + } + else if (address >= 0xff8000 && address <= 0xffdfff) + { + int offset = address - 0xff8000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0xffe000 && address <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(sf_objectram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)sf_objectram[offset]; + } + } + return result; + } + public static sbyte MReadByte_sfus(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x04ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(sf_videoram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)sf_videoram[offset]; + } + } + else if (address >= 0xc00000 && address <= 0xc00001) + { + if (address % 2 == 0) + { + result = (sbyte)(short0 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)short0; + } + } + else if (address >= 0xc00002 && address <= 0xc00003) + { + if (address % 2 == 0) + { + result = (sbyte)(short1 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)short1; + } + } + else if (address >= 0xc00004 && address <= 0xc00005) + { + if (address % 2 == 0) + { + result = (sbyte)(dummy_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dummy_r(); + } + } + else if (address >= 0xc00006 && address <= 0xc00007) + { + if (address % 2 == 0) + { + result = (sbyte)(dummy_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dummy_r(); + } + } + else if (address >= 0xc00008 && address <= 0xc00009) + { + if (address % 2 == 0) + { + result = (sbyte)(dsw1 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0xc0000a && address <= 0xc0000b) + { + if (address % 2 == 0) + { + result = (sbyte)(dsw2 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dsw2; + } + } + else if (address >= 0xc0000c && address <= 0xc0000d) + { + if (address % 2 == 0) + { + result = (sbyte)(shorts >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)shorts; + } + } + else if (address >= 0xc0000e && address <= 0xc0000f) + { + if (address % 2 == 0) + { + result = (sbyte)(dummy_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dummy_r(); + } + } + else if (address >= 0xff8000 && address <= 0xffdfff) + { + int offset = address - 0xff8000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0xffe000 && address <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(sf_objectram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)sf_objectram[offset]; + } + } + return result; + } + public static sbyte MReadByte_sfjp(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x04ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(sf_videoram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)sf_videoram[offset]; + } + } + else if (address >= 0xc00000 && address <= 0xc00001) + { + if (address % 2 == 0) + { + result = (sbyte)(shortc >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)shortc; + } + } + else if (address >= 0xc00002 && address <= 0xc00003) + { + if (address % 2 == 0) + { + result = (sbyte)(short1 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)short1; + } + } + else if (address >= 0xc00004 && address <= 0xc00005) + { + if (address % 2 == 0) + { + result = (sbyte)(short2 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)short2; + } + } + else if (address >= 0xc00006 && address <= 0xc00007) + { + if (address % 2 == 0) + { + result = (sbyte)(dummy_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dummy_r(); + } + } + else if (address >= 0xc00008 && address <= 0xc00009) + { + if (address % 2 == 0) + { + result = (sbyte)(dsw1 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0xc0000a && address <= 0xc0000b) + { + if (address % 2 == 0) + { + result = (sbyte)(dsw2 >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dsw2; + } + } + else if (address >= 0xc0000c && address <= 0xc0000d) + { + if (address % 2 == 0) + { + result = (sbyte)(shorts >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)shorts; + } + } + else if (address >= 0xc0000e && address <= 0xc0000f) + { + if (address % 2 == 0) + { + result = (sbyte)(dummy_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)dummy_r(); + } + } + else if (address >= 0xff8000 && address <= 0xffdfff) + { + int offset = address - 0xff8000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0xffe000 && address <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(sf_objectram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)sf_objectram[offset]; + } + } + return result; + } + public static short MReadOpWord_sfus(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x04ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_sf(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x04ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + result = (short)sf_videoram[offset]; + } + else if (address >= 0xc00000 && address + 1 <= 0xc00001) + { + result = shortc; + } + else if (address >= 0xc00002 && address + 1 <= 0xc00003) + { + result = short0; + } + else if (address >= 0xc00004 && address + 1 <= 0xc00005) + { + result = (short)button1_r(); + } + else if (address >= 0xc00006 && address + 1 <= 0xc00007) + { + result = (short)button2_r(); + } + else if (address >= 0xc00008 && address + 1 <= 0xc00009) + { + result = (short)dsw1; + } + else if (address >= 0xc0000a && address + 1 <= 0xc0000b) + { + result = (short)dsw2; + } + else if (address >= 0xc0000c && address + 1 <= 0xc0000d) + { + result = shorts; + } + else if (address >= 0xc0000e && address + 1 <= 0xc0000f) + { + result = (short)dummy_r(); + } + else if (address >= 0xff8000 && address + 1 <= 0xffdfff) + { + int offset = address - 0xff8000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0xffe000 && address + 1 <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + result = (short)sf_objectram[offset]; + } + return result; + } + public static short MReadWord_sfus(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x04ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + result = (short)sf_videoram[offset]; + } + else if (address >= 0xc00000 && address + 1 <= 0xc00001) + { + result = short0; + } + else if (address >= 0xc00002 && address + 1 <= 0xc00003) + { + result = short1; + } + else if (address >= 0xc00004 && address + 1 <= 0xc00005) + { + result = (short)dummy_r(); + } + else if (address >= 0xc00006 && address + 1 <= 0xc00007) + { + result = (short)dummy_r(); + } + else if (address >= 0xc00008 && address + 1 <= 0xc00009) + { + result = (short)dsw1; + } + else if (address >= 0xc0000a && address + 1 <= 0xc0000b) + { + result = (short)dsw2; + } + else if (address >= 0xc0000c && address + 1 <= 0xc0000d) + { + result = shorts; + } + else if (address >= 0xc0000e && address + 1 <= 0xc0000f) + { + result = (short)dummy_r(); + } + else if (address >= 0xff8000 && address + 1 <= 0xffdfff) + { + int offset = address - 0xff8000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0xffe000 && address + 1 <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + result = (short)sf_objectram[offset]; + } + return result; + } + public static short MReadWord_sfjp(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x04ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + result = (short)sf_videoram[offset]; + } + else if (address >= 0xc00000 && address + 1 <= 0xc00001) + { + result = shortc; + } + else if (address >= 0xc00002 && address + 1 <= 0xc00003) + { + result = short1; + } + else if (address >= 0xc00004 && address + 1 <= 0xc00005) + { + result = short2; + } + else if (address >= 0xc00006 && address + 1 <= 0xc00007) + { + result = (short)dummy_r(); + } + else if (address >= 0xc00008 && address + 1 <= 0xc00009) + { + result = (short)dsw1; + } + else if (address >= 0xc0000a && address + 1 <= 0xc0000b) + { + result = (short)dsw2; + } + else if (address >= 0xc0000c && address + 1 <= 0xc0000d) + { + result = shorts; + } + else if (address >= 0xc0000e && address + 1 <= 0xc0000f) + { + result = (short)dummy_r(); + } + else if (address >= 0xff8000 && address + 1 <= 0xffdfff) + { + int offset = address - 0xff8000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0xffe000 && address + 1 <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + result = (short)sf_objectram[offset]; + } + return result; + } + public static int MReadOpLong_sfus(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x04ffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MReadLong_sfus(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x04ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 3 <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + result = (int)(sf_videoram[offset] * 0x10000 + sf_videoram[offset + 1]); + } + else if (address >= 0xff8000 && address + 3 <= 0xffdfff) + { + int offset = address - 0xff8000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0xffe000 && address + 3 <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + result = (int)(sf_objectram[offset] * 0x10000 + sf_objectram[offset + 1]); + } + return result; + } + public static void MWriteByte_sf(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x000000 && address <= 0x04ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)value; + } + } + else if (address >= 0x800000 && address <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + sf_videoram_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + sf_videoram_w2(offset, (byte)value); + } + } + else if (address >= 0xb00000 && address <= 0xb007ff) + { + int offset = (address - 0xb00000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w2(offset, (byte)value); + } + } + else if (address >= 0xc00010 && address <= 0xc00011) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + sf_coin_w2(); + } + } + else if (address >= 0xc00014 && address <= 0xc00015) + { + if (address % 2 == 0) + { + sf_fg_scroll_w1((byte)value); + } + else if (address % 2 == 1) + { + sf_fg_scroll_w2((byte)value); + } + } + else if (address >= 0xc00018 && address <= 0xc00019) + { + if (address % 2 == 0) + { + sf_bg_scroll_w1((byte)value); + } + else if (address % 2 == 1) + { + sf_bg_scroll_w2((byte)value); + } + } + else if (address >= 0xc0001a && address <= 0xc0001b) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + sf_gfxctrl_w2((byte)value); + } + } + else if (address >= 0xc0001c && address <= 0xc0001d) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + soundcmd_w2((byte)value); + } + } + else if (address >= 0xc0001e && address <= 0xc0001f) + { + if (address % 2 == 0) + { + protection_w1((byte)value); + } + else if (address % 2 == 1) + { + protection_w2((byte)value); + } + } + else if (address >= 0xff8000 && address <= 0xffdfff) + { + int offset = address - 0xff8000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0xffe000 && address <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + if (address % 2 == 0) + { + sf_objectram[offset] = (ushort)((value << 8) | (sf_objectram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + sf_objectram[offset] = (ushort)((sf_objectram[offset] & 0xff00) | (byte)value); + } + } + } + public static void MWriteWord_sf(int address, short value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 1 <= 0x04ffff) + { + if (address + 1 < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; + } + } + else if (address >= 0x800000 && address + 1 <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + sf_videoram_w(offset, (ushort)value); + } + else if (address >= 0xb00000 && address + 1 <= 0xb007ff) + { + int offset = (address - 0xb00000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)value); + } + else if (address >= 0xc00010 && address + 1 <= 0xc00011) + { + sf_coin_w(); + } + else if (address >= 0xc00014 && address + 1 <= 0xc00015) + { + sf_fg_scroll_w((ushort)value); + } + else if (address >= 0xc00018 && address + 1 <= 0xc00019) + { + sf_bg_scroll_w((ushort)value); + } + else if (address >= 0xc0001a && address + 1 <= 0xc0001b) + { + sf_gfxctrl_w((ushort)value); + } + else if (address >= 0xc0001c && address + 1 <= 0xc0001d) + { + soundcmd_w((ushort)value); + } + else if (address >= 0xc0001e && address + 1 <= 0xc0001f) + { + protection_w((ushort)value); + } + else if (address >= 0xff8000 && address + 1 <= 0xffdfff) + { + int offset = address - 0xff8000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0xffe000 && address + 1 <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + sf_objectram[offset] = (ushort)value; + } + } + public static void MWriteLong_sf(int address, int value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 3 <= 0x04ffff) + { + 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; + } + } + else if (address >= 0x800000 && address + 3 <= 0x800fff) + { + int offset = (address - 0x800000) / 2; + sf_videoram_w(offset, (ushort)(value >> 16)); + sf_videoram_w(offset + 1, (ushort)value); + } + else if (address >= 0xb00000 && address + 3 <= 0xb007ff) + { + int offset = (address - 0xb00000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset + 1, (ushort)value); + } + else if (address >= 0xff8000 && address + 3 <= 0xffdfff) + { + int offset = address - 0xff8000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0xffe000 && address + 3 <= 0xffffff) + { + int offset = (address - 0xffe000) / 2; + sf_objectram[offset] = (ushort)(value >> 16); + sf_objectram[offset + 1] = (ushort)value; + } + } + public static byte Z0ReadOp_sf(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte Z0ReadMemory_sf(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + result = Memory.audioram[offset]; + } + else if (address == 0xc800) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address == 0xe001) + { + result = YM2151.ym2151_status_port_0_r(); + } + else + { + result = 0; + } + return result; + } + public static void Z0WriteMemory_sf(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + Memory.audioram[offset] = value; + } + else if (address == 0xe000) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xe001) + { + YM2151.ym2151_data_port_0_w(value); + } + } + public static byte Z0ReadHardware(ushort address) + { + return 0; + } + public static void Z0WriteHardware(ushort address, byte value) + { + + } + public static int Z0IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[0].cpunum, 0); + } + public static byte Z1ReadOp_sf(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = audiorom2[address]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + int offset = address - 0x8000; + result = audiorom2[basebanksnd1 + offset]; + } + return result; + } + public static byte Z1ReadMemory_sf(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = audiorom2[address]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + int offset = address - 0x8000; + result = audiorom2[basebanksnd1 + offset]; + } + return result; + } + public static void Z1WriteMemory_sf(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0xffff) + { + + } + } + public static byte Z1ReadHardware(ushort address) + { + byte result = 0; + address &= 0xff; + if (address == 0x01) + { + result = (byte)Sound.soundlatch_r(); + } + return result; + } + public static void Z1WriteHardware(ushort address, byte value) + { + address &= 0xff; + if (address >= 0x00 && address <= 0x01) + { + msm5205_w(address, value); + } + else if (address == 0x02) + { + basebanksnd1 = 0x8000 * (value + 1); + } + } + public static int Z1IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[1].cpunum, 0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Memory.cs.meta new file mode 100644 index 00000000..a05a0c05 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fa1e4319c2376e46aabc54f5fbf32ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/State.cs new file mode 100644 index 00000000..abc791cc --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/State.cs @@ -0,0 +1,201 @@ +using cpu.m68000; +using cpu.m6809; +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Capcom + { + public static void SaveStateBinary_gng(BinaryWriter writer) + { + int i; + writer.Write(bytedsw1); + writer.Write(bytedsw2); + writer.Write(basebankmain); + writer.Write(gng_fgvideoram, 0, 0x800); + writer.Write(gng_bgvideoram, 0, 0x800); + writer.Write(scrollx, 0, 2); + writer.Write(scrolly, 0, 2); + writer.Write(Generic.paletteram, 0, 0x100); + writer.Write(Generic.paletteram_2, 0, 0x100); + writer.Write(Generic.spriteram, 0, 0x200); + writer.Write(Generic.buffered_spriteram, 0, 0x200); + for (i = 0; i < 0x100; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x1e00); + M6809.mm1[0].SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + AY8910.AA8910[1].SaveStateBinary(writer); + YM2203.FF2203[0].SaveStateBinary(writer); + YM2203.FF2203[1].SaveStateBinary(writer); + writer.Write(Sound.latched_value[0]); + writer.Write(Sound.utempdata[0]); + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(AY8910.AA8910[1].stream.output_sampindex); + writer.Write(AY8910.AA8910[1].stream.output_base_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_base_sampindex); + writer.Write(YM2203.FF2203[1].stream.output_sampindex); + writer.Write(YM2203.FF2203[1].stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_gng(BinaryReader reader) + { + int i; + bytedsw1 = reader.ReadByte(); + bytedsw2 = reader.ReadByte(); + basebankmain = reader.ReadInt32(); + gng_fgvideoram_set = reader.ReadBytes(0x800); + gng_bgvideoram_set = reader.ReadBytes(0x800); + scrollx_set = reader.ReadBytes(2); + scrolly_set = reader.ReadBytes(2); + Generic.paletteram_set = reader.ReadBytes(0x100); + Generic.paletteram_2_set = reader.ReadBytes(0x100); + Generic.spriteram_set = reader.ReadBytes(0x200); + Generic.buffered_spriteram_set = reader.ReadBytes(0x200); + for (i = 0; i < 0x100; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x1e00)); + M6809.mm1[0].LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + AY8910.AA8910[1].LoadStateBinary(reader); + YM2203.FF2203[0].LoadStateBinary(reader); + YM2203.FF2203[1].LoadStateBinary(reader); + Sound.latched_value[0] = reader.ReadUInt16(); + Sound.utempdata[0] = reader.ReadUInt16(); + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + AY8910.AA8910[1].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[1].stream.output_base_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_base_sampindex = reader.ReadInt32(); + YM2203.FF2203[1].stream.output_sampindex = reader.ReadInt32(); + YM2203.FF2203[1].stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_sf(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(basebanksnd1); + for (i = 0; i < 0x1000; i++) + { + writer.Write(sf_objectram[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(sf_videoram[i]); + } + for (i = 0; i < 0x400; i++) + { + writer.Write(Generic.paletteram16[i]); + } + writer.Write(bg_scrollx); + writer.Write(fg_scrollx); + writer.Write(sf_active); + for (i = 0; i < 0x400; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x6000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Z80A.zz1[1].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + MSM5205.mm1[0].SaveStateBinary(writer); + MSM5205.mm1[1].SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(MSM5205.mm1[0].voice.stream.output_sampindex); + writer.Write(MSM5205.mm1[0].voice.stream.output_base_sampindex); + writer.Write(MSM5205.mm1[1].voice.stream.output_sampindex); + writer.Write(MSM5205.mm1[1].voice.stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_sf(BinaryReader reader) + { + int i; + dsw1 = reader.ReadUInt16(); + dsw2 = reader.ReadUInt16(); + basebanksnd1 = reader.ReadInt32(); + for (i = 0; i < 0x1000; i++) + { + sf_objectram[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + sf_videoram[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x400; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + bg_scrollx = reader.ReadInt32(); + fg_scrollx = reader.ReadInt32(); + sf_active = reader.ReadInt32(); + for (i = 0; i < 0x400; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x6000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Z80A.zz1[1].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + MSM5205.mm1[0].LoadStateBinary(reader); + MSM5205.mm1[1].LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + MSM5205.mm1[0].voice.stream.output_sampindex = reader.ReadInt32(); + MSM5205.mm1[0].voice.stream.output_base_sampindex = reader.ReadInt32(); + MSM5205.mm1[1].voice.stream.output_sampindex = reader.ReadInt32(); + MSM5205.mm1[1].voice.stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/State.cs.meta new file mode 100644 index 00000000..d0c7960e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 74bedd09fc1621e43be286a75f6005f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Tilemap.cs new file mode 100644 index 00000000..8761777d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Tilemap.cs @@ -0,0 +1,612 @@ +using System; +using System.Collections.Generic; + +namespace MAME.Core +{ + public unsafe partial class Capcom + { + public static void tilemap_init() + { + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + tilemap_init_gng(); + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + tilemap_init_sf(); + break; + } + } + public static void tilemap_init_gng() + { + int i; + fg_tilemap = new Tmap(); + fg_tilemap.cols = 0x20; + fg_tilemap.rows = 0x20; + fg_tilemap.tilewidth = 8; + fg_tilemap.tileheight = 8; + fg_tilemap.width = 0x100; + fg_tilemap.height = 0x100; + fg_tilemap.enable = true; + fg_tilemap.all_tiles_dirty = true; + fg_tilemap.total_elements = gfx1romLength / 0x40; + fg_tilemap.pixmap = new ushort[0x100 * 0x100]; + fg_tilemap.flagsmap = new byte[0x100, 0x100]; + fg_tilemap.tileflags = new byte[0x20, 0x20]; + fg_tilemap.pen_data_set = new byte[0x40]; + fg_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 16; i++) + { + fg_tilemap.pen_to_flags[0, i] = 0x10; + } + fg_tilemap.pen_to_flags[0, 3] = 0; + fg_tilemap.scrollrows = 1; + fg_tilemap.scrollcols = 1; + fg_tilemap.rowscroll = new int[fg_tilemap.scrollrows]; + fg_tilemap.colscroll = new int[fg_tilemap.scrollcols]; + fg_tilemap.tilemap_draw_instance3 = fg_tilemap.tilemap_draw_instanceCapcom_gng; + fg_tilemap.tile_update3 = fg_tilemap.tile_updateCapcomfg_gng; + bg_tilemap = new Tmap(); + bg_tilemap = new Tmap(); + bg_tilemap.cols = 0x20; + bg_tilemap.rows = 0x20; + bg_tilemap.tilewidth = 0x10; + bg_tilemap.tileheight = 0x10; + bg_tilemap.width = 0x200; + bg_tilemap.height = 0x200; + bg_tilemap.enable = true; + bg_tilemap.all_tiles_dirty = true; + bg_tilemap.total_elements = gfx2romLength / 0x100; + bg_tilemap.pixmap = new ushort[0x200 * 0x200]; + bg_tilemap.flagsmap = new byte[0x200, 0x200]; + bg_tilemap.tileflags = new byte[0x20, 0x20]; + bg_tilemap.pen_data_set = new byte[0x100]; + bg_tilemap.pen_to_flags = new byte[2, 16]; + for (i = 0; i < 8; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x20; + } + for (i = 8; i < 0x10; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x30; + } + bg_tilemap.pen_to_flags[1, 0] = 0x20; + bg_tilemap.pen_to_flags[1, 1] = 0x10; + bg_tilemap.pen_to_flags[1, 2] = 0x10; + bg_tilemap.pen_to_flags[1, 3] = 0x10; + bg_tilemap.pen_to_flags[1, 4] = 0x10; + bg_tilemap.pen_to_flags[1, 5] = 0x10; + bg_tilemap.pen_to_flags[1, 6] = 0x20; + bg_tilemap.pen_to_flags[1, 7] = 0x10; + for (i = 8; i < 0x10; i++) + { + bg_tilemap.pen_to_flags[1, i] = 0x30; + } + bg_tilemap.scrollrows = 1; + bg_tilemap.scrollcols = 1; + bg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap.tilemap_draw_instance3 = bg_tilemap.tilemap_draw_instanceCapcom_gng; + bg_tilemap.tile_update3 = bg_tilemap.tile_updateCapcombg_gng; + } + public static void tilemap_init_sf() + { + int i; + bg_tilemap = new Tmap(); + bg_tilemap.cols = 0x800; + bg_tilemap.rows = 0x10; + bg_tilemap.tilewidth = 0x10; + bg_tilemap.tileheight = 0x10; + bg_tilemap.width = 0x8000; + bg_tilemap.height = 0x100; + bg_tilemap.enable = true; + bg_tilemap.all_tiles_dirty = true; + bg_tilemap.total_elements = gfx1romLength / 0x100; + bg_tilemap.pixmap = new ushort[0x100 * 0x8000]; + bg_tilemap.flagsmap = new byte[0x100, 0x8000]; + bg_tilemap.tileflags = new byte[0x10, 0x800]; + bg_tilemap.pen_data_set = new byte[0x100]; + bg_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 16; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x10; + } + bg_tilemap.scrollrows = 1; + bg_tilemap.scrollcols = 1; + bg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap.tilemap_draw_instance3 = bg_tilemap.tilemap_draw_instanceCapcom_sf; + bg_tilemap.tile_update3 = bg_tilemap.tile_updateCapcombg; + + fg_tilemap = new Tmap(); + fg_tilemap.cols = 0x800; + fg_tilemap.rows = 0x10; + fg_tilemap.tilewidth = 0x10; + fg_tilemap.tileheight = 0x10; + fg_tilemap.width = 0x8000; + fg_tilemap.height = 0x100; + fg_tilemap.enable = true; + fg_tilemap.all_tiles_dirty = true; + fg_tilemap.total_elements = gfx2romLength / 0x100; + fg_tilemap.pixmap = new ushort[0x100 * 0x8000]; + fg_tilemap.flagsmap = new byte[0x100, 0x8000]; + fg_tilemap.tileflags = new byte[0x10, 0x800]; + fg_tilemap.pen_data_set = new byte[0x100]; + fg_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 15; i++) + { + fg_tilemap.pen_to_flags[0, i] = 0x10; + } + fg_tilemap.pen_to_flags[0, 3] = 0; + fg_tilemap.scrollrows = 1; + fg_tilemap.scrollcols = 1; + fg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + fg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + fg_tilemap.tilemap_draw_instance3 = fg_tilemap.tilemap_draw_instanceCapcom_sf; + fg_tilemap.tile_update3 = fg_tilemap.tile_updateCapcomfg; + + tx_tilemap = new Tmap(); + tx_tilemap.cols = 0x40; + tx_tilemap.rows = 0x20; + tx_tilemap.tilewidth = 8; + tx_tilemap.tileheight = 8; + tx_tilemap.width = 0x200; + tx_tilemap.height = 0x100; + tx_tilemap.enable = true; + tx_tilemap.all_tiles_dirty = true; + tx_tilemap.total_elements = gfx4romLength / 0x40; + tx_tilemap.pixmap = new ushort[0x100 * 0x200]; + tx_tilemap.flagsmap = new byte[0x100, 0x200]; + tx_tilemap.tileflags = new byte[0x20, 0x40]; + tx_tilemap.pen_data_set = new byte[0x40]; + tx_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 16; i++) + { + tx_tilemap.pen_to_flags[0, i] = 0x10; + } + tx_tilemap.pen_to_flags[0, 3] = 0; + tx_tilemap.scrollrows = 1; + tx_tilemap.scrollcols = 1; + tx_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + tx_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + tx_tilemap.tilemap_draw_instance3 = tx_tilemap.tilemap_draw_instanceCapcom_sf; + tx_tilemap.tile_update3 = tx_tilemap.tile_updateCapcomtx; + + Tilemap.lsTmap = new List(); + Tilemap.lsTmap.Add(bg_tilemap); + Tilemap.lsTmap.Add(fg_tilemap); + Tilemap.lsTmap.Add(tx_tilemap); + } + } + public unsafe partial class Tmap + { + public void tilemap_draw_instanceCapcom_gng(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + { + continue; + } + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x100 + xpos + x_start, x_end - x_start); + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x100 + i] = pixmap[offsety2 * width + i - xpos]; + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + { + break; + } + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tilemap_draw_instanceCapcom_sf(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + { + continue; + } + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x200 + xpos + x_start, x_end - x_start); + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = pixmap[offsety2 * width + i - xpos]; + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + { + break; + } + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tile_updateCapcombg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + tile_index = col * rows + row; + int base_offset = 2 * tile_index; + int attr = Capcom.gfx5rom[base_offset + 0x10000]; + color = Capcom.gfx5rom[base_offset]; + code = (Capcom.gfx5rom[base_offset + 0x10000 + 1] << 8) | Capcom.gfx5rom[base_offset + 1]; + code = code % total_elements; + pen_data_offset = code * 0x100; + palette_base = color * 0x10; + group = 0; + flags = (attr & 0x03) ^ (attributes & 0x03); + tileflags[row, col] = tile_drawCapcom(Capcom.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateCapcomfg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + tile_index = col * rows + row; + int base_offset = 0x20000 + 2 * tile_index; + int attr = Capcom.gfx5rom[base_offset + 0x10000]; + color = Capcom.gfx5rom[base_offset]; + code = (Capcom.gfx5rom[base_offset + 0x10000 + 1] << 8) | Capcom.gfx5rom[base_offset + 1]; + code = code % total_elements; + pen_data_offset = code * 0x100; + palette_base = 0x100 + (color * 0x10); + group = 0; + flags = (attr & 0x03) ^ (attributes & 0x03); + tileflags[row, col] = tile_drawCapcom(Capcom.gfx2rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateCapcomtx(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + code = Capcom.sf_videoram[tile_index]; + color = code >> 12; + flags = (((code & 0xc00) >> 10) & 0x03) ^ (attributes & 0x03); + code = (code & 0x3ff) % total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x300 + (color * 0x4); + group = 0; + tileflags[row, col] = tile_drawCapcomtx(Capcom.gfx4rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateCapcombg_gng(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + tile_index = col * rows + row; + int base_offset = 2 * tile_index; + int attr = Capcom.gng_bgvideoram[tile_index + 0x400]; + color = attr & 0x07; + code = Capcom.gng_bgvideoram[tile_index] + ((attr & 0xc0) << 2); + code = code % total_elements; + pen_data_offset = code * 0x100; + palette_base = color * 8; + flags = (((attr & 0x30) >> 4) & 0x03) ^ (attributes & 0x03); + group = (attr & 0x08) >> 3; + tileflags[row, col] = tile_drawCapcom(Capcom.gfx2rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateCapcomfg_gng(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + int base_offset = 2 * tile_index; + int attr = Capcom.gng_fgvideoram[tile_index + 0x400]; + color = attr & 0x0f; + code = Capcom.gng_fgvideoram[tile_index] + ((attr & 0xc0) << 2); + code = code % total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x80 + color * 4; + flags = (((attr & 0x30) >> 4) & 0x03) ^ (attributes & 0x03); + group = 0; + tileflags[row, col] = tile_drawCapcomfg_gng(Capcom.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public byte tile_drawCapcomfg_gng(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public byte tile_drawCapcom(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x100); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public byte tile_drawCapcomtx(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Tilemap.cs.meta new file mode 100644 index 00000000..5f629392 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e177a5133597741439a3a9635828ad84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Video.cs new file mode 100644 index 00000000..b8127070 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Video.cs @@ -0,0 +1,194 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Capcom + { + public static Tmap bg_tilemap, fg_tilemap, tx_tilemap; + public static int bg_scrollx, fg_scrollx; + public static int sf_active; + //public static ushort[] uuB0000; + + #region //指针化 uuB0000 + static ushort[] uuB0000_src; + static GCHandle uuB0000_handle; + public static ushort* uuB0000; + public static int uuB0000Length; + public static bool uuB0000_IsNull => uuB0000 == null; + public static ushort[] uuB0000_set + { + set + { + uuB0000_handle.ReleaseGCHandle(); + if (value == null) + return; + uuB0000_src = value; + uuB0000Length = value.Length; + uuB0000_src.GetObjectPtr(ref uuB0000_handle, ref uuB0000); + } + } + #endregion + + public static void video_start_sf() + { + int i; + sf_active = 0; + uuB0000_set = new ushort[0x200 * 0x100]; + for (i = 0; i < 0x20000; i++) + { + uuB0000[i] = 0x0; + } + } + public static void sf_videoram_w(int offset, ushort data) + { + int row, col; + sf_videoram[offset] = data; + row = offset / 64; + col = offset % 64; + tx_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void sf_videoram_w1(int offset, byte data) + { + int row, col; + sf_videoram[offset] = (ushort)((data << 8) | (sf_videoram[offset] & 0xff)); + row = offset / 64; + col = offset % 64; + tx_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void sf_videoram_w2(int offset, byte data) + { + int row, col; + sf_videoram[offset] = (ushort)((sf_videoram[offset] & 0xff00) | data); + row = offset / 64; + col = offset % 64; + tx_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void sf_bg_scroll_w(ushort data) + { + bg_scrollx = data; + bg_tilemap.tilemap_set_scrollx(0, bg_scrollx); + } + public static void sf_bg_scroll_w1(byte data) + { + bg_scrollx = (data << 8) | (bg_scrollx & 0xff); + bg_tilemap.tilemap_set_scrollx(0, bg_scrollx); + } + public static void sf_bg_scroll_w2(byte data) + { + bg_scrollx = (bg_scrollx & 0xff00) | data; + bg_tilemap.tilemap_set_scrollx(0, bg_scrollx); + } + public static void sf_fg_scroll_w(ushort data) + { + fg_scrollx = data; + fg_tilemap.tilemap_set_scrollx(0, fg_scrollx); + } + public static void sf_fg_scroll_w1(byte data) + { + fg_scrollx = (data << 8) | (fg_scrollx & 0xff); + fg_tilemap.tilemap_set_scrollx(0, fg_scrollx); + } + public static void sf_fg_scroll_w2(byte data) + { + fg_scrollx = (fg_scrollx & 0xff00) | data; + fg_tilemap.tilemap_set_scrollx(0, fg_scrollx); + } + public static void sf_gfxctrl_w(ushort data) + { + sf_active = data & 0xff; + Generic.flip_screen_set(data & 0x04); + tx_tilemap.enable = (data & 0x08) != 0; + bg_tilemap.enable = (data & 0x20) != 0; + fg_tilemap.enable = (data & 0x40) != 0; + } + public static void sf_gfxctrl_w2(byte data) + { + sf_active = data & 0xff; + Generic.flip_screen_set(data & 0x04); + tx_tilemap.enable = (data & 0x08) != 0; + bg_tilemap.enable = (data & 0x20) != 0; + fg_tilemap.enable = (data & 0x40) != 0; + } + public static int sf_invert(int nb) + { + int[] delta = new int[4] { 0x00, 0x18, 0x18, 0x00 }; + return nb ^ delta[(nb >> 3) & 3]; + } + public static void draw_sprites(RECT cliprect) + { + int offs; + for (offs = 0x1000 - 0x20; offs >= 0; offs -= 0x20) + { + int c = sf_objectram[offs]; + int attr = sf_objectram[offs + 1]; + int sy = sf_objectram[offs + 2]; + int sx = sf_objectram[offs + 3]; + int color = attr & 0x000f; + int flipx = attr & 0x0100; + int flipy = attr & 0x0200; + if ((attr & 0x400) != 0) + { + int c1, c2, c3, c4, t; + if (Generic.flip_screen_get() != 0) + { + sx = 480 - sx; + sy = 224 - sy; + flipx = (flipx == 0) ? 1 : 0; + flipy = (flipy == 0) ? 1 : 0; + } + c1 = c; + c2 = c + 1; + c3 = c + 16; + c4 = c + 17; + if (flipx != 0) + { + t = c1; c1 = c2; c2 = t; + t = c3; c3 = c4; c4 = t; + } + if (flipy != 0) + { + t = c1; c1 = c3; c3 = t; + t = c2; c2 = c4; c4 = t; + } + Drawgfx.common_drawgfx_sf(gfx3rom, sf_invert(c1), color, flipx, flipy, sx, sy, cliprect); + Drawgfx.common_drawgfx_sf(gfx3rom, sf_invert(c2), color, flipx, flipy, sx + 16, sy, cliprect); + Drawgfx.common_drawgfx_sf(gfx3rom, sf_invert(c3), color, flipx, flipy, sx, sy + 16, cliprect); + Drawgfx.common_drawgfx_sf(gfx3rom, sf_invert(c4), color, flipx, flipy, sx + 16, sy + 16, cliprect); + } + else + { + if (Generic.flip_screen_get() != 0) + { + sx = 496 - sx; + sy = 240 - sy; + flipx = (flipx == 0) ? 1 : 0; + flipy = (flipy == 0) ? 1 : 0; + } + Drawgfx.common_drawgfx_sf(gfx3rom, sf_invert(c), color, flipx, flipy, sx, sy, cliprect); + } + } + } + public static void video_update_sf() + { + if ((sf_active & 0x20) != 0) + { + bg_tilemap.tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + } + else + { + AxiArray.Copy(uuB0000, Video.bitmapbase_Ptrs[Video.curbitmap], 0x20000); + } + fg_tilemap.tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + if ((sf_active & 0x80) != 0) + { + draw_sprites(Video.screenstate.visarea); + } + tx_tilemap.tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + } + public static void video_eof() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Video.cs.meta new file mode 100644 index 00000000..8716ee21 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/capcom/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41e103aded7f2384fbdd09ae9ed089c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps.meta new file mode 100644 index 00000000..2a44b123 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc0dbac0d8356014ead1f585790887bc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/CPS.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/CPS.cs new file mode 100644 index 00000000..0ec37186 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/CPS.cs @@ -0,0 +1,2842 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class CPS + { + //public static ushort[] cps_a_regs, cps_b_regs, cps2_objram1, cps2_objram2, cps2_output; + //public static byte[] mainromop, gfxrom, gfx1rom, audioromop, starsrom, user1rom; + + #region //指针化 cps_a_regs + static ushort[] cps_a_regs_src; + static GCHandle cps_a_regs_handle; + public static ushort* cps_a_regs; + public static int cps_a_regsLength; + public static bool cps_a_regs_IsNull => cps_a_regs == null; + public static ushort[] cps_a_regs_set + { + set + { + cps_a_regs_handle.ReleaseGCHandle(); + cps_a_regs_src = value; + cps_a_regsLength = value.Length; + cps_a_regs_src.GetObjectPtr(ref cps_a_regs_handle, ref cps_a_regs); + } + } + #endregion + + + #region //指针化 cps_b_regs + static ushort[] cps_b_regs_src; + static GCHandle cps_b_regs_handle; + public static ushort* cps_b_regs; + public static int cps_b_regsLength; + public static bool cps_b_regs_IsNull => cps_b_regs == null; + public static ushort[] cps_b_regs_set + { + set + { + cps_b_regs_handle.ReleaseGCHandle(); + cps_b_regs_src = value; + cps_b_regsLength = value.Length; + cps_b_regs_src.GetObjectPtr(ref cps_b_regs_handle, ref cps_b_regs); + } + } + #endregion + + #region //指针化 cps2_objram1 + static ushort[] cps2_objram1_src; + static GCHandle cps2_objram1_handle; + public static ushort* cps2_objram1; + public static int cps2_objram1Length; + public static bool cps2_objram1_IsNull => cps2_objram1 == null; + public static ushort[] cps2_objram1_set + { + set + { + cps2_objram1_handle.ReleaseGCHandle(); + cps2_objram1_src = value; + cps2_objram1Length = value.Length; + cps2_objram1_src.GetObjectPtr(ref cps2_objram1_handle, ref cps2_objram1); + } + } + #endregion + + #region //指针化 cps2_objram2 + static ushort[] cps2_objram2_src; + static GCHandle cps2_objram2_handle; + public static ushort* cps2_objram2; + public static int cps2_objram2Length; + public static bool cps2_objram2_IsNull => cps2_objram2 == null; + public static ushort[] cps2_objram2_set + { + set + { + cps2_objram2_handle.ReleaseGCHandle(); + cps2_objram2_src = value; + cps2_objram2Length = value.Length; + cps2_objram2_src.GetObjectPtr(ref cps2_objram2_handle, ref cps2_objram2); + } + } + #endregion + + #region //指针化 cps2_output + static ushort[] cps2_output_src; + static GCHandle cps2_output_handle; + public static ushort* cps2_output; + public static int cps2_outputLength; + public static bool cps2_output_IsNull => cps2_output == null; + public static ushort[] cps2_output_set + { + set + { + cps2_output_handle.ReleaseGCHandle(); + cps2_output_src = value; + cps2_outputLength = value.Length; + cps2_output_src.GetObjectPtr(ref cps2_output_handle, ref cps2_output); + } + } + #endregion + + #region //指针化mainromop + static byte[] mainromop_src; + static GCHandle mainromop_handle; + public static byte* mainromop; + public static int mainromopLength; + public static bool mainromop_IsNull => mainromop == null; + public static byte[] mainromop_set + { + set + { + mainromop_handle.ReleaseGCHandle(); + mainromop_src = value; + mainromopLength = value.Length; + mainromop_src.GetObjectPtr(ref mainromop_handle, ref mainromop); + } + } + #endregion + + #region //指针化gfxrom + static byte[] gfxrom_src; + static GCHandle gfxrom_handle; + public static byte* gfxrom; + public static int gfxromLength; + public static bool gfxrom_IsNull => gfxrom == null; + public static byte[] gfxrom_set + { + set + { + gfxrom_handle.ReleaseGCHandle(); + gfxrom_src = value; + gfxromLength = value.Length; + gfxrom_src.GetObjectPtr(ref gfxrom_handle, ref gfxrom); + } + } + #endregion + + + #region //指针化gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化audioromop + static byte[] audioromop_src; + static GCHandle audioromop_handle; + public static byte* audioromop; + public static int audioromopLength; + public static bool audioromop_IsNull => audioromop == null; + public static byte[] audioromop_set + { + set + { + audioromop_handle.ReleaseGCHandle(); + audioromop_src = value; + audioromopLength = value.Length; + audioromop_src.GetObjectPtr(ref audioromop_handle, ref audioromop); + } + } + #endregion + + #region //指针化starsrom + static byte[] starsrom_src; + static GCHandle starsrom_handle; + public static byte* starsrom; + public static int starsromLength; + public static bool starsrom_IsNull => starsrom == null; + public static byte[] starsrom_set + { + set + { + starsrom_handle.ReleaseGCHandle(); + if (value == null) + return; + starsrom_src = value; + starsromLength = value.Length; + starsrom_src.GetObjectPtr(ref starsrom_handle, ref starsrom); + } + } + #endregion + + #region //指针化user1rom + static byte[] user1rom_src; + static GCHandle user1rom_handle; + public static byte* user1rom; + public static int user1romLength; + public static bool user1rom_IsNull => user1rom == null; + public static byte[] user1rom_set + { + set + { + user1rom_handle.ReleaseGCHandle(); + if (value == null) + return; + user1rom_src = value; + user1romLength = value.Length; + user1rom_src.GetObjectPtr(ref user1rom_handle, ref user1rom); + } + } + #endregion + + //public static byte[] gfxram; + //public static byte[] qsound_sharedram1, qsound_sharedram2; + //public static byte[] mainram2, mainram3; + + #region //指针化 gfxram + static byte[] gfxram_src; + static GCHandle gfxram_handle; + public static byte* gfxram; + public static int gfxramLength; + public static bool gfxram_IsNull => gfxram == null; + public static byte[] gfxram_set + { + set + { + gfxram_handle.ReleaseGCHandle(); + gfxram_src = value; + gfxramLength = value.Length; + gfxram_src.GetObjectPtr(ref gfxram_handle, ref gfxram); + } + } + #endregion + + #region //指针化 qsound_sharedram1 + static byte[] qsound_sharedram1_src; + static GCHandle qsound_sharedram1_handle; + public static byte* qsound_sharedram1; + public static int qsound_sharedram1Length; + public static bool qsound_sharedram1_IsNull => qsound_sharedram1 == null; + public static byte[] qsound_sharedram1_set + { + set + { + qsound_sharedram1_handle.ReleaseGCHandle(); + qsound_sharedram1_src = value; + qsound_sharedram1Length = value.Length; + qsound_sharedram1_src.GetObjectPtr(ref qsound_sharedram1_handle, ref qsound_sharedram1); + } + } + #endregion + + #region //指针化 qsound_sharedram2 + static byte[] qsound_sharedram2_src; + static GCHandle qsound_sharedram2_handle; + public static byte* qsound_sharedram2; + public static int qsound_sharedram2Length; + public static bool qsound_sharedram2_IsNull => qsound_sharedram2 == null; + public static byte[] qsound_sharedram2_set + { + set + { + qsound_sharedram2_handle.ReleaseGCHandle(); + qsound_sharedram2_src = value; + qsound_sharedram2Length = value.Length; + qsound_sharedram2_src.GetObjectPtr(ref qsound_sharedram2_handle, ref qsound_sharedram2); + } + } + #endregion + + #region //指针化 mainram2 + static byte[] mainram2_src; + static GCHandle mainram2_handle; + public static byte* mainram2; + public static int mainram2Length; + public static bool mainram2_IsNull => mainram2 == null; + public static byte[] mainram2_set + { + set + { + mainram2_handle.ReleaseGCHandle(); + mainram2_src = value; + mainram2Length = value.Length; + mainram2_src.GetObjectPtr(ref mainram2_handle, ref mainram2); + } + } + #endregion + + #region //指针化 mainram3 + static byte[] mainram3_src; + static GCHandle mainram3_handle; + public static byte* mainram3; + public static int mainram3Length; + public static bool mainram3_IsNull => mainram3 == null; + public static byte[] mainram3_set + { + set + { + mainram3_handle.ReleaseGCHandle(); + mainram3_src = value; + mainram3Length = value.Length; + mainram3_src.GetObjectPtr(ref mainram3_handle, ref mainram3); + } + } + #endregion + + public static byte dswa, dswb, dswc; + public static int cps_version; + public static int basebanksnd; + public static int sf2ceblp_prot; + public static int dial0, dial1; + public static int scrollxoff, scrollyoff; + public static int cps2networkpresent, cps2_objram_bank; + public static int scancount, cps1_scanline1, cps1_scanline2, cps1_scancalls; + public static List lsRange0, lsRange1, lsRange2, lsRangeS; + public class gfx_range + { + public int start; + public int end; + public int add; + public gfx_range(int i1, int i2, int i3) + { + start = i1; + end = i2; + add = i3; + } + } + public static sbyte[] ByteToSbyte(byte[] bb1) + { + sbyte[] bb2 = null; + int n1; + if (bb1 != null) + { + n1 = bb1.Length; + bb2 = new sbyte[n1]; + Buffer.BlockCopy(bb1, 0, bb2, 0, n1); + } + return bb2; + } + public static void CPSInit() + { + int i, n; + cps_a_regs_set = new ushort[0x20]; + cps_b_regs_set = new ushort[0x20]; + gfxram_set = new byte[0x30000]; + Memory.Set_mainram(new byte[0x10000]); + Memory.Set_audioram(new byte[0x800]); + Machine.bRom = true; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + gfxrom_set = Machine.GetRom("gfx.rom"); + n = gfxromLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfxrom[i] & 0x0f); + gfx1rom[i * 2 + 1] = (byte)(gfxrom[i] >> 4); + } + total_elements = n / 0x80; + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + switch (Machine.sBoard) + { + case "CPS-1": + cps_version = 1; + starsrom_set = Machine.GetRom("stars.rom"); + OKI6295.okirom = Machine.GetRom("oki.rom"); + if (Memory.mainrom_IsNull || gfxrom == null || Memory.audiorom_IsNull || OKI6295.okirom == null) + { + Machine.bRom = false; + } + break; + case "CPS-1(QSound)": + cps_version = 1; + qsound_sharedram1_set = new byte[0x1000]; + qsound_sharedram2_set = new byte[0x1000]; + audioromop_set = Machine.GetRom("audiocpuop.rom"); + user1rom_set = Machine.GetRom("user1.rom"); + QSound.qsoundrom = ByteToSbyte(Machine.GetRom("qsound.rom")); + if (Memory.mainrom_IsNull || audioromop == null || gfxrom == null || Memory.audiorom_IsNull || QSound.qsoundrom == null) + { + Machine.bRom = false; + } + break; + case "CPS2": + cps_version = 2; + cps2_objram1_set = new ushort[0x1000]; + cps2_objram2_set = new ushort[0x1000]; + cps2_output_set = new ushort[0x06]; + cps2networkpresent = 0; + cps2_objram_bank = 0; + scancount = 0; + cps1_scanline1 = 262; + cps1_scanline2 = 262; + cps1_scancalls = 0; + qsound_sharedram1_set = new byte[0x1000]; + qsound_sharedram2_set = new byte[0x1000]; + if (Machine.sManufacturer != "bootleg") + { + mainromop_set = Machine.GetRom("maincpuop.rom"); + } + audioromop_set = Machine.GetRom("audiocpu.rom"); + QSound.qsoundrom = ByteToSbyte(Machine.GetRom("qsound.rom")); + if (Memory.mainrom_IsNull || (Machine.sManufacturer != "bootleg" && mainromop == null) || audioromop == null || gfxrom == null || Memory.audiorom_IsNull || QSound.qsoundrom == null) + { + Machine.bRom = false; + } + break; + } + if (Machine.bRom) + { + scrollxoff = 0x00; + scrollyoff = 0x100; + switch (Machine.sName) + { + case "forgottn": + case "forgottna": + case "forgottnu": + case "forgottnue": + case "forgottnuc": + case "forgottnua": + case "forgottnuaa": + case "lostwrld": + case "lostwrldo": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange0.Add(new gfx_range(0x8000, 0xffff, -0x8000)); + lsRange0.Add(new gfx_range(0x10000, 0x17fff, -0x10000)); + lsRange0.Add(new gfx_range(0x18000, 0x1ffff, -0x18000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x3fff, 0x4000)); + lsRange1.Add(new gfx_range(0x4000, 0x7fff, 0)); + lsRange1.Add(new gfx_range(0x8000, 0xbfff, -0x4000)); + lsRange1.Add(new gfx_range(0xc000, 0xffff, -0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0x1000)); + lsRange2.Add(new gfx_range(0x1000, 0x1fff, 0)); + lsRange2.Add(new gfx_range(0x2000, 0x2fff, -0x1000)); + lsRange2.Add(new gfx_range(0x3000, 0x3fff, -0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x3fff, 0)); + break; + case "ghouls": + case "ghoulsu": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange0.Add(new gfx_range(0x8000, 0xffff, -0x8000)); + lsRange0.Add(new gfx_range(0x10000, 0x17fff, -0x10000)); + lsRange0.Add(new gfx_range(0x18000, 0x1ffff, -0x18000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x3fff, 0)); + lsRange1.Add(new gfx_range(0x4000, 0x7fff, -0x4000)); + lsRange1.Add(new gfx_range(0x8000, 0xbfff, -0x8000)); + lsRange1.Add(new gfx_range(0xc000, 0xffff, -0xc000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x13ff, 0)); + lsRange2.Add(new gfx_range(0x1400, 0x17ff, -0x400)); + lsRange2.Add(new gfx_range(0x1800, 0x1fff, -0x1000)); + lsRange2.Add(new gfx_range(0x2000, 0x2fff, -0x2000)); + lsRange2.Add(new gfx_range(0x3000, 0x3fff, -0x3000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRangeS.Add(new gfx_range(0x1000, 0x1fff, 0x4000)); + lsRangeS.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRangeS.Add(new gfx_range(0x4000, 0x7fff, -0x4000)); + lsRangeS.Add(new gfx_range(0x8000, 0xbfff, -0x8000)); + lsRangeS.Add(new gfx_range(0xc000, 0xffff, -0xc000)); + break; + case "daimakai": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x03ff, 0x1000)); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0xc00)); + lsRange2.Add(new gfx_range(0x0800, 0x0bff, 0x800)); + lsRange2.Add(new gfx_range(0x0c00, 0x0fff, 0x400)); + lsRange2.Add(new gfx_range(0x1000, 0x13ff, 0)); + lsRange2.Add(new gfx_range(0x1400, 0x17ff, -0x400)); + lsRange2.Add(new gfx_range(0x1800, 0x1bff, -0x800)); + lsRange2.Add(new gfx_range(0x1c00, 0x1fff, -0xc00)); + lsRange2.Add(new gfx_range(0x2000, 0x23ff, -0x1000)); + lsRange2.Add(new gfx_range(0x2400, 0x27ff, -0x1400)); + lsRange2.Add(new gfx_range(0x2800, 0x2bff, -0x1800)); + lsRange2.Add(new gfx_range(0x2c00, 0x2fff, -0x1c00)); + lsRange2.Add(new gfx_range(0x3000, 0x33ff, -0x2000)); + lsRange2.Add(new gfx_range(0x3400, 0x37ff, -0x2400)); + lsRange2.Add(new gfx_range(0x3800, 0x3bff, -0x2800)); + lsRange2.Add(new gfx_range(0x3c00, 0x3fff, -0x2c00)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRangeS.Add(new gfx_range(0x1000, 0x1fff, 0x4000)); + break; + case "daimakair": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x2000, 0x2fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0x1000)); + lsRange2.Add(new gfx_range(0x1000, 0x1fff, 0)); + lsRange2.Add(new gfx_range(0x2000, 0x2fff, -0x1000)); + lsRange2.Add(new gfx_range(0x3000, 0x3fff, -0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRangeS.Add(new gfx_range(0x1000, 0x1fff, 0x4000)); + break; + case "strider": + case "striderua": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xbf; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7000, 0x7fff, 0x8000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0x1000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x27ff, 0)); + break; + case "strideruc": + cpsb_addr = 0x08; + cpsb_value = 0x0407; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x14; + priority = new int[4] { 0x12, 0x10, 0x0e, 0x0c }; + palette_control = 0x0a; + layer_enable_mask = new int[5] { 0x08, 0x10, 0x02, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xbf; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7000, 0x7fff, 0x8000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0x1000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x27ff, 0)); + break; + case "striderj": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xbf; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7000, 0x7fff, 0x8000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0x1000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x27ff, 0)); + break; + case "striderjr": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xbf; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7000, 0x7fff, 0x8000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0x1000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x27ff, 0)); + break; + case "dynwar": + case "dynwara": + case "dynwarj": + cpsb_addr = 0x20; + cpsb_value = 0x0002; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2c; + priority = new int[4] { 0x2a, 0x28, 0x26, 0x24 }; + palette_control = 0x22; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x6000, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0x4000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x07ff, 0x1000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x2fff, 0)); + break; + case "dynwarjr": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x6000, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x3fff, 0x4000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x07ff, 0x1000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x2fff, 0)); + break; + case "willow": + case "willowu": + case "willowuo": + case "willowj": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x30; + priority = new int[4] { 0x2e, 0x2c, 0x2a, 0x28 }; + palette_control = 0x26; + layer_enable_mask = new int[5] { 0x20, 0x10, 0x08, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7000, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x1fff, 0x4000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0a00, 0x0dff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x27ff, 0)); + break; + case "unsquad": + case "area88": + cpsb_addr = 0x32; + cpsb_value = 0x0401; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x08, 0x10, 0x20, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x2fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0c00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x17ff, 0)); + break; + case "area88r": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x2fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0c00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x17ff, 0)); + break; + case "ffight": + case "ffighta": + case "ffightu": + case "ffightu1": + case "ffightj": + cpsb_addr = 0x20; + cpsb_value = 0x0004; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2e; + priority = new int[4] { 0x26, 0x30, 0x28, 0x32 }; + palette_control = 0x2a; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4400, 0x4bff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0980, 0x0bff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x21ff, 0)); + break; + case "ffightua": + case "ffightj1": + case "ffightjh": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4400, 0x4bff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0980, 0x0bff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x21ff, 0)); + break; + case "ffightub": + cpsb_addr = -1; + cpsb_value = 0x0000; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x30; + priority = new int[4] { 0x2e, 0x2c, 0x2a, 0x28 }; + palette_control = 0x26; + layer_enable_mask = new int[5] { 0x20, 0x10, 0x08, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4400, 0x4bff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0980, 0x0bff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x21ff, 0)); + break; + case "ffightuc": + case "ffightj3": + cpsb_addr = 0x20; + cpsb_value = 0x0005; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x28; + priority = new int[4] { 0x2a, 0x2c, 0x2e, 0x30 }; + palette_control = 0x32; + layer_enable_mask = new int[5] { 0x02, 0x08, 0x20, 0x14, 0x14 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4400, 0x4bff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0980, 0x0bff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x21ff, 0)); + break; + case "ffightj2": + cpsb_addr = 0x20; + cpsb_value = 0x0002; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2c; + priority = new int[4] { 0x2a, 0x28, 0x26, 0x24 }; + palette_control = 0x22; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4400, 0x4bff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0980, 0x0bff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x21ff, 0)); + break; + case "1941": + case "1941r1": + case "1941u": + case "1941j": + cpsb_addr = 0x20; + cpsb_value = 0x0005; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x28; + priority = new int[4] { 0x2a, 0x2c, 0x2e, 0x30 }; + palette_control = 0x32; + layer_enable_mask = new int[5] { 0x02, 0x08, 0x20, 0x14, 0x14 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x47ff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2400, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x0fff, 0)); + break; + case "mercs": + case "mercsu": + case "mercsur1": + case "mercsj": + cpsb_addr = 0x20; + cpsb_value = 0x0402; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2c; + priority = new int[4] { 0x2a, 0x28, 0x26, 0x24 }; + palette_control = 0x22; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x34; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0bff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0600, 0x1dff, 0)); + lsRange1.Add(new gfx_range(0x5400, 0x5bff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0780, 0x097f, 0)); + lsRange2.Add(new gfx_range(0x1700, 0x17ff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x2600, 0x53ff, 0)); + break; + case "mtwins": + case "chikij": + cpsb_addr = 0x1e; + cpsb_value = 0x0404; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x12; + priority = new int[4] { 0x14, 0x16, 0x18, 0x1a }; + palette_control = 0x1c; + layer_enable_mask = new int[5] { 0x08, 0x20, 0x10, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xdc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x3000, 0x3fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x37ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0e00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x17ff, 0)); + break; + case "msword": + case "mswordr1": + case "mswordu": + case "mswordj": + cpsb_addr = 0x2e; + cpsb_value = 0x0403; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x22; + priority = new int[4] { 0x24, 0x26, 0x28, 0x2a }; + palette_control = 0x2c; + layer_enable_mask = new int[5] { 0x20, 0x02, 0x04, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xbc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x37ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0e00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x1fff, 0)); + break; + case "cawing": + case "cawingr1": + case "cawingu": + case "cawingj": + cpsb_addr = 0x00; + cpsb_value = 0x0406; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x0c; + priority = new int[4] { 0x0a, 0x08, 0x06, 0x04 }; + palette_control = 0x02; + layer_enable_mask = new int[5] { 0x10, 0x0a, 0x0a, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x5000, 0x57ff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x17ff, 0)); + lsRange1.Add(new gfx_range(0x2c00, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0600, 0x09ff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x17ff, 0)); + lsRangeS.Add(new gfx_range(0x2c00, 0x3fff, 0)); + break; + case "nemo": + case "nemor1": + case "nemoj": + cpsb_addr = 0x0e; + cpsb_value = 0x0405; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x02; + priority = new int[4] { 0x04, 0x06, 0x08, 0x0a }; + palette_control = 0x0c; + layer_enable_mask = new int[5] { 0x04, 0x02, 0x20, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x47ff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x1fff, 0)); + lsRange1.Add(new gfx_range(0x2400, 0x33ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0d00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x1fff, 0)); + lsRangeS.Add(new gfx_range(0x2400, 0x3dff, 0)); + break; + case "sf2": + case "sf2ug": + cpsb_addr = 0x32; + cpsb_value = 0x0401; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x08, 0x10, 0x20, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2eb": + case "sf2ua": + case "sf2ub": + case "sf2uk": + case "sf2qp1": + case "sf2thndr": + cpsb_addr = 0x08; + cpsb_value = 0x0407; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x14; + priority = new int[4] { 0x12, 0x10, 0x0e, 0x0c }; + palette_control = 0x0a; + layer_enable_mask = new int[5] { 0x08, 0x10, 0x02, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2ed": + case "sf2ud": + cpsb_addr = 0x20; + cpsb_value = 0x0005; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x28; + priority = new int[4] { 0x2a, 0x2c, 0x2e, 0x30 }; + palette_control = 0x32; + layer_enable_mask = new int[5] { 0x02, 0x08, 0x20, 0x14, 0x14 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2ee": + case "sf2ue": + cpsb_addr = 0x10; + cpsb_value = 0x0408; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x1c; + priority = new int[4] { 0x1a, 0x18, 0x16, 0x14 }; + palette_control = 0x12; + layer_enable_mask = new int[5] { 0x10, 0x08, 0x02, 0x00, 0x00 }; + in2_addr = 0x3c; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2uc": + cpsb_addr = 0x20; + cpsb_value = 0x0402; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2c; + priority = new int[4] { 0x2a, 0x28, 0x26, 0x24 }; + palette_control = 0x22; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2uf": + cpsb_addr = 0x0e; + cpsb_value = 0x0405; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x02; + priority = new int[4] { 0x04, 0x06, 0x08, 0x0a }; + palette_control = 0x0c; + layer_enable_mask = new int[5] { 0x04, 0x02, 0x20, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2ui": + cpsb_addr = 0x1e; + cpsb_value = 0x0404; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x12; + priority = new int[4] { 0x14, 0x16, 0x18, 0x1a }; + palette_control = 0x1c; + layer_enable_mask = new int[5] { 0x08, 0x20, 0x10, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2j": + case "sf2jh": + cpsb_addr = 0x2e; + cpsb_value = 0x0403; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x22; + priority = new int[4] { 0x24, 0x26, 0x28, 0x2a }; + palette_control = 0x2c; + layer_enable_mask = new int[5] { 0x20, 0x02, 0x04, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2ja": + case "sf2jl": + cpsb_addr = 0x08; + cpsb_value = 0x0407; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x14; + priority = new int[4] { 0x12, 0x10, 0x0e, 0x0c }; + palette_control = 0x0a; + layer_enable_mask = new int[5] { 0x08, 0x10, 0x02, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2jc": + cpsb_addr = 0x20; + cpsb_value = 0x0402; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2c; + priority = new int[4] { 0x2a, 0x28, 0x26, 0x24 }; + palette_control = 0x22; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2jf": + cpsb_addr = 0x0e; + cpsb_value = 0x0405; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x02; + priority = new int[4] { 0x04, 0x06, 0x08, 0x0a }; + palette_control = 0x0c; + layer_enable_mask = new int[5] { 0x04, 0x02, 0x20, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2ebbl": + case "sf2ebbl2": + case "sf2ebbl3": + cpsb_addr = 0x08; + cpsb_value = 0x0407; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x14; + priority = new int[4] { 0x12, 0x10, 0x0e, 0x0c }; + palette_control = 0x0a; + layer_enable_mask = new int[5] { 0x08, 0x10, 0x02, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 1; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "3wonders": + case "3wondersr1": + case "3wondersu": + case "wonder3": + cpsb_addr = 0x32; + cpsb_value = 0x0800; + mult_factor1 = 0x0e; + mult_factor2 = 0x0c; + mult_result_lo = 0x0a; + mult_result_hi = 0x08; + layer_control = 0x28; + priority = new int[4] { 0x26, 0x24, 0x22, 0x20 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x20, 0x04, 0x08, 0x12, 0x12 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0x9a; + dswc = 0x99; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x5400, 0x6fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x1400, 0x3fff, 0x4000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x07ff, 0x1000)); + lsRange2.Add(new gfx_range(0x0e00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x29ff, 0)); + lsRangeS.Add(new gfx_range(0x2a00, 0x3fff, 0x4000)); + break; + case "3wondersb": + cpsb_addr = 0x32; + cpsb_value = 0x0800; + mult_factor1 = 0x0e; + mult_factor2 = 0x0c; + mult_result_lo = 0x0a; + mult_result_hi = 0x08; + layer_control = 0x28; + priority = new int[4] { 0x26, 0x24, 0x22, 0x20 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x20, 0x04, 0x08, 0x12, 0x12 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0x88; + dswa = 0xff; + dswb = 0x9a; + dswc = 0x99; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x5400, 0x6fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x1400, 0x3fff, 0x4000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x07ff, 0x1000)); + lsRange2.Add(new gfx_range(0x0e00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x29ff, 0)); + lsRangeS.Add(new gfx_range(0x2a00, 0x3fff, 0x4000)); + break; + case "3wondersh": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = 0x0e; + mult_factor2 = 0x0c; + mult_result_lo = 0x0a; + mult_result_hi = 0x08; + layer_control = 0x28; + priority = new int[4] { 0x26, 0x24, 0x22, 0x20 }; + palette_control = 0x22; + layer_enable_mask = new int[5] { 0x20, 0x04, 0x08, 0x12, 0x12 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0x9a; + dswc = 0x99; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x5400, 0x6fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x1400, 0x3fff, 0x4000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x07ff, 0x1000)); + lsRange2.Add(new gfx_range(0x0e00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x29ff, 0)); + lsRangeS.Add(new gfx_range(0x2a00, 0x3fff, 0x4000)); + break; + case "kod": + case "kodr1": + case "kodu": + case "kodj": + case "kodja": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = 0x1e; + mult_factor2 = 0x1c; + mult_result_lo = 0x1a; + mult_result_hi = 0x18; + layer_control = 0x20; + priority = new int[4] { 0x2e, 0x2c, 0x2a, 0x28 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x30, 0x08, 0x30, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x34; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0xc000, 0xd7ff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x4800, 0x5fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1b00, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x47ff, 0)); + break; + case "captcomm": + case "captcommr1": + case "captcommu": + case "captcommj": + case "captcommjr1": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = 0x06; + mult_factor2 = 0x04; + mult_result_lo = 0x02; + mult_result_hi = 0x00; + layer_control = 0x20; + priority = new int[4] { 0x2e, 0x2c, 0x2a, 0x28 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x20, 0x12, 0x12, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x38; + out2_addr = 0x34; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x8000, 0xffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1000, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x7fff, 0)); + break; + case "captcommb": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = 0x06; + mult_factor2 = 0x04; + mult_result_lo = 0x02; + mult_result_hi = 0x00; + layer_control = 0x20; + priority = new int[4] { 0x2e, 0x2c, 0x2a, 0x28 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x20, 0x12, 0x12, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x38; + out2_addr = 0x34; + bootleg_kludge = 3; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x8000, 0xffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1000, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x7fff, 0)); + break; + case "knights": + case "knightsu": + case "knightsj": + case "knightsja": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = 0x06; + mult_factor2 = 0x04; + mult_result_lo = 0x02; + mult_result_hi = 0x00; + layer_control = 0x28; + priority = new int[4] { 0x26, 0x24, 0x22, 0x20 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x20, 0x10, 0x02, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x34; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x8000, 0x9fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x67ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1a00, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x67ff, 0)); + break; + case "sf2ce": + case "sf2ceea": + case "sf2ceua": + case "sf2ceub": + case "sf2ceuc": + case "sf2ceja": + case "sf2cejb": + case "sf2cejc": + case "sf2bhh": + case "sf2rb": + case "sf2rb2": + case "sf2rb3": + case "sf2red": + case "sf2v004": + case "sf2acc": + case "sf2acca": + case "sf2accp2": + case "sf2ceblp": + case "sf2cebltw": + case "sf2dkot2": + case "sf2dongb": + case "sf2hf": + case "sf2hfu": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2amf2": + case "sf2m5": + case "sf2m6": + case "sf2m7": + case "sf2yyc": + case "sf2koryu": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 1; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2m2": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 1; + dswa = 0xff; + dswb = 0xec; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2m3": + case "sf2m8": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x14; + priority = new int[4] { 0x12, 0x10, 0x0e, 0x0c }; + palette_control = 0x0a; + layer_enable_mask = new int[5] { 0x0e, 0x0e, 0x0e, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 2; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2m4": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x14; + priority = new int[4] { 0x12, 0x10, 0x0e, 0x0c }; + palette_control = 0x0a; + layer_enable_mask = new int[5] { 0x0e, 0x0e, 0x0e, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 1; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "sf2m10": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x14; + priority = new int[4] { 0x12, 0x10, 0x0e, 0x0c }; + palette_control = 0x0a; + layer_enable_mask = new int[5] { 0x0e, 0x0e, 0x0e, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 1; + dswa = 0xff; + dswb = 0xfc; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "cworld2j": + case "cworld2jb": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x20; + priority = new int[4] { 0x2e, 0x2c, 0x2a, 0x28 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x20, 0x14, 0x14, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x34; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfe; + dswc = 0xdf; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7800, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x37ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0e00, 0x0eff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x37ff, 0)); + break; + case "cworld2ja": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfe; + dswc = 0xdf; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7800, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x37ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0e00, 0x0eff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x37ff, 0)); + break; + case "varth": + case "varthr1": + case "varthu": + cpsb_addr = 0x20; + cpsb_value = 0x0004; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2e; + priority = new int[4] { 0x26, 0x30, 0x28, 0x32 }; + palette_control = 0x2a; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x3fff, 0)); + break; + case "varthj": + case "varthjr": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x0e; + mult_factor2 = 0x0c; + mult_result_lo = 0x0a; + mult_result_hi = 0x08; + layer_control = 0x20; + priority = new int[4] { 0x2e, 0x2c, 0x2a, 0x28 }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x20, 0x04, 0x02, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x3fff, 0)); + break; + case "qad": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2c; + priority = new int[4] { -1, -1, -1, -1 }; + palette_control = 0x12; + layer_enable_mask = new int[5] { 0x14, 0x02, 0x14, 0x00, 0x00 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x3fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x1fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x07ff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x1fff, 0)); + break; + case "qadjr": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x38; + out2_addr = 0x34; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xdf; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x07ff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x1000, 0x3fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0100, 0x03ff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x1000, 0x3fff, 0)); + break; + case "wof": + case "wofu": + case "wofj": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x22; + priority = new int[4] { 0x24, 0x26, 0x28, 0x2a }; + palette_control = 0x2c; + layer_enable_mask = new int[5] { 0x10, 0x08, 0x04, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0xffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0xffff, 0)); + break; + case "wofr1": + case "wofa": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0xffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0xffff, 0)); + break; + case "wofhfh": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xec; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0xffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0xffff, 0)); + break; + case "sf2hfj": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xf4; + dswc = 0x9f; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x4000, 0x4fff, 0x10000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2800, 0x3fff, 0x8000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0400, 0x07ff, 0x2000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x8fff, 0)); + break; + case "dino": + case "dinou": + case "dinoj": + cpsb_addr = -1; + cpsb_value = -1; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x0a; + priority = new int[4] { 0x0c, 0x0e, 0x00, 0x02 }; + palette_control = 0x04; + layer_enable_mask = new int[5] { 0x16, 0x16, 0x16, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x4000, 0x6fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1c00, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0x6fff, 0)); + break; + case "dinohunt": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xdc; + dswc = 0x9e; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x4000, 0x6fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1c00, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0x6fff, 0)); + break; + case "punisher": + case "punisheru": + case "punisherh": + case "punisherj": + cpsb_addr = 0x0e; + cpsb_value = 0x0c00; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x12; + priority = new int[4] { 0x14, 0x16, 0x08, 0x0a }; + palette_control = 0x0c; + layer_enable_mask = new int[5] { 0x04, 0x02, 0x20, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x4000, 0x6dff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1b80, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0x6dff, 0)); + break; + case "punisherbz": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xef; + dswb = 0x94; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x4000, 0x6dff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1b80, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0x6dff, 0)); + break; + case "slammast": + case "slammastu": + case "mbomberj": + cpsb_addr = 0x2e; + cpsb_value = 0x0c01; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x16; + priority = new int[4] { 0x00, 0x02, 0x28, 0x2a }; + palette_control = 0x2c; + layer_enable_mask = new int[5] { 0x04, 0x08, 0x10, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0800, 0xb3ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x2d00, 0x2fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0xb3ff, 0)); + break; + case "mbombrd": + case "mbombrdj": + cpsb_addr = 0x1e; + cpsb_value = 0x0c02; + mult_factor1 = -1; + mult_factor2 = -1; + mult_result_lo = -1; + mult_result_hi = -1; + layer_control = 0x2a; + priority = new int[4] { 0x2c, 0x2e, 0x30, 0x32 }; + palette_control = 0x1c; + layer_enable_mask = new int[5] { 0x04, 0x08, 0x10, 0x00, 0x00 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0800, 0xb3ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x2d00, 0x2fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0xb3ff, 0)); + break; + case "pnickj": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0xdf; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0800, 0x2fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0c00, 0x0fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0x2fff, 0)); + break; + case "qtono2j": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x38; + out2_addr = 0x34; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfc; + dswc = 0xdf; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x0fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x7fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0200, 0x07ff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0800, 0x2fff, 0)); + break; + case "megaman": + case "megamana": + case "rockmanj": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xfe; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x1ffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0xffff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x3fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0xffff, 0)); + break; + case "pang3": + case "pang3r1": + case "pang3j": + case "pang3b": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0xa000, 0xbfff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x4fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x1800, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x4fff, 0)); + break; + case "pokonyan": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x36; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xbe; + dswb = 0xfb; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x7000, 0x7fff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x2000, 0x37ff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0600, 0x07ff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x17ff, 0)); + break; + case "wofch": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0xffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0x7fff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x1fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0x7fff, 0)); + break; + case "sfzch": + case "sfach": + case "sfzbch": + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + dswa = 0xff; + dswb = 0xff; + dswc = 0xff; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x1ffff, 0)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0xffff, 0)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x3fff, 0)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0xffff, 0)); + break; + } + if (cps_version == 2) + { + cpsb_addr = 0x32; + cpsb_value = -1; + mult_factor1 = 0x00; + mult_factor2 = 0x02; + mult_result_lo = 0x04; + mult_result_hi = 0x06; + layer_control = 0x26; + priority = new int[4] { 0x28, 0x2a, 0x2c, 0x2e }; + palette_control = 0x30; + layer_enable_mask = new int[5] { 0x02, 0x04, 0x08, 0x30, 0x30 }; + in2_addr = 0x00; + in3_addr = 0x00; + out2_addr = 0x00; + bootleg_kludge = 0; + lsRange0 = new List(); + lsRange0.Add(new gfx_range(0x0000, 0x1ffff, 0x20000)); + lsRange1 = new List(); + lsRange1.Add(new gfx_range(0x0000, 0xffff, 0x10000)); + lsRange2 = new List(); + lsRange2.Add(new gfx_range(0x0000, 0x3fff, 0x4000)); + lsRangeS = new List(); + lsRangeS.Add(new gfx_range(0x0000, 0xffff, 0)); + } + } + } + public static sbyte cps1_dsw_r(int offset) + { + string[] dswname = { "IN0", "DSWA", "DSWB", "DSWC" }; + int in0 = 0; + if (offset == 0) + { + in0 = sbyte0; + } + else if (offset == 1) + { + in0 = dswa; + } + else if (offset == 2) + { + in0 = dswb; + } + else if (offset == 3) + { + in0 = dswc; + } + else + { + in0 = 0; + } + return (sbyte)in0; + } + public static void cps1_snd_bankswitch_w(byte data) + { + int bankaddr; + bankaddr = ((data & 1) * 0x4000); + basebanksnd = 0x10000 + bankaddr; + } + public static void cps1_oki_pin7_w(byte data) + { + OKI6295.okim6295_set_pin7(data & 1); + } + public static void cps1_coinctrl_w(ushort data) + { + Generic.coin_counter_w(0, data & 0x0100); + Generic.coin_counter_w(1, data & 0x0200); + Generic.coin_lockout_w(0, ~data & 0x0400); + Generic.coin_lockout_w(1, ~data & 0x0800); + } + public static void qsound_banksw_w(byte data) + { + basebanksnd = 0x10000 + ((data & 0x0f) * 0x4000); + } + public static short qsound_rom_r(int offset) + { + if (user1rom != null) + { + return (short)(user1rom[offset] | 0xff00); + } + else + { + return 0; + } + } + public static short qsound_sharedram1_r(int offset) + { + return (short)(qsound_sharedram1[offset] | 0xff00); + } + public static void qsound_sharedram1_w(int offset, byte data) + { + qsound_sharedram1[offset] = (byte)data; + } + public static short qsound_sharedram2_r(int offset) + { + return (short)(qsound_sharedram2[offset] | 0xff00); + } + public static void qsound_sharedram2_w(int offset, byte data) + { + qsound_sharedram2[offset] = (byte)(data); + } + public static void cps1_interrupt() + { + Cpuint.cpunum_set_input_line(0, 2, LineState.HOLD_LINE); + } + public static void cpsq_coinctrl2_w(ushort data) + { + Generic.coin_counter_w(2, data & 0x01); + Generic.coin_lockout_w(2, ~data & 0x02); + Generic.coin_counter_w(3, data & 0x04); + Generic.coin_lockout_w(3, ~data & 0x08); + } + public static int cps1_eeprom_port_r() + { + return Eeprom.eeprom_read_bit(); + } + public static void cps1_eeprom_port_w(int data) + { + /* + bit 0 = data + bit 6 = clock + bit 7 = cs + */ + Eeprom.eeprom_write_bit(data & 0x01); + Eeprom.eeprom_set_cs_line(((data & 0x80) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line(((data & 0x40) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void sf2m3_layer_w(ushort data) + { + cps1_cps_b_w(0x0a, data); + } + public static short cps2_objram2_r(int offset) + { + if ((cps2_objram_bank & 1) != 0) + { + return (short)cps2_objram1[offset]; + } + else + { + return (short)cps2_objram2[offset]; + } + } + public static void cps2_objram1_w(int offset, ushort data) + { + if ((cps2_objram_bank & 1) != 0) + { + cps2_objram2[offset] = data; + } + else + { + cps2_objram1[offset] = data; + } + } + public static void cps2_objram2_w(int offset, ushort data) + { + if ((cps2_objram_bank & 1) != 0) + { + cps2_objram1[offset] = data; + } + else + { + cps2_objram2[offset] = data; + } + } + public static short cps2_qsound_volume_r() + { + if (cps2networkpresent != 0) + { + return (short)0x2021; + } + else + { + return unchecked((short)(0xe021)); + } + } + public static short kludge_r() + { + return -1; + } + public static void cps2_eeprom_port_bh(int data) + { + data = (data & 0xff) << 8; + Eeprom.eeprom_write_bit(data & 0x1000); + Eeprom.eeprom_set_clock_line(((data & 0x2000) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + Eeprom.eeprom_set_cs_line(((data & 0x4000) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + } + public static void cps2_eeprom_port_bl(int data) + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, ((data & 0x0008) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Generic.coin_counter_w(0, data & 0x0001); + Generic.coin_counter_w(1, data & 0x0002); + Generic.coin_lockout_w(0, ~data & 0x0010); + Generic.coin_lockout_w(1, ~data & 0x0020); + Generic.coin_lockout_w(2, ~data & 0x0040); + Generic.coin_lockout_w(3, ~data & 0x0080); + } + public static void cps2_eeprom_port_w(int data) + { + //high 8 bits + { + /* bit 0 - Unused */ + /* bit 1 - Unused */ + /* bit 2 - Unused */ + /* bit 3 - Unused? */ + /* bit 4 - Eeprom data */ + /* bit 5 - Eeprom clock */ + /* bit 6 - */ + /* bit 7 - */ + + /* EEPROM */ + Eeprom.eeprom_write_bit(data & 0x1000); + Eeprom.eeprom_set_clock_line(((data & 0x2000) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + Eeprom.eeprom_set_cs_line(((data & 0x4000) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + } + //low 8 bits + { + /* bit 0 - coin counter 1 */ + /* bit 0 - coin counter 2 */ + /* bit 2 - Unused */ + /* bit 3 - Allows access to Z80 address space (Z80 reset) */ + /* bit 4 - lock 1 */ + /* bit 5 - lock 2 */ + /* bit 6 - */ + /* bit 7 - */ + + /* Z80 Reset */ + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, ((data & 0x0008) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + + Generic.coin_counter_w(0, data & 0x0001); + Generic.coin_counter_w(1, data & 0x0002); + + Generic.coin_lockout_w(0, ~data & 0x0010); + Generic.coin_lockout_w(1, ~data & 0x0020); + Generic.coin_lockout_w(2, ~data & 0x0040); + Generic.coin_lockout_w(3, ~data & 0x0080); + + /* + set_led_status(0,data & 0x01); + set_led_status(1,data & 0x10); + set_led_status(2,data & 0x20); + */ + } + } + public static void cps2_objram_bank_w(int data) + { + cps2_objram_bank = data & 1; + } + public static void cps2_interrupt() + { + /* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */ + if (scancount >= 261) + { + scancount = -1; + cps1_scancalls = 0; + } + scancount++; + if ((cps_b_regs[0x10 / 2] & 0x8000) != 0) + { + cps_b_regs[0x10 / 2] = (ushort)(cps_b_regs[0x10 / 2] & 0x1ff); + } + if ((cps_b_regs[0x12 / 2] & 0x8000) != 0) + { + cps_b_regs[0x12 / 2] = (ushort)(cps_b_regs[0x12 / 2] & 0x1ff); + } + /*if(cps1_scanline1 == scancount || (cps1_scanline1 < scancount && (cps1_scancalls!=0))) + { + CPS1.cps1_cps_b_regs[0x10 / 2] = 0; + + cpunum_set_input_line(machine, 0, 4, HOLD_LINE); + cps2_set_sprite_priorities(); + video_screen_update_partial(machine->primary_screen, 16 - 10 + scancount); + cps1_scancalls++; + } + if(cps1_scanline2 == scancount || (cps1_scanline2 < scancount && !cps1_scancalls)) + { + cps1_cps_b_regs[0x12/2] = 0; + cpunum_set_input_line(machine, 0, 4, HOLD_LINE); + cps2_set_sprite_priorities(); + video_screen_update_partial(machine->primary_screen, 16 - 10 + scancount); + cps1_scancalls++; + }*/ + if (scancount == 256) /* VBlank */ + { + cps_b_regs[0x10 / 2] = (ushort)cps1_scanline1; + cps_b_regs[0x12 / 2] = (ushort)cps1_scanline2; + Cpuint.cpunum_set_input_line(0, 2, LineState.HOLD_LINE); + if (cps1_scancalls != 0) + { + cps2_set_sprite_priorities(); + //video_screen_update_partial(machine->primary_screen, 256); + } + cps2_objram_latch(); + } + } + public static void machine_reset_cps() + { + basebanksnd = 0; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/CPS.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/CPS.cs.meta new file mode 100644 index 00000000..b43e4fd7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/CPS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8169b3aa90ee1ff449cc0654c190fe69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Drawgfx.cs new file mode 100644 index 00000000..ba0df7b8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Drawgfx.cs @@ -0,0 +1,108 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_c(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, uint primask, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + code %= CPS.total_elements; + ox = sx; + oy = sy; + ex = sx + 0x0f; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x200) + { + ex = 0x200 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x0f; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x200) + { + ey = 0x200 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; /* left skip */ + int ts = sy - oy; /* top skip */ + int dw = ex - sx + 1; /* dest width */ + int dh = ey - sy + 1; /* dest height */ + int colorbase = 0x10 * color; + blockmove_4toN_transpen_pri16(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx, primask); + } + private unsafe static void blockmove_4toN_transpen_pri16(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsety, int offsetx, uint primask) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * 0x100; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0x0f) + { + if (((1 << (Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x1f)) & primask) == 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] = (byte)((Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x7f) | 0x1f); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Drawgfx.cs.meta new file mode 100644 index 00000000..a9dba05c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0164efbc240d4b841a48a495ec6e4562 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Input.cs new file mode 100644 index 00000000..75b765a0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Input.cs @@ -0,0 +1,1484 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class CPS + { + public static void loop_inputports_cps1_6b() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short1 &= ~0x01; + } + else + { + short1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short1 &= ~0x02; + } + else + { + short1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short1 &= ~0x04; + } + else + { + short1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short1 &= ~0x08; + } + else + { + short1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short1 &= ~0x10; + } + else + { + short1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short1 &= ~0x20; + } + else + { + short1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short1 &= ~0x40; + } + else + { + short1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short2 &= ~0x01; + } + else + { + short2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + short2 &= ~0x02; + } + else + { + short2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + short2 &= ~0x04; + } + else + { + short2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short1 &= ~0x0100; + } + else + { + short1 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short1 &= ~0x0200; + } + else + { + short1 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short1 &= ~0x0400; + } + else + { + short1 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short1 &= ~0x0800; + } + else + { + short1 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short1 &= ~0x2000; + } + else + { + short1 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short1 &= ~0x4000; + } + else + { + short1 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short2 &= ~0x10; + } + else + { + short2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + short2 &= ~0x20; + } + else + { + short2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + short2 &= ~0x40; + } + else + { + short2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte0 &= ~0x40; + } + else + { + sbyte0 |= 0x40; + } + } + public static void loop_inputports_cps1_forgottn() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short1 &= ~0x01; + } + else + { + short1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short1 &= ~0x02; + } + else + { + short1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short1 &= ~0x04; + } + else + { + short1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short1 &= ~0x08; + } + else + { + short1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short1 &= ~0x10; + } + else + { + short1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short1 &= ~0x0100; + } + else + { + short1 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short1 &= ~0x0200; + } + else + { + short1 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short1 &= ~0x0400; + } + else + { + short1 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short1 &= ~0x0800; + } + else + { + short1 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte0 &= ~0x40; + } + else + { + sbyte0 |= 0x40; + } + Inptport.frame_update_analog_field_forgottn_p0(Inptport.analog_p0); + Inptport.frame_update_analog_field_forgottn_p1(Inptport.analog_p1); + } + public static void loop_inputports_cps1_sf2hack() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short1 &= ~0x01; + } + else + { + short1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short1 &= ~0x02; + } + else + { + short1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short1 &= ~0x04; + } + else + { + short1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short1 &= ~0x08; + } + else + { + short1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short1 &= ~0x10; + } + else + { + short1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short1 &= ~0x20; + } + else + { + short1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short1 &= ~0x40; + } + else + { + short1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + short2 &= ~0x0200; + } + else + { + short2 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + short2 &= ~0x0400; + } + else + { + short2 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short1 &= ~0x0100; + } + else + { + short1 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short1 &= ~0x0200; + } + else + { + short1 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short1 &= ~0x0400; + } + else + { + short1 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short1 &= ~0x0800; + } + else + { + short1 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short1 &= ~0x2000; + } + else + { + short1 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short1 &= ~0x4000; + } + else + { + short1 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short2 &= ~0x1000; + } + else + { + short2 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + short2 &= ~0x2000; + } + else + { + short2 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + short2 &= ~0x4000; + } + else + { + short2 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte0 &= ~0x40; + } + else + { + sbyte0 |= 0x40; + } + } + public static void loop_inputports_cps1_cworld2j() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short1 &= ~0x10; + } + else + { + short1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short1 &= ~0x20; + } + else + { + short1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short1 &= ~0x40; + } + else + { + short1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short1 &= ~0x80; + } + else + { + short1 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short1 &= ~0x2000; + } + else + { + short1 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short1 &= ~0x4000; + } + else + { + short1 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short1 &= unchecked((short)~0x8000); + } + else + { + short1 |= unchecked((short)0x8000); + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte0 &= ~0x40; + } + else + { + sbyte0 |= 0x40; + } + } + public static void loop_inputports_cps2_2p6b() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short2 &= ~0x1000; + } + else + { + short2 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short2 &= ~0x2000; + } + else + { + short2 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + short2 &= ~0x0200; + } + else + { + short2 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short0 &= ~0x0001; + } + else + { + short0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short0 &= ~0x0002; + } + else + { + short0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short0 &= ~0x0004; + } + else + { + short0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short0 &= ~0x0008; + } + else + { + short0 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short0 &= ~0x0010; + } + else + { + short0 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short0 &= ~0x0020; + } + else + { + short0 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short0 &= ~0x0040; + } + else + { + short0 |= 0x0040; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short1 &= ~0x0001; + } + else + { + short1 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + short1 &= ~0x0002; + } + else + { + short1 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + short1 &= ~0x0004; + } + else + { + short1 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short0 &= ~0x0800; + } + else + { + short0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short0 &= ~0x1000; + } + else + { + short0 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short0 &= ~0x2000; + } + else + { + short0 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short0 &= ~0x4000; + } + else + { + short0 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short1 &= ~0x0010; + } + else + { + short1 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + short1 &= ~0x0020; + } + else + { + short1 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + short2 &= ~0x4000; + } + else + { + short2 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + short2 &= ~0x0004; + } + else + { + short2 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + short2 &= ~0x0002; + } + else + { + short2 |= 0x0002; + } + } + public static void loop_inputports_cps2_pzloop2() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short2 &= ~0x1000; + } + else + { + short2 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short2 &= ~0x2000; + } + else + { + short2 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + short2 &= ~0x0200; + } + else + { + short2 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short0 &= ~0x0001; + } + else + { + short0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short0 &= ~0x0002; + } + else + { + short0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short0 &= ~0x0004; + } + else + { + short0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short0 &= ~0x0008; + } + else + { + short0 |= 0x0008; + } + if ((short0 & 0x0003) == 0) + { + short0 |= 0x0003; + } + if ((short0 & 0x000c) == 0) + { + short0 |= 0x000c; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short0 &= ~0x0010; + } + else + { + short0 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short0 &= ~0x0020; + } + else + { + short0 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short0 &= ~0x0040; + } + else + { + short0 |= 0x0040; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short1 &= ~0x0001; + } + else + { + short1 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + short1 &= ~0x0002; + } + else + { + short1 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + short1 &= ~0x0004; + } + else + { + short1 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short0 &= ~0x0800; + } + else + { + short0 |= 0x0800; + } + if ((short0 & 0x0300) == 0) + { + short0 |= 0x0300; + } + if ((short0 & 0x0c00) == 0) + { + short0 |= 0x0c00; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short0 &= ~0x1000; + } + else + { + short0 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short0 &= ~0x2000; + } + else + { + short0 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short0 &= ~0x4000; + } + else + { + short0 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short1 &= ~0x0010; + } + else + { + short1 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + short1 &= ~0x0020; + } + else + { + short1 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + short2 &= ~0x4000; + } + else + { + short2 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + short2 &= ~0x0004; + } + else + { + short2 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + short2 &= ~0x0002; + } + else + { + short2 |= 0x0002; + } + } + public static void loop_inputports_cps2_ecofghtr() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short2 &= ~0x1000; + } + else + { + short2 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short2 &= ~0x2000; + } + else + { + short2 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + short2 &= ~0x0200; + } + else + { + short2 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short0 &= ~0x0001; + } + else + { + short0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short0 &= ~0x0002; + } + else + { + short0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short0 &= ~0x0004; + } + else + { + short0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short0 &= ~0x0008; + } + else + { + short0 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short0 &= ~0x0010; + } + else + { + short0 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short0 &= ~0x0020; + } + else + { + short0 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short0 &= ~0x0040; + } + else + { + short0 |= 0x0040; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short0 &= ~0x0800; + } + else + { + short0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short0 &= ~0x1000; + } + else + { + short0 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short0 &= ~0x2000; + } + else + { + short0 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short0 &= ~0x4000; + } + else + { + short0 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + short2 &= ~0x0004; + } + else + { + short2 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + short2 &= ~0x0002; + } + else + { + short2 |= 0x0002; + } + Inptport.frame_update_analog_field_ecofghtr_p0(Inptport.analog_p0); + Inptport.frame_update_analog_field_ecofghtr_p1(Inptport.analog_p1); + } + public static void loop_inputports_cps2_qndream() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short2 &= ~0x1000; + } + else + { + short2 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short2 &= ~0x2000; + } + else + { + short2 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + short2 &= ~0x0200; + } + else + { + short2 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short0 &= ~0x0008; + } + else + { + short0 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short0 &= ~0x0004; + } + else + { + short0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short0 &= ~0x0002; + } + else + { + short0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short0 &= ~0x0001; + } + else + { + short0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short0 &= ~0x0800; + } + else + { + short0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + short2 &= ~0x0004; + } + else + { + short2 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + short2 &= ~0x0002; + } + else + { + short2 |= 0x0002; + } + } + public static void record_portC() + { + if (sbyte0 != sbyte0_old || short1 != short1_old || short2 != short2_old || sbyte3 != sbyte3_old) + { + sbyte0_old = sbyte0; + short1_old = short1; + short2_old = short2; + sbyte3_old = sbyte3; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(short1); + Mame.bwRecord.Write(short2); + Mame.bwRecord.Write(sbyte3); + } + } + public static void record_portC2() + { + if (short0 != short0_old || short1 != short1_old || short2 != short2_old) + { + short0_old = short0; + short1_old = short1; + short2_old = short2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(short0); + Mame.bwRecord.Write(short1); + Mame.bwRecord.Write(short2); + } + } + public static void replay_portC() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + short1_old = Mame.brRecord.ReadInt16(); + short2_old = Mame.brRecord.ReadInt16(); + sbyte3_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + short1 = short1_old; + short2 = short2_old; + sbyte3 = sbyte3_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + public static void replay_portC2() + { + if (Inptport.bReplayRead) + { + try + { + Video.screenstate.frame_number = Mame.brRecord.ReadInt64(); + short0_old = Mame.brRecord.ReadInt16(); + short1_old = Mame.brRecord.ReadInt16(); + short2_old = Mame.brRecord.ReadInt16(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Attotime.attotime_compare(EmuTimer.global_basetime, EmuTimer.global_basetime_obj) == 0) + { + short0 = short0_old; + short1 = short1_old; + short2 = short2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Input.cs.meta new file mode 100644 index 00000000..6974d03b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ae7b0aec7a8fc544aa6bc999057fafe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory.cs new file mode 100644 index 00000000..bfca9572 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory.cs @@ -0,0 +1,1794 @@ +using cpu.z80; + +namespace MAME.Core +{ + public unsafe partial class CPS + { + public static short short0, short1, short2; + public static sbyte sbyte0, sbyte3; + public static short short0_old, short1_old, short2_old; + public static sbyte sbyte0_old, sbyte3_old; + public static sbyte MCReadOpByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MCReadByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address <= 0x800007) + { + if (address == 0x800000) + { + result = (sbyte)(short1 >> 8); + } + else if (address == 0x800001) + { + result = (sbyte)(short1); + } + else + { + result = -1; + } + } + else if (address >= 0x800018 && address <= 0x80001f) + { + int offset = (address - 0x800018) / 2; + result = (sbyte)cps1_dsw_r(offset); + } + else if (address >= 0x800020 && address <= 0x800021) + { + result = 0; + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + if (address % 2 == 0) + { + result = (sbyte)(cps1_cps_b_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)cps1_cps_b_r(offset); + } + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + result = (sbyte)gfxram[(address & 0x3ffff)]; + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + return result; + } + public static short MCReadOpWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + return result; + } + public static short MCReadWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x800007) + { + result = short1;// input_port_4_word_r + } + else if (address >= 0x800018 && address + 1 <= 0x80001f) + { + int offset = (address - 0x800018) / 2; + result = (short)(((byte)(cps1_dsw_r(offset)) << 8) | (byte)cps1_dsw_r(offset)); + } + else if (address >= 0x800020 && address + 1 <= 0x800021) + { + result = 0; + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + return result; + } + public static int MCReadOpLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + return result; + } + public static int MCReadLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 3 <= 0x800007) + { + result = 0; + } + else if (address >= 0x800018 && address + 3 <= 0x80001f) + { + result = 0; + } + else if (address >= 0x800020 && address + 3 <= 0x800021) + { + result = 0; + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = cps1_cps_b_r(offset) * 0x10000 + cps1_cps_b_r(offset + 1); + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + return result; + } + public static void MCWriteByte(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x800030 && address <= 0x800037) + { + if (address % 2 == 0) + { + cps1_coinctrl_w((ushort)(value * 0x100)); + } + else + { + return; + } + } + else if (address >= 0x800100 && address <= 0x80013f) + { + return; + } + else if (address >= 0x800140 && address <= 0x80017f) + { + return; + } + else if (address >= 0x800180 && address <= 0x800187) + { + Sound.soundlatch_w((ushort)value); + } + else if (address >= 0x800188 && address <= 0x80018f) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static void MCWriteWord(int address, short value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 1 <= 0x800037) + { + return; + } + else if (address >= 0x800100 && address + 1 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800180 && address + 1 <= 0x800187) + { + Sound.soundlatch_w((ushort)value); + } + else if (address >= 0x800188 && address + 1 <= 0x80018f) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 1] = (byte)value; + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static void MCWriteLong(int address, int value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 3 <= 0x800037) + { + return; + } + else if (address >= 0x800100 && address + 3 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)(value >> 16)); + cps1_cps_a_w(((address + 2) & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)(value >> 16)); + cps1_cps_b_w(((address + 2) & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800180 && address + 3 <= 0x800187) + { + return; + } + else if (address >= 0x800188 && address + 3 <= 0x80018f) + { + return; + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 24); + gfxram[(address & 0x3ffff) + 1] = (byte)(value >> 16); + gfxram[(address & 0x3ffff) + 2] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 3] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + cps1_gfxram_w(((address + 2) & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public unsafe static byte ZCReadOp(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address & 0x7fff]; + } + else + { + result = 0; + } + return result; + } + public unsafe static byte ZCReadMemory(ushort address) + { + byte result = 0; + if (address < 0x8000) + { + result = Memory.audiorom[address & 0x7fff]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + result = Memory.audiorom[basebanksnd + (address & 0x3fff)]; + } + else if (address >= 0xd000 && address <= 0xd7ff) + { + result = Memory.audioram[address & 0x7ff]; + } + else if (address == 0xf001) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address == 0xf002) + { + result = OKI6295.okim6295_status_0_r(); + } + else if (address == 0xf008) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address == 0xf00a) + { + result = (byte)Sound.soundlatch2_r(); + } + else + { + result = 0; + } + return result; + } + + public static void ZCWriteMemory(ushort address, byte value) + { + if (address >= 0xd000 && address <= 0xd7ff) + { + Memory.audioram[address & 0x7ff] = value; + } + else if (address == 0xf000) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xf001) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address == 0xf002) + { + OKI6295.okim6295_data_0_w(value); + } + else if (address == 0xf004) + { + cps1_snd_bankswitch_w(value); + } + else if (address == 0xf006) + { + cps1_oki_pin7_w(value); + } + else + { + + } + } + public static sbyte MQReadOpByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + result = (sbyte)gfxram[(address & 0x3ffff)]; + } + return result; + } + public static sbyte MQReadByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address <= 0x800007) + { + if (address == 0x800000)//IN1 + { + result = (sbyte)(short1 >> 8); + } + else if (address == 0x800001) + { + result = (sbyte)(short1); + } + else + { + result = -1; + } + } + else if (address >= 0x800018 && address <= 0x80001f) + { + int offset = (address - 0x800018) / 2; + result = (sbyte)cps1_dsw_r(offset); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + result = (sbyte)gfxram[(address & 0x3ffff)]; + } + else if (address >= 0xf00000 && address <= 0xf0ffff) + { + int offset = (address - 0xf00000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(qsound_rom_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)qsound_rom_r(offset); + } + } + else if (address >= 0xf18000 && address <= 0xf19fff) + { + int offset = (address - 0xf18000) / 2; + result = (sbyte)qsound_sharedram1_r(offset); + } + else if (address >= 0xf1c000 && address <= 0xf1c001) + { + result = (sbyte)short2; + } + else if (address >= 0xf1c002 && address <= 0xf1c003) + { + result = sbyte3; + } + else if (address >= 0xf1c006 && address <= 0xf1c007) + { + result = (sbyte)cps1_eeprom_port_r(); + } + else if (address >= 0xf1e000 && address <= 0xf1ffff) + { + int offset = (address - 0xf1e000) / 2; + result = (sbyte)qsound_sharedram2_r(offset); + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + return result; + } + public static short MQReadOpWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + return result; + } + public static short MQReadWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x800007) + { + result = short1;//input_port_4_word_r + } + else if (address >= 0x800018 && address + 1 <= 0x80001f) + { + int offset = (address - 0x800018) / 2; + result = cps1_dsw_r(offset); + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xf00000 && address + 1 <= 0xf0ffff) + { + int offset = (address - 0xf00000) / 2; + result = qsound_rom_r(offset); + } + else if (address >= 0xf18000 && address + 1 <= 0xf19fff) + { + int offset = (address - 0xf18000) / 2; + result = qsound_sharedram1_r(offset); + } + else if (address >= 0xf1c000 && address + 1 <= 0xf1c001) + { + result = (short)((int)short2 & 0xff); + } + else if (address >= 0xf1c002 && address + 1 <= 0xf1c003) + { + result = (short)((int)sbyte3 & 0xff); + } + else if (address >= 0xf1c006 && address + 1 <= 0xf1c007) + { + result = (short)cps1_eeprom_port_r(); + } + else if (address >= 0xf1e000 && address + 1 <= 0xf1ffff) + { + int offset = (address - 0xf1e000) / 2; + result = qsound_sharedram2_r(offset); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + return result; + } + public static int MQReadOpLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + return result; + } + public static int MQReadLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 3 <= 0x800007) + { + result = -1;//short1 + } + else if (address >= 0x800018 && address + 3 <= 0x80001f) + { + result = 0;//cps1_dsw_r + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + result = 0;//cps1_cps_b_r + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xf00000 && address + 3 <= 0xf0ffff) + { + result = 0;//qsound_rom_r + } + else if (address >= 0xf18000 && address + 3 <= 0xf19fff) + { + result = 0;//qsound_sharedram1_r + } + else if (address >= 0xf1c000 && address + 3 <= 0xf1c001) + { + result = (int)short2 & 0xff; + } + else if (address >= 0xf1c002 && address + 3 <= 0xf1c003) + { + result = (int)sbyte3 & 0xff; + } + else if (address >= 0xf1c006 && address + 3 <= 0xf1c007) + { + result = 0;//cps1_eeprom_port_r(); + } + else if (address >= 0xf1e000 && address + 3 <= 0xf1ffff) + { + result = 0;//qsound_sharedram2_r + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + return result; + } + public static void MQWriteByte(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x800030 && address <= 0x800037) + { + if (address % 2 == 0) + { + cps1_coinctrl_w((ushort)(value * 0x100)); + } + else + { + int i11 = 1; + } + } + else if (address >= 0x800100 && address <= 0x80013f) + { + int i11 = 1;//cps1_cps_a_w + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int i11 = 1;//cps1_cps_b_w + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xf18000 && address <= 0xf19fff) + { + int offset = (address - 0xf18000) / 2; + if ((address & 1) == 1) + { + qsound_sharedram1_w(offset, (byte)value); + } + else + { + int i1 = 1; + } + } + else if (address >= 0xf1c004 && address <= 0xf1c005) + { + int i11 = 1;//cpsq_coinctrl2_w + } + else if (address >= 0xf1c006 && address <= 0xf1c007) + { + if ((address & 1) == 1) + { + cps1_eeprom_port_w(value); + } + } + else if (address >= 0xf1e000 && address <= 0xf1ffff) + { + int offset = (address - 0xf1e000) / 2; + if ((address & 1) == 1) + { + qsound_sharedram2_w(offset, (byte)value); + } + else + { + int i1 = 1; + } + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value); + } + else + { + int i11 = 1; + } + } + public static void MQWriteWord(int address, short value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 1 <= 0x800037) + { + if (address % 2 == 0) + { + cps1_coinctrl_w((ushort)(value * 0x100)); + } + else + { + int i11 = 1; + } + } + else if (address >= 0x800100 && address + 1 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 1] = (byte)value; + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xf18000 && address + 1 <= 0xf19fff) + { + qsound_sharedram1_w((address - 0xf18000) >> 1, (byte)value); + } + else if (address >= 0xf1c004 && address + 1 <= 0xf1c005) + { + cpsq_coinctrl2_w((ushort)value); + } + else if (address >= 0xf1c006 && address + 1 <= 0xf1c007) + { + cps1_eeprom_port_w(value); + } + else if (address >= 0xf1e000 && address + 1 <= 0xf1ffff) + { + qsound_sharedram2_w((address - 0xf1e000) >> 1, (byte)value); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); + } + else + { + int i11 = 1; + } + } + public static void MQWriteLong(int address, int value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 3 <= 0x800037) + { + return; + } + else if (address >= 0x800100 && address + 3 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)(value >> 16)); + cps1_cps_a_w(((address + 2) & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + return;//cps1_cps_b_w + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + if (address == 0x904000) + { + int i11 = 1; + } + gfxram[(address & 0x3ffff)] = (byte)(value >> 24); + gfxram[(address & 0x3ffff) + 1] = (byte)(value >> 16); + gfxram[(address & 0x3ffff) + 2] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 3] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + cps1_gfxram_w(((address + 2) & 0x3ffff) / 2); + if (address == 0x00914000 && value != 0) + { + //int i11 = 1; + } + } + else if (address >= 0xf18000 && address + 3 <= 0xf19fff) + { + int i11 = 1;//qsound_sharedram1_w + } + else if (address >= 0xf1c004 && address + 3 <= 0xf1c005) + { + int i11 = 1;//cpsq_coinctrl2_w + } + else if (address >= 0xf1c006 && address + 3 <= 0xf1c007) + { + int i11 = 1;//cps1_eeprom_port_w + } + else if (address >= 0xf1e000 && address + 3 <= 0xf1ffff) + { + int i11 = 1;//qsound_sharedram2_w + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); + } + else + { + int i11 = 1; + } + } + public static sbyte MC2ReadOpByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < mainromopLength) + { + result = (sbyte)(mainromop[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MC2ReadPcrelByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < mainromopLength) + { + result = (sbyte)mainromop[address]; + } + else + { + result = 0; + + } + } + else + { + result = MC2ReadByte(address); + } + return result; + } + public static sbyte MC2ReadByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + result = (sbyte)cps2_output[offset]; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + result = (sbyte)qsound_sharedram1_r(offset); + } + else if (address >= 0x662000 && address <= 0x662001) + { + result = 0; + } + else if (address >= 0x662008 && address <= 0x662009) + { + result = 0; + } + else if (address >= 0x662020 && address <= 0x662021) + { + result = 0; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + result = 0; + } + else if (address >= 0x664000 && address <= 0x664001) + { + result = 0; + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else if (address >= 0x804000 && address <= 0x804001) + { + result = (sbyte)short0; + } + else if (address >= 0x804010 && address <= 0x804011) + { + if (address == 0x804010) + { + result = (sbyte)(short1 >> 8); + } + else if (address == 0x804011) + { + result = (sbyte)short1; + } + } + else if (address >= 0x804020 && address <= 0x804021) + { + if (address == 0x804020) + { + result = (sbyte)(short2 >> 8); + } + else if (address == 0x804021) + { + result = (sbyte)(short2 & (Eeprom.eeprom_bit_r() - 2)); + } + } + else if (address >= 0x804030 && address <= 0x804031) + { + if (address == 0x804030) + { + result = (sbyte)(cps2_qsound_volume_r() >> 8); + } + else + { + result = (sbyte)cps2_qsound_volume_r(); + } + } + else if (address >= 0x8040b0 && address <= 0x8040b3) + { + result = (sbyte)kludge_r(); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int offset = (address - 0x804140) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + result = (sbyte)gfxram[(address & 0x3ffff)]; + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + return result; + } + public static short MC2ReadOpWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < mainromopLength) + { + result = (short)(mainromop[address] * 0x100 + mainromop[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MC2ReadPcrelWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < mainromopLength) + { + result = (short)(mainromop[address] * 0x100 + mainromop[address + 1]); + } + else + { + result = 0; + } + } + else + { + result = MC2ReadWord(address); + } + return result; + } + public static short MC2ReadWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + result = (short)cps2_output[offset]; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + result = qsound_sharedram1_r(offset); + } + else if (address >= 0x662000 && address <= 0x662001) + { + result = 0; + } + else if (address >= 0x662008 && address <= 0x662009) + { + result = 0; + } + else if (address >= 0x662020 && address <= 0x662021) + { + result = 0; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + result = 0; + } + else if (address >= 0x664000 && address <= 0x664001) + { + result = 0; + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x804000 && address <= 0x804001) + { + result = short0; + } + else if (address >= 0x804010 && address <= 0x804011) + { + result = short1; + } + else if (address >= 0x804020 && address <= 0x804021) + { + result = (short)(short2 & (Eeprom.eeprom_bit_r() - 2)); + } + else if (address >= 0x804030 && address <= 0x804031) + { + result = cps2_qsound_volume_r(); + } + else if (address >= 0x8040b0 && address <= 0x8040b3) + { + result = kludge_r(); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int offset = (address - 0x804140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + return result; + } + public static int MC2ReadOpLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + if (address + 3 < mainromopLength) + { + result = (int)(mainromop[address] * 0x1000000 + mainromop[address + 1] * 0x10000 + mainromop[address + 2] * 0x100 + mainromop[address + 3]); + } + else + { + result = 0; + } + } + return result; + } + public static int MC2ReadPcrelLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + if (address + 3 < mainromopLength) + { + result = (int)(mainromop[address] * 0x1000000 + mainromop[address + 1] * 0x10000 + mainromop[address + 2] * 0x100 + mainromop[address + 3]); + } + else + { + result = 0; + } + } + else + { + result = MC2ReadLong(address); + } + return result; + } + public static int MC2ReadLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address <= 0x40000b) + { + result = 0; + //int offset = (add - 0x400000) / 2; + //return (short)CPS1.cps2_output[offset]; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + result = 0; + //int offset = (add - 0x618000) / 2; + //return CPS1.qsound_sharedram1_r(offset); + } + else if (address >= 0x662000 && address <= 0x662001) + { + result = 0; + } + else if (address >= 0x662008 && address <= 0x662009) + { + result = 0; + } + else if (address >= 0x662020 && address <= 0x662021) + { + result = 0; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + result = 0; + } + else if (address >= 0x664000 && address <= 0x664001) + { + result = 0; + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + result = 0; + //int offset = (add - 0x800140) / 2; + //return (short)cps1_cps_b_r(offset); + } + else if (address >= 0x804000 && address <= 0x804001) + { + result = 0; + //return (int)sbyte0 & 0xff; + } + else if (address >= 0x804010 && address <= 0x804011) + { + result = -1; + //return short1; + } + else if (address >= 0x804020 && address <= 0x804021) + { + result = 0; + //return (int)sbyte2 & 0xff; + } + else if (address >= 0x804030 && address <= 0x804031) + { + result = 0; + //return CPS1.cps2_qsound_volume_r(); + } + else if (address >= 0x8040b0 && address <= 0x8040b3) + { + result = kludge_r(); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + result = 0; + //int offset = (add - 0x804140) / 2; + //return (short)CPS1.cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + return result; + } + public static void MC2WriteByte(int address, sbyte value) + { + address &= 0xffffff; + if (address <= 0x3fffff) + { + int i11 = 1; + } + if (address >= 0x400000 && address <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + cps2_output[offset] = (ushort)value; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + qsound_sharedram1_w(offset, (byte)value); + } + else if (address >= 0x662000 && address <= 0x662001) + { + int i11 = 1; + } + else if (address >= 0x662008 && address <= 0x662009) + { + int i11 = 1; + } + else if (address >= 0x662020 && address <= 0x662021) + { + int i11 = 1; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + int i11 = 1; + } + else if (address >= 0x664000 && address <= 0x664001) + { + int i11 = 1; + } + else if (address >= 0x700000 && address <= 0x701fff) + { + int offset = (address - 0x700000) / 2; + cps2_objram1_w(offset, (ushort)value); + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int i1 = 1; + //int offset = (add - 0x70a000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int i1 = 1; + //int offset = (add - 0x70c000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int i1 = 1; + //int offset = (add - 0x70e000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x800100 && address <= 0x80013f) + { + int i11 = 1;//cps1_cps_a_w + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int i11 = 1;//cps1_cps_b_w + } + else if (address >= 0x804040 && address <= 0x804041) + { + if (address == 0x804040) + { + cps2_eeprom_port_bh(value); + } + else if (address == 0x804041) + { + cps2_eeprom_port_bl(value); + } + } + else if (address >= 0x8040a0 && address <= 0x8040a1) + { + int i11 = 1;//nop + } + else if (address >= 0x8040e0 && address <= 0x8040e1) + { + cps2_objram_bank_w(value); + } + else if (address >= 0x804100 && address <= 0x80413f) + { + int i11 = 1;//cps1_cps_a_w + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int i11 = 1;//cps1_cps_b_w + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value); + } + else + { + int i11 = 1; + } + } + public static void MC2WriteWord(int address, short value) + { + address &= 0xffffff; + if (address <= 0x3fffff) + { + int i11 = 1; + } + if (address >= 0x400000 && address + 1 <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + cps2_output[offset] = (ushort)value; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + qsound_sharedram1_w(offset, (byte)value); + } + else if (address >= 0x662000 && address <= 0x662001) + { + int i11 = 1; + } + else if (address >= 0x662008 && address <= 0x662009) + { + int i11 = 1; + } + else if (address >= 0x662020 && address <= 0x662021) + { + int i11 = 1; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + int i11 = 1; + } + else if (address >= 0x664000 && address <= 0x664001) + { + int i11 = 1; + } + else if (address >= 0x700000 && address <= 0x701fff) + { + int offset = (address - 0x700000) / 2; + cps2_objram1_w(offset, (ushort)value); + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x800100 && address <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x804040 && address <= 0x804041) + { + cps2_eeprom_port_w(value); + } + else if (address >= 0x8040a0 && address <= 0x8040a1) + { + int i11 = 1;//nop + } + else if (address >= 0x8040e0 && address <= 0x8040e1) + { + cps2_objram_bank_w(value); + } + else if (address >= 0x804100 && address + 1 <= 0x80413f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + gfxram[address & 0x3ffff] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 1] = (byte)value; + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + Memory.mainram[address & 0xffff] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)value; + } + else + { + int i11 = 1; + } + } + public static void MC2WriteLong(int address, int value) + { + address &= 0xffffff; + if (address <= 0x3fffff) + { + int i11 = 1; + } + if (address >= 0x400000 && address + 3 <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + cps2_output[offset] = (ushort)(value >> 16); + cps2_output[offset + 1] = (ushort)value; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + qsound_sharedram1_w(offset, (byte)(value >> 16)); + qsound_sharedram1_w(offset + 1, (byte)value); + } + else if (address >= 0x662000 && address <= 0x662001) + { + int i11 = 1; + } + else if (address >= 0x662008 && address <= 0x662009) + { + int i11 = 1; + } + else if (address >= 0x662020 && address <= 0x662021) + { + int i11 = 1; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + int i11 = 1; + } + else if (address >= 0x664000 && address <= 0x664001) + { + int i11 = 1; + } + else if (address >= 0x700000 && address <= 0x701fff) + { + int offset = (address - 0x700000) / 2; + cps2_objram1_w(offset, (ushort)(value >> 16)); + cps2_objram1_w(offset + 1, (ushort)value); + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x800100 && address + 3 <= 0x80013f) + { + int offset = (address & 0x3f) / 2; + cps1_cps_a_w(offset, (ushort)(value >> 16)); + cps1_cps_a_w(offset + 1, (ushort)value); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int i11 = 1; + //cps1_cps_b_w((add & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x804040 && address <= 0x804041) + { + int i11 = 1; + //cps2_eeprom_port_w(value); + } + else if (address >= 0x8040a0 && address <= 0x8040a1) + { + int i11 = 1;//nop + } + else if (address >= 0x8040e0 && address <= 0x8040e1) + { + int i11 = 1; + //cps2_objram_bank_w(value); + } + else if (address >= 0x804100 && address <= 0x80413f) + { + int offset = (address & 0x3f) / 2; + cps1_cps_a_w(offset, (ushort)(value >> 16)); + cps1_cps_a_w(offset + 1, (ushort)value); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int i11 = 1; + //cps1_cps_b_w((add & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 24); + gfxram[(address & 0x3ffff) + 1] = (byte)(value >> 16); + gfxram[(address & 0x3ffff) + 2] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 3] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + cps1_gfxram_w(((address + 2) & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); + } + else + { + int i11 = 1; + } + } + public static byte ZQReadOp(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = audioromop[address & 0x7fff]; + } + else + { + result = 0; + } + return result; + } + public unsafe static byte ZQReadMemory(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address & 0x7fff]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + result = Memory.audiorom[basebanksnd + (address & 0x3fff)]; + } + else if (address >= 0xc000 && address <= 0xcfff) + { + result = qsound_sharedram1[address & 0xfff]; + } + else if (address == 0xd007) + { + result = QSound.qsound_status_r(); + } + else if (address >= 0xf000 && address <= 0xffff) + { + result = qsound_sharedram2[address & 0xfff]; + } + else + { + result = 0; + } + return result; + } + public static void ZQWriteMemory(ushort address, byte value) + { + if (address >= 0xc000 && address <= 0xcfff) + { + qsound_sharedram1[address & 0xfff] = value; + } + else if (address == 0xd000) + { + QSound.qsound_data_h_w(value); + } + else if (address == 0xd001) + { + QSound.qsound_data_l_w(value); + } + else if (address == 0xd002) + { + QSound.qsound_cmd_w(value); + } + else if (address == 0xd003) + { + qsound_banksw_w(value); + } + else if (address >= 0xf000 && address <= 0xffff) + { + qsound_sharedram2[address & 0xfff] = value; + } + else + { + + } + } + public static byte ZCReadHardware(ushort address) + { + return 0; + } + public static void ZCWriteHardware(ushort address, byte value) + { + + } + public static int ZIRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[0].cpunum, 0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory.cs.meta new file mode 100644 index 00000000..88255627 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8011c61674e34742a74448541c8d683 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory2.cs new file mode 100644 index 00000000..ed4acb17 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory2.cs @@ -0,0 +1,1756 @@ +namespace MAME.Core +{ + public unsafe partial class CPS + { + public static sbyte MCReadByte_forgottn(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x800052 && address <= 0x800055) + { + int offset = (address - 0x800052) / 2; + result = (sbyte)((Inptport.input_port_read_direct(Inptport.analog_p0) - dial0) >> (8 * offset)); + } + else if (address >= 0x80005a && address <= 0x80005d) + { + int offset = (address - 0x80005a) / 2; + result = (sbyte)((Inptport.input_port_read_direct(Inptport.analog_p1) - dial1) >> (8 * offset)); + } + else + { + result = MCReadByte(address); + } + return result; + } + public static short MCReadWord_forgottn(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x800052 && address <= 0x800055) + { + int offset = (address - 0x800052) / 2; + result = (short)(((Inptport.input_port_read_direct(Inptport.analog_p0) - dial0) >> (8 * offset)) & 0xff); + } + else if (address >= 0x80005a && address <= 0x80005d) + { + int offset = (address - 0x80005a) / 2; + result = (short)(((Inptport.input_port_read_direct(Inptport.analog_p1) - dial1) >> (8 * offset)) & 0xff); + } + else + { + result = MCReadWord(address); + } + return result; + } + public static int MCReadLong_forgottn(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x800052 && address + 3 <= 0x800055) + { + result = (int)(((Inptport.input_port_read_direct(Inptport.analog_p0) - dial0) & 0xff) * 0x10000 + (((Inptport.input_port_read_direct(Inptport.analog_p0) - dial0) >> 8) & 0xff)); + } + else if (address >= 0x80005a && address + 3 <= 0x80005d) + { + result = (int)(((Inptport.input_port_read_direct(Inptport.analog_p1) - dial1) & 0xff) * 0x10000 + (((Inptport.input_port_read_direct(Inptport.analog_p1) - dial1) >> 8) & 0xff)); + } + else + { + result = MCReadLong(address); + } + return result; + } + public static void MCWriteByte_forgottn(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x800040 && address <= 0x800041) + { + dial0 = (int)Inptport.input_port_read_direct(Inptport.analog_p0); + } + else if (address >= 0x800048 && address <= 0x800049) + { + dial1 = (int)Inptport.input_port_read_direct(Inptport.analog_p1); + } + else + { + MCWriteByte(address, value); + } + } + public static void MCWriteWord_forgottn(int address, short value) + { + address &= 0xffffff; + if (address >= 0x800040 && address <= 0x800041) + { + dial0 = (int)Inptport.input_port_read_direct(Inptport.analog_p0); + } + else if (address >= 0x800048 && address <= 0x800049) + { + dial1 = (int)Inptport.input_port_read_direct(Inptport.analog_p1); + } + else + { + MCWriteWord(address, value); + } + } + public static void MCWriteLong_forgottn(int address, int value) + { + address &= 0xffffff; + if (address >= 0x800040 && address <= 0x800041) + { + int i1 = 1; + } + else if (address >= 0x800048 && address <= 0x800049) + { + int i1 = 1; + } + else + { + MCWriteLong(address, value); + } + } + public static sbyte MCReadByte_sf2thndr(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x8001c0 && address <= 0x8001ff) + { + int offset = (address - 0x8001c0) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else + { + result = MCReadByte(address); + } + return result; + } + public static short MCReadWord_sf2thndr(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x8001c0 && address + 1 <= 0x8001ff) + { + int offset = (address - 0x8001c0) / 2; + result = (short)cps1_cps_b_r(offset); + } + else + { + result = MCReadWord(address); + } + return result; + } + public static void MCWriteWord_sf2thndr(int address, short value) + { + address &= 0xffffff; + if (address >= 0x8001c0 && address + 1 <= 0x8001ff) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else + { + MCWriteWord(address, value); + } + } + public static short MCReadWord_sf2ceblp(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x57a2b0 && address + 1 <= 0x57a2b1) + { + if (sf2ceblp_prot == 0x0) + { + result = 0x1992; + } + else if (sf2ceblp_prot == 0x04) + { + result = 0x0408; + } + else + { + result = -1; + } + } + else + { + result = MCReadWord(address); + } + return result; + } + public static void MCWriteWord_sf2ceblp(int address, short value) + { + address &= 0xffffff; + if (address >= 0x5762b0 && address + 1 <= 0x5762b1) + { + sf2ceblp_prot = value; + } + else + { + MCWriteWord(address, value); + } + } + public static sbyte MCReadByte_sf2m3(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x800010 && address <= 0x800011) + { + if (address == 0x800010) + { + result = (sbyte)(short1 >> 8); + } + else if (address == 0x800011) + { + result = (sbyte)(short1); + } + } + else if (address >= 0x800028 && address <= 0x80002f) + { + int offset = (address - 0x800028) / 2; + result = (sbyte)cps1_dsw_r(offset); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else if (address >= 0x800186 && address <= 0x800187) + { + result = (sbyte)short2; + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + result = (sbyte)gfxram[(address & 0x3ffff)]; + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + return result; + } + public static short MCReadWord_sf2m3(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800010 && address + 1 <= 0x800011) + { + result = short1; + } + else if (address >= 0x800028 && address + 1 <= 0x80002f) + { + int offset = (address - 0x800028) / 2; + result = (short)(((byte)(cps1_dsw_r(offset)) << 8) | (byte)cps1_dsw_r(offset)); + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x800186 && address + 1 <= 0x800187) + { + result = (short)((short2 << 8) | (byte)short2); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + return result; + } + public static int MCReadLong_sf2m3(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x800010 && address + 3 <= 0x800011) + { + result = 0; + } + else if (address >= 0x800028 && address + 3 <= 0x80002f) + { + result = 0; + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = cps1_cps_b_r(offset) * 0x10000 + cps1_cps_b_r(offset + 1); + } + else if (address >= 0x800186 && address + 3 <= 0x800187) + { + result = 0; + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + return result; + } + public static void MCWriteByte_sf2m3(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x800030 && address <= 0x800037) + { + if (address % 2 == 0) + { + cps1_coinctrl_w((ushort)(value * 0x100)); + } + else + { + return; + } + } + else if (address >= 0x800100 && address <= 0x80013f) + { + return; + } + else if (address >= 0x800140 && address <= 0x80017f) + { + return; + } + else if (address >= 0x800190 && address <= 0x800197) + { + Sound.soundlatch_w((ushort)value); + } + else if (address >= 0x800198 && address <= 0x80019f) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0x8001a0 && address <= 0x8001c3) + { + return; + } + else if (address >= 0x8001c4 && address <= 0x8001c5) + { + return; + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static void MCWriteWord_sf2m3(int address, short value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 1 <= 0x800037) + { + return; + } + else if (address >= 0x800100 && address + 1 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800190 && address + 1 <= 0x800197) + { + Sound.soundlatch_w((ushort)value); + } + else if (address >= 0x800198 && address + 1 <= 0x80019f) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0x8001a0 && address + 1 <= 0x8001c3) + { + cps1_cps_a_w((address - 0x8001a0) / 2, (ushort)value); + } + else if (address >= 0x8001c4 && address + 1 <= 0x8001c5) + { + sf2m3_layer_w((ushort)value); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 1] = (byte)value; + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static void MCWriteLong_sf2m3(int address, int value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 3 <= 0x800037) + { + return; + } + else if (address >= 0x800100 && address + 3 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)(value >> 16)); + cps1_cps_a_w(((address + 2) & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)(value >> 16)); + cps1_cps_b_w(((address + 2) & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800190 && address + 3 <= 0x800197) + { + return; + } + else if (address >= 0x800198 && address + 3 <= 0x80019f) + { + return; + } + else if (address >= 0x8001a0 && address + 3 <= 0x8001c3) + { + cps1_cps_a_w((address - 0x8001a0) / 2, (ushort)(value >> 16)); + cps1_cps_a_w((address + 2 - 0x8001a0) / 2, (ushort)value); + } + else if (address >= 0x8001c4 && address + 3 <= 0x8001c5) + { + return; + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 24); + gfxram[(address & 0x3ffff) + 1] = (byte)(value >> 16); + gfxram[(address & 0x3ffff) + 2] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 3] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + cps1_gfxram_w(((address + 2) & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static sbyte MCReadByte_sf2m10(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address <= 0x800007) + { + if (address == 0x800000) + { + result = (sbyte)(short1 >> 8); + } + else if (address == 0x800001) + { + result = (sbyte)(short1); + } + else + { + result = -1; + } + } + else if (address >= 0x800018 && address <= 0x80001f) + { + int offset = (address - 0x800018) / 2; + result = (sbyte)cps1_dsw_r(offset); + } + else if (address >= 0x800020 && address <= 0x800021) + { + result = 0; + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + result = (sbyte)gfxram[(address & 0x3ffff)]; + } + else if (address >= 0xe00000 && address <= 0xefffff) + { + result = (sbyte)mainram2[address & 0xfffff]; + } + else if (address >= 0xf1c000 && address <= 0xf1c001) + { + result = (sbyte)short2; + } + else if (address >= 0xfeff00 && address <= 0xfeffff) + { + result = (sbyte)mainram3[address & 0xff]; + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + return result; + } + public static short MCReadWord_sf2m10(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x800007) + { + result = short1; + } + else if (address >= 0x800018 && address + 1 <= 0x80001f) + { + int offset = (address - 0x800018) / 2; + result = (short)(((ushort)(cps1_dsw_r(offset)) << 8) | (ushort)cps1_dsw_r(offset)); + } + else if (address >= 0x800020 && address + 1 <= 0x800021) + { + result = 0; + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xe00000 && address + 1 <= 0xefffff) + { + result = (short)(mainram2[(address & 0xfffff)] * 0x100 + mainram2[(address & 0xfffff) + 1]); + } + else if (address >= 0xf1c000 && address + 1 <= 0xf1c001) + { + result = (short)((short2 << 8) | (byte)short2); + } + else if (address >= 0xfeff00 && address + 1 <= 0xfeffff) + { + result = (short)(mainram3[(address & 0xff)] * 0x100 + mainram3[(address & 0xff) + 1]); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + return result; + } + public static int MCReadLong_sf2m10(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 3 <= 0x800007) + { + result = 0; + } + else if (address >= 0x800018 && address + 3 <= 0x80001f) + { + result = 0; + } + else if (address >= 0x800020 && address + 3 <= 0x800021) + { + result = 0; + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = cps1_cps_b_r(offset) * 0x10000 + cps1_cps_b_r(offset + 1); + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xe00000 && address + 3 <= 0xefffff) + { + result = (int)(mainram2[(address & 0xfffff)] * 0x1000000 + mainram2[(address & 0xfffff) + 1] * 0x10000 + mainram2[(address & 0xfffff) + 2] * 0x100 + mainram2[(address & 0xfffff) + 3]); + } + else if (address >= 0xf1c000 && address + 3 <= 0xf1c001) + { + result = 0; + } + else if (address >= 0xfeff00 && address + 3 <= 0xfeffff) + { + result = (int)(mainram3[(address & 0xff)] * 0x1000000 + mainram3[(address & 0xff) + 1] * 0x10000 + mainram3[(address & 0xff) + 2] * 0x100 + mainram3[(address & 0xff) + 3]); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + return result; + } + public static void MCWriteByte_sf2m10(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x800030 && address <= 0x800037) + { + if (address % 2 == 0) + { + cps1_coinctrl_w((ushort)(value * 0x100)); + } + else + { + return; + } + } + else if (address >= 0x800100 && address <= 0x80013f) + { + cps1_cps_a_w(address & 0x3f, (byte)value); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + return; + } + else if (address >= 0x800180 && address <= 0x800187) + { + Sound.soundlatch_w((ushort)value); + } + else if (address >= 0x800188 && address <= 0x80018f) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0x8001a2 && address <= 0x8001b3) + { + cps1_cps_a_w(address - 0x8001a2, (byte)value); + } + else if (address >= 0x8001fe && address <= 0x8001ff) + { + return; + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xe00000 && address <= 0xefffff) + { + mainram2[(address & 0xfffff)] = (byte)(value); + } + else if (address >= 0xfeff00 && address <= 0xfeffff) + { + mainram3[(address & 0xff)] = (byte)(value); + } + else if (address >= 0xff0000 && address <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static void MCWriteWord_sf2m10(int address, short value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 1 <= 0x800037) + { + return; + } + else if (address >= 0x800100 && address + 1 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 1 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800180 && address + 1 <= 0x800187) + { + Sound.soundlatch_w((ushort)value); + } + else if (address >= 0x800188 && address + 1 <= 0x80018f) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0x8001a2 && address + 1 <= 0x8001b3) + { + cps1_cps_a_w((address - 0x8001a2) / 2, (ushort)value); + } + else if (address >= 0x8001fe && address + 1 <= 0x8001ff) + { + return; + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 1] = (byte)value; + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xe00000 && address + 1 <= 0xefffff) + { + mainram2[(address & 0xfffff)] = (byte)(value >> 8); + mainram2[(address & 0xfffff) + 1] = (byte)(value); + } + else if (address >= 0xfeff00 && address + 1 <= 0xfeffff) + { + mainram3[(address & 0xff)] = (byte)(value >> 8); + mainram3[(address & 0xff) + 1] = (byte)(value); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static void MCWriteLong_sf2m10(int address, int value) + { + address &= 0xffffff; + if (address >= 0x800030 && address + 3 <= 0x800037) + { + return; + } + else if (address >= 0x800100 && address + 3 <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)(value >> 16)); + cps1_cps_a_w(((address + 2) & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address + 3 <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)(value >> 16)); + cps1_cps_b_w(((address + 2) & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800180 && address + 3 <= 0x800187) + { + return; + } + else if (address >= 0x800188 && address + 3 <= 0x80018f) + { + return; + } + else if (address >= 0x8001a2 && address + 3 <= 0x8001b3) + { + cps1_cps_a_w((address - 0x8001a2) / 2, (ushort)(value >> 16)); + cps1_cps_a_w((address + 2 - 0x8001a2) / 2, (ushort)value); + } + else if (address >= 0x8001fe && address + 3 <= 0x8001ff) + { + return; + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 24); + gfxram[(address & 0x3ffff) + 1] = (byte)(value >> 16); + gfxram[(address & 0x3ffff) + 2] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 3] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + cps1_gfxram_w(((address + 2) & 0x3ffff) / 2); + } + else if (address >= 0xe00000 && address + 3 <= 0xefffff) + { + mainram2[(address & 0xfffff)] = (byte)(value >> 24); + mainram2[(address & 0xfffff) + 1] = (byte)(value >> 16); + mainram2[(address & 0xfffff) + 2] = (byte)(value >> 8); + mainram2[(address & 0xfffff) + 3] = (byte)(value); + } + else if (address >= 0xfeff00 && address + 3 <= 0xfeffff) + { + mainram3[(address & 0xff)] = (byte)(value >> 24); + mainram3[(address & 0xff) + 1] = (byte)(value >> 16); + mainram3[(address & 0xff) + 2] = (byte)(value >> 8); + mainram3[(address & 0xff) + 3] = (byte)(value); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffff) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); + } + else + { + int i1 = 1; + } + } + public static short MCReadWord_sf2dongb(int address) + { + address &= 0xffffff; + short result = 0; + if (address == 0x180000 || address == 0x1f7040) + { + result = 0x0210; + } + else + { + result = MCReadWord(address); + } + return result; + } + public static sbyte MCReadByte_dinohunt(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0xf18000 && address <= 0xf19fff) + { + result = -1; + } + else if (address >= 0xfc0000 && address <= 0xfc0001) + { + result = (sbyte)short2; + } + else + { + result = MCReadByte(address); + } + return result; + } + public static sbyte MCReadByte_pang3(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x80017a && address <= 0x80017b) + { + result = (sbyte)cps1_eeprom_port_r(); + } + else + { + result = MCReadByte(address); + } + return result; + } + public static short MCReadWord_pang3(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x80017a && address + 1 <= 0x80017b) + { + result = (short)cps1_eeprom_port_r(); + } + else + { + result = MCReadWord(address); + } + return result; + } + public static void MCWriteByte_pang3(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x80017a && address <= 0x80017b) + { + if ((address & 1) == 1) + { + cps1_eeprom_port_w(value); + } + } + else + { + MCWriteByte(address, value); + } + } + public static void MCWriteWord_pang3(int address, short value) + { + address &= 0xffffff; + if (address >= 0x80017a && address + 1 <= 0x80017b) + { + cps1_eeprom_port_w(value); + } + else + { + MCWriteWord(address, value); + } + } + public static sbyte MC2ReadByte_ecofghtr(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x804000 && address <= 0x804001) + { + result = 0; + } + else + { + result = MC2ReadByte(address); + } + return result; + } + public static short MC2ReadWord_ecofghtr(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x804000 && address + 1 <= 0x804001) + { + result = 0; + } + else + { + result = MC2ReadWord(address); + } + return result; + } + public static sbyte MC2ReadOpByte_dead(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MC2ReadByte_dead(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x3fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + result = (sbyte)cps2_output[offset]; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + result = (sbyte)qsound_sharedram1_r(offset); + } + else if (address >= 0x662000 && address <= 0x662001) + { + result = 0; + } + else if (address >= 0x662008 && address <= 0x662009) + { + result = 0; + } + else if (address >= 0x662020 && address <= 0x662021) + { + result = 0; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + result = 0; + } + else if (address >= 0x664000 && address <= 0x664001) + { + result = 0; + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + result = (sbyte)cps2_objram2_r(offset); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else if (address >= 0x804000 && address <= 0x804001) + { + result = (sbyte)short0; + } + else if (address >= 0x804010 && address <= 0x804011) + { + if (address == 0x804010) + { + result = (sbyte)(short1 >> 8); + } + else if (address == 0x804011) + { + result = (sbyte)short1; + } + } + else if (address >= 0x804020 && address <= 0x804021) + { + if (address == 0x804020) + { + result = (sbyte)(short2 >> 8); + } + else if (address == 0x804021) + { + result = (sbyte)(short2 & (Eeprom.eeprom_bit_r() - 2)); + } + } + else if (address >= 0x804030 && address <= 0x804031) + { + if (address == 0x804030) + { + result = (sbyte)(cps2_qsound_volume_r() >> 8); + } + else + { + result = (sbyte)cps2_qsound_volume_r(); + } + } + else if (address >= 0x8040b0 && address <= 0x8040b3) + { + result = (sbyte)kludge_r(); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int offset = (address - 0x804140) / 2; + result = (sbyte)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + result = (sbyte)gfxram[(address & 0x3ffff)]; + } + else if (address >= 0xff0000 && address <= 0xffffef) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + else if (address >= 0xfffff0 && address <= 0xfffffb) + { + int offset = (address - 0xfffff0) / 2; + result = (sbyte)cps2_output[offset]; + } + else if (address >= 0xfffffc && address <= 0xffffff) + { + result = 0; + } + return result; + } + public static short MC2ReadOpWord_dead(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MC2ReadWord_dead(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x3fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + result = (short)cps2_output[offset]; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + result = qsound_sharedram1_r(offset); + } + else if (address >= 0x662000 && address <= 0x662001) + { + result = 0; + } + else if (address >= 0x662008 && address <= 0x662009) + { + result = 0; + } + else if (address >= 0x662020 && address <= 0x662021) + { + result = 0; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + result = 0; + } + else if (address >= 0x664000 && address <= 0x664001) + { + result = 0; + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + result = cps2_objram2_r(offset); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int offset = (address - 0x800140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x804000 && address <= 0x804001) + { + result = short0; + } + else if (address >= 0x804010 && address <= 0x804011) + { + result = short1; + } + else if (address >= 0x804020 && address <= 0x804021) + { + result = (short)(short2 & (Eeprom.eeprom_bit_r() - 2)); + } + else if (address >= 0x804030 && address <= 0x804031) + { + result = cps2_qsound_volume_r(); + } + else if (address >= 0x8040b0 && address <= 0x8040b3) + { + result = kludge_r(); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int offset = (address - 0x804140) / 2; + result = (short)cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + result = (short)(gfxram[(address & 0x3ffff)] * 0x100 + gfxram[(address & 0x3ffff) + 1]); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffef) + { + return (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + else if (address >= 0xfffff0 && address + 1 <= 0xfffffb) + { + int offset = (address - 0xfffff0) / 2; + result = (short)cps2_output[offset]; + } + else if (address >= 0xfffffc && address + 1 <= 0xffffff) + { + result = 0; + } + return result; + } + public static int MC2ReadOpLong_dead(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MC2ReadLong_dead(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x3fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address + 3 <= 0x40000b) + { + result = 0; + //int offset = (add - 0x400000) / 2; + //return (short)CPS1.cps2_output[offset]; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + result = 0; + //int offset = (add - 0x618000) / 2; + //return CPS1.qsound_sharedram1_r(offset); + } + else if (address >= 0x662000 && address <= 0x662001) + { + result = 0; + } + else if (address >= 0x662008 && address <= 0x662009) + { + result = 0; + } + else if (address >= 0x662020 && address <= 0x662021) + { + result = 0; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + result = 0; + } + else if (address >= 0x664000 && address <= 0x664001) + { + result = 0; + } + else if (address >= 0x708000 && address + 3 <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + result = (int)((ushort)cps2_objram2_r(offset) * 0x10000 + (ushort)cps2_objram2_r(offset + 1)); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + result = 0; + //int offset = (add - 0x800140) / 2; + //return (short)cps1_cps_b_r(offset); + } + else if (address >= 0x804000 && address <= 0x804001) + { + result = 0; + //return (int)sbyte0 & 0xff; + } + else if (address >= 0x804010 && address <= 0x804011) + { + result = -1; + //return short1; + } + else if (address >= 0x804020 && address <= 0x804021) + { + result = 0; + //return (int)sbyte2 & 0xff; + } + else if (address >= 0x804030 && address <= 0x804031) + { + result = 0; + //return CPS1.cps2_qsound_volume_r(); + } + else if (address >= 0x8040b0 && address <= 0x8040b3) + { + result = 0; + //return CPS1.kludge_r(); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + result = 0; + //int offset = (add - 0x804140) / 2; + //return (short)CPS1.cps1_cps_b_r(offset); + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + result = (int)(gfxram[(address & 0x3ffff)] * 0x1000000 + gfxram[(address & 0x3ffff) + 1] * 0x10000 + gfxram[(address & 0x3ffff) + 2] * 0x100 + gfxram[(address & 0x3ffff) + 3]); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffef) + { + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); + } + else if (address >= 0xfffff0 && address + 3 <= 0xfffffb) + { + result = 0; + //int offset = (address - 0xfffff0) / 2; + //return (sbyte)cps2_output[offset]; + } + else if (address >= 0xfffffc && address + 3 <= 0xffffff) + { + result = 0; + } + return result; + } + public static void MC2WriteByte_dead(int address, sbyte value) + { + address &= 0xffffff; + if (address <= 0x3fffff) + { + int i11 = 1; + } + if (address >= 0x400000 && address <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + cps2_output[offset] = (ushort)value; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + qsound_sharedram1_w(offset, (byte)value); + } + else if (address >= 0x662000 && address <= 0x662001) + { + int i11 = 1; + } + else if (address >= 0x662008 && address <= 0x662009) + { + int i11 = 1; + } + else if (address >= 0x662020 && address <= 0x662021) + { + int i11 = 1; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + int i11 = 1; + } + else if (address >= 0x664000 && address <= 0x664001) + { + int i11 = 1; + } + else if (address >= 0x700000 && address <= 0x701fff) + { + int offset = (address - 0x700000) / 2; + cps2_objram1_w(offset, (ushort)value); + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int i1 = 1; + //int offset = (add - 0x70a000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int i1 = 1; + //int offset = (add - 0x70c000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int i1 = 1; + //int offset = (add - 0x70e000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x800100 && address <= 0x80013f) + { + int i11 = 1;//cps1_cps_a_w + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int i11 = 1;//cps1_cps_b_w + } + else if (address >= 0x804040 && address <= 0x804041) + { + if (address == 0x804040) + { + cps2_eeprom_port_bh(value); + } + else if (address == 0x804041) + { + cps2_eeprom_port_bl(value); + } + } + else if (address >= 0x8040a0 && address <= 0x8040a1) + { + int i11 = 1;//nop + } + else if (address >= 0x8040e0 && address <= 0x8040e1) + { + cps2_objram_bank_w(value); + } + else if (address >= 0x804100 && address <= 0x80413f) + { + int i11 = 1;//cps1_cps_a_w + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int i11 = 1;//cps1_cps_b_w + } + else if (address >= 0x900000 && address <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address <= 0xffffef) + { + Memory.mainram[(address & 0xffff)] = (byte)(value); + } + else if (address >= 0xfffff0 && address <= 0xfffffb) + { + int offset = (address - 0xfffff0) / 2; + cps2_output[offset] = (ushort)value; + } + else if (address >= 0xfffffc && address <= 0xffffff) + { + int i11 = 1; + } + else + { + int i11 = 1; + } + } + public static void MC2WriteWord_dead(int address, short value) + { + address &= 0xffffff; + if (address <= 0x3fffff) + { + int i11 = 1; + } + if (address >= 0x400000 && address <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + cps2_output[offset] = (ushort)value; + } + else if (address >= 0x618000 && address <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + qsound_sharedram1_w(offset, (byte)value); + } + else if (address >= 0x662000 && address <= 0x662001) + { + int i11 = 1; + } + else if (address >= 0x662008 && address <= 0x662009) + { + int i11 = 1; + } + else if (address >= 0x662020 && address <= 0x662021) + { + int i11 = 1; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + int i11 = 1; + } + else if (address >= 0x664000 && address <= 0x664001) + { + int i11 = 1; + } + else if (address >= 0x700000 && address <= 0x701fff) + { + int offset = (address - 0x700000) / 2; + cps2_objram1_w(offset, (ushort)value); + } + else if (address >= 0x708000 && address <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70a000 && address <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int i11 = 1; + //int offset = (add - 0x70c000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int i11 = 1; + //int offset = (add - 0x70e000) / 2; + //cps2_objram2_w(offset, (ushort)value); + } + else if (address >= 0x800100 && address <= 0x80013f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x804040 && address <= 0x804041) + { + cps2_eeprom_port_w(value); + } + else if (address >= 0x8040a0 && address <= 0x8040a1) + { + int i11 = 1;//nop + } + else if (address >= 0x8040e0 && address <= 0x8040e1) + { + cps2_objram_bank_w(value); + } + else if (address >= 0x804100 && address <= 0x80413f) + { + cps1_cps_a_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + cps1_cps_b_w((address & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x900000 && address + 1 <= 0x92ffff) + { + gfxram[address & 0x3ffff] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 1] = (byte)value; + cps1_gfxram_w((address & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 1 <= 0xffffef) + { + Memory.mainram[address & 0xffff] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)value; + } + else if (address >= 0xfffff0 && address + 1 <= 0xfffffb) + { + int offset = (address - 0xfffff0) / 2; + cps2_output[offset] = (ushort)value; + } + else if (address >= 0xfffffc && address + 1 <= 0xffffff) + { + int i11 = 1; + } + else + { + int i11 = 1; + } + } + public static void MC2WriteLong_dead(int address, int value) + { + address &= 0xffffff; + if (address <= 0x3fffff) + { + int i11 = 1; + } + if (address >= 0x400000 && address + 3 <= 0x40000b) + { + int offset = (address - 0x400000) / 2; + cps2_output[offset] = (ushort)(value >> 16); + cps2_output[offset + 1] = (ushort)value; + } + else if (address >= 0x618000 && address + 3 <= 0x619fff) + { + int offset = (address - 0x618000) / 2; + qsound_sharedram1_w(offset, (byte)(value >> 16)); + qsound_sharedram1_w(offset + 1, (byte)value); + } + else if (address >= 0x662000 && address <= 0x662001) + { + int i11 = 1; + } + else if (address >= 0x662008 && address <= 0x662009) + { + int i11 = 1; + } + else if (address >= 0x662020 && address <= 0x662021) + { + int i11 = 1; + } + else if (address >= 0x660000 && address <= 0x663fff) + { + int i11 = 1; + } + else if (address >= 0x664000 && address <= 0x664001) + { + int i11 = 1; + } + else if (address >= 0x700000 && address <= 0x701fff) + { + int offset = (address - 0x700000) / 2; + cps2_objram1_w(offset, (ushort)(value >> 16)); + cps2_objram1_w(offset + 1, (ushort)value); + } + else if (address >= 0x708000 && address + 3 <= 0x709fff) + { + int offset = (address - 0x708000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x70a000 && address + 3 <= 0x70bfff) + { + int offset = (address - 0x70a000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x70c000 && address <= 0x70dfff) + { + int offset = (address - 0x70c000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x70e000 && address <= 0x70ffff) + { + int offset = (address - 0x70e000) / 2; + cps2_objram2_w(offset, (ushort)(value >> 16)); + cps2_objram2_w(offset + 1, (ushort)value); + } + else if (address >= 0x800100 && address <= 0x80013f) + { + int offset = (address & 0x3f) / 2; + cps1_cps_a_w(offset, (ushort)(value >> 16)); + cps1_cps_a_w(offset + 1, (ushort)value); + } + else if (address >= 0x800140 && address <= 0x80017f) + { + int i11 = 1; + //cps1_cps_b_w((add & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x804040 && address <= 0x804041) + { + int i11 = 1; + //cps2_eeprom_port_w(value); + } + else if (address >= 0x8040a0 && address <= 0x8040a1) + { + int i11 = 1;//nop + } + else if (address >= 0x8040e0 && address <= 0x8040e1) + { + int i11 = 1; + //cps2_objram_bank_w(value); + } + else if (address >= 0x804100 && address <= 0x80413f) + { + int offset = (address & 0x3f) / 2; + cps1_cps_a_w(offset, (ushort)(value >> 16)); + cps1_cps_a_w(offset + 1, (ushort)value); + } + else if (address >= 0x804140 && address <= 0x80417f) + { + int i11 = 1; + //cps1_cps_b_w((add & 0x3f) / 2, (ushort)value); + } + else if (address >= 0x900000 && address + 3 <= 0x92ffff) + { + gfxram[(address & 0x3ffff)] = (byte)(value >> 24); + gfxram[(address & 0x3ffff) + 1] = (byte)(value >> 16); + gfxram[(address & 0x3ffff) + 2] = (byte)(value >> 8); + gfxram[(address & 0x3ffff) + 3] = (byte)(value); + cps1_gfxram_w((address & 0x3ffff) / 2); + cps1_gfxram_w(((address + 2) & 0x3ffff) / 2); + } + else if (address >= 0xff0000 && address + 3 <= 0xffffef) + { + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); + } + else if (address >= 0xfffff0 && address + 3 <= 0xfffffb) + { + int offset = (address - 0xfffff0) / 2; + cps2_output[offset] = (ushort)(value >> 16); + cps2_output[offset + 1] = (ushort)value; + } + else if (address >= 0xfffffc && address + 3 <= 0xffffff) + { + int i11 = 1; + } + else + { + int i11 = 1; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory2.cs.meta new file mode 100644 index 00000000..efaceb6e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43856111f8b78ab4182463a01d6a6bed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/State.cs new file mode 100644 index 00000000..aac07b5b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/State.cs @@ -0,0 +1,376 @@ +using cpu.m68000; +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class CPS + { + public static void SaveStateBinaryC(BinaryWriter writer) + { + int i; + writer.Write(dswa); + writer.Write(dswb); + writer.Write(dswc); + writer.Write(basebanksnd); + for (i = 0; i < 0x20; i++) + { + writer.Write(cps_a_regs[i]); + } + for (i = 0; i < 0x20; i++) + { + writer.Write(cps_b_regs[i]); + } + for (i = 0; i < 0xc00; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x10000); + writer.Write(gfxram, 0, 0x30000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + for (i = 0; i < 2; i++) + { + writer.Write(Cpuexec.cpu[i].suspend); + writer.Write(Cpuexec.cpu[i].nextsuspend); + writer.Write(Cpuexec.cpu[i].eatcycles); + writer.Write(Cpuexec.cpu[i].nexteatcycles); + writer.Write(Cpuexec.cpu[i].localtime.seconds); + writer.Write(Cpuexec.cpu[i].localtime.attoseconds); + } + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + OKI6295.SaveStateBinary(writer); + for (i = 0; i < 2; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.okistream.output_sampindex); + writer.Write(Sound.okistream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + switch (RomInfo.Rom.Name) + { + case "forgottn": + case "forgottna": + case "forgottnu": + case "forgottnue": + case "forgottnuc": + case "forgottnua": + case "forgottnuaa": + case "lostwrld": + case "lostwrldo": + writer.Write(Inptport.portdata.last_delta_nsec); + break; + } + } + public static void SaveStateBinaryQ(BinaryWriter writer) + { + int i; + writer.Write(dswa); + writer.Write(dswb); + writer.Write(dswc); + writer.Write(basebanksnd); + for (i = 0; i < 0x20; i++) + { + writer.Write(cps_a_regs[i]); + } + for (i = 0; i < 0x20; i++) + { + writer.Write(cps_b_regs[i]); + } + for (i = 0; i < 0xc00; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x10000); + writer.Write(gfxram, 0, 0x30000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + for (i = 0; i < 2; i++) + { + writer.Write(Cpuexec.cpu[i].suspend); + writer.Write(Cpuexec.cpu[i].nextsuspend); + writer.Write(Cpuexec.cpu[i].eatcycles); + writer.Write(Cpuexec.cpu[i].nexteatcycles); + writer.Write(Cpuexec.cpu[i].localtime.seconds); + writer.Write(Cpuexec.cpu[i].localtime.attoseconds); + } + EmuTimer.SaveStateBinary(writer); + //writer.Write(qsound_sharedram1); + //writer.Write(qsound_sharedram2); + writer.Write(qsound_sharedram1, 0, qsound_sharedram1Length); + writer.Write(qsound_sharedram2, 0, qsound_sharedram2Length); + QSound.SaveStateBinary(writer); + writer.Write(Sound.qsoundstream.output_sampindex); + writer.Write(Sound.qsoundstream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Eeprom.SaveStateBinary(writer); + } + public static void SaveStateBinaryC2(BinaryWriter writer) + { + int i; + writer.Write(basebanksnd); + for (i = 0; i < 0x20; i++) + { + writer.Write(cps_a_regs[i]); + } + for (i = 0; i < 0x20; i++) + { + writer.Write(cps_b_regs[i]); + } + for (i = 0; i < 0x1000; i++) + { + writer.Write(cps2_objram1[i]); + } + for (i = 0; i < 0x1000; i++) + { + writer.Write(cps2_objram2[i]); + } + for (i = 0; i < 6; i++) + { + writer.Write(cps2_output[i]); + } + writer.Write(cps2networkpresent); + writer.Write(cps2_objram_bank); + writer.Write(scancount); + writer.Write(cps1_scanline1); + writer.Write(cps1_scanline2); + writer.Write(cps1_scancalls); + for (i = 0; i < 0xc00; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x10000); + writer.Write(gfxram, 0, 0x30000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + for (i = 0; i < 2; i++) + { + writer.Write(Cpuexec.cpu[i].suspend); + writer.Write(Cpuexec.cpu[i].nextsuspend); + writer.Write(Cpuexec.cpu[i].eatcycles); + writer.Write(Cpuexec.cpu[i].nexteatcycles); + writer.Write(Cpuexec.cpu[i].localtime.seconds); + writer.Write(Cpuexec.cpu[i].localtime.attoseconds); + } + EmuTimer.SaveStateBinary(writer); + //writer.Write(qsound_sharedram1); + //writer.Write(qsound_sharedram2); + writer.Write(qsound_sharedram1, 0, qsound_sharedram1Length); + writer.Write(qsound_sharedram2, 0, qsound_sharedram2Length); + QSound.SaveStateBinary(writer); + writer.Write(Sound.qsoundstream.output_sampindex); + writer.Write(Sound.qsoundstream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Eeprom.SaveStateBinary(writer); + } + public static void LoadStateBinaryC(BinaryReader reader) + { + int i; + dswa = reader.ReadByte(); + dswb = reader.ReadByte(); + dswc = reader.ReadByte(); + basebanksnd = reader.ReadInt32(); + for (i = 0; i < 0x20; i++) + { + cps_a_regs[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x20; i++) + { + cps_b_regs[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0xc00; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x10000)); + gfxram_set = reader.ReadBytes(0x30000); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + for (i = 0; i < 2; i++) + { + Cpuexec.cpu[i].suspend = reader.ReadByte(); + Cpuexec.cpu[i].nextsuspend = reader.ReadByte(); + Cpuexec.cpu[i].eatcycles = reader.ReadByte(); + Cpuexec.cpu[i].nexteatcycles = reader.ReadByte(); + Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); + Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); + } + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + OKI6295.LoadStateBinary(reader); + for (i = 0; i < 2; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.okistream.output_sampindex = reader.ReadInt32(); + Sound.okistream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + switch (RomInfo.Rom.Name) + { + case "forgottn": + case "forgottna": + case "forgottnu": + case "forgottnue": + case "forgottnuc": + case "forgottnua": + case "forgottnuaa": + case "lostwrld": + case "lostwrldo": + Inptport.portdata.last_delta_nsec = reader.ReadInt64(); + break; + } + } + public static void LoadStateBinaryQ(BinaryReader reader) + { + int i; + dswa = reader.ReadByte(); + dswb = reader.ReadByte(); + dswc = reader.ReadByte(); + basebanksnd = reader.ReadInt32(); + for (i = 0; i < 0x20; i++) + { + cps_a_regs[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x20; i++) + { + cps_b_regs[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0xc00; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x10000)); + gfxram_set = reader.ReadBytes(0x30000); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + for (i = 0; i < 2; i++) + { + Cpuexec.cpu[i].suspend = reader.ReadByte(); + Cpuexec.cpu[i].nextsuspend = reader.ReadByte(); + Cpuexec.cpu[i].eatcycles = reader.ReadByte(); + Cpuexec.cpu[i].nexteatcycles = reader.ReadByte(); + Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); + Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); + } + EmuTimer.LoadStateBinary(reader); + qsound_sharedram1_set = reader.ReadBytes(0x1000); + qsound_sharedram2_set = reader.ReadBytes(0x1000); + QSound.LoadStateBinary(reader); + Sound.qsoundstream.output_sampindex = reader.ReadInt32(); + Sound.qsoundstream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Eeprom.LoadStateBinary(reader); + } + public static void LoadStateBinaryC2(BinaryReader reader) + { + int i; + basebanksnd = reader.ReadInt32(); + for (i = 0; i < 0x20; i++) + { + cps_a_regs[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x20; i++) + { + cps_b_regs[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x1000; i++) + { + cps2_objram1[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x1000; i++) + { + cps2_objram2[i] = reader.ReadUInt16(); + } + for (i = 0; i < 6; i++) + { + cps2_output[i] = reader.ReadUInt16(); + } + cps2networkpresent = reader.ReadInt32(); + cps2_objram_bank = reader.ReadInt32(); + scancount = reader.ReadInt32(); + cps1_scanline1 = reader.ReadInt32(); + cps1_scanline2 = reader.ReadInt32(); + cps1_scancalls = reader.ReadInt32(); + for (i = 0; i < 0xc00; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x10000)); + gfxram_set = reader.ReadBytes(0x30000); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + for (i = 0; i < 2; i++) + { + Cpuexec.cpu[i].suspend = reader.ReadByte(); + Cpuexec.cpu[i].nextsuspend = reader.ReadByte(); + Cpuexec.cpu[i].eatcycles = reader.ReadByte(); + Cpuexec.cpu[i].nexteatcycles = reader.ReadByte(); + Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); + Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); + } + EmuTimer.LoadStateBinary(reader); + qsound_sharedram1_set = reader.ReadBytes(0x1000); + qsound_sharedram2_set = reader.ReadBytes(0x1000); + QSound.LoadStateBinary(reader); + Sound.qsoundstream.output_sampindex = reader.ReadInt32(); + Sound.qsoundstream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Eeprom.LoadStateBinary(reader); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/State.cs.meta new file mode 100644 index 00000000..1ace9d1a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3fd0f7ef6fe509489aee215cb4ce406 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Tilemap.cs new file mode 100644 index 00000000..3aa5abf7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Tilemap.cs @@ -0,0 +1,399 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class CPS + { + public static Tmap[] ttmap; + public static void tilemap_init() + { + int i; + ttmap = new Tmap[3]; + ttmap[0] = new Tmap(); + ttmap[0].tilewidth = 8; + ttmap[0].tileheight = 8; + ttmap[0].width = 0x200; + ttmap[0].height = 0x200; + ttmap[0].scrollrows = 1; + ttmap[0].pixmap = new ushort[0x200 * 0x200]; + ttmap[0].flagsmap = new byte[0x200, 0x200]; + ttmap[0].tileflags = new byte[0x40, 0x40]; + ttmap[0].pen_to_flags = new byte[4, 16]; + ttmap[0].pen_data_set = new byte[0x40]; + ttmap[1] = new Tmap(); + ttmap[1].tilewidth = 0x10; + ttmap[1].tileheight = 0x10; + ttmap[1].width = 0x400; + ttmap[1].height = 0x400; + ttmap[1].scrollrows = 0x400; + ttmap[1].pixmap = new ushort[0x400 * 0x400]; + ttmap[1].flagsmap = new byte[0x400, 0x400]; + ttmap[1].tileflags = new byte[0x40, 0x40]; + ttmap[1].pen_to_flags = new byte[4, 16]; + ttmap[1].pen_data_set = new byte[0x100]; + ttmap[2] = new Tmap(); + ttmap[2].tilewidth = 0x20; + ttmap[2].tileheight = 0x20; + ttmap[2].width = 0x800; + ttmap[2].height = 0x800; + ttmap[2].scrollrows = 1; + ttmap[2].pixmap = new ushort[0x800 * 0x800]; + ttmap[2].flagsmap = new byte[0x800, 0x800]; + ttmap[2].tileflags = new byte[0x40, 0x40]; + ttmap[2].pen_to_flags = new byte[4, 16]; + ttmap[2].pen_data_set = new byte[0x400]; + for (i = 0; i < 3; i++) + { + ttmap[i].rows = 0x40; + ttmap[i].cols = 0x40; + ttmap[i].enable = true; + ttmap[i].all_tiles_dirty = true; + ttmap[i].scrollcols = 1; + ttmap[i].rowscroll = new int[ttmap[i].scrollrows]; + ttmap[i].colscroll = new int[ttmap[i].scrollcols]; + ttmap[i].tilemap_draw_instance3 = ttmap[i].tilemap_draw_instanceC; + ttmap[i].tilemap_set_scrolldx(0, 0); + ttmap[i].tilemap_set_scrolldy(0x100, 0); + } + ttmap[0].tile_update3 = ttmap[0].tile_updateC0; + ttmap[1].tile_update3 = ttmap[1].tile_updateC1; + ttmap[2].tile_update3 = ttmap[2].tile_updateC2; + ttmap[0].total_elements = CPS.gfxromLength / 0x40; + ttmap[1].total_elements = CPS.gfxromLength / 0x80; + ttmap[2].total_elements = CPS.gfxromLength / 0x200; + } + } + public unsafe partial class Tmap + { + public void tile_updateC0(int col, int row) + { + byte group0, flags0; + int x0 = 0x08 * col; + int y0 = 0x08 * row; + int palette_base0; + int code, attr; + int memindex; + int gfxset; + int match; + int i, j; + memindex = (row & 0x1f) + ((col & 0x3f) << 5) + ((row & 0x20) << 6); + { + code = CPS.gfxram[(CPS.scroll1 + 2 * memindex) * 2] * 0x100 + CPS.gfxram[(CPS.scroll1 + 2 * memindex) * 2 + 1]; + match = 0; + foreach (CPS.gfx_range r in CPS.lsRange0) + { + if (code >= r.start && code <= r.end) + { + code += r.add; + match = 1; + break; + } + } + code %= CPS.ttmap[0].total_elements; + gfxset = (memindex & 0x20) >> 5; + attr = CPS.gfxram[(CPS.scroll1 + 2 * memindex + 1) * 2] * 0x100 + CPS.gfxram[(CPS.scroll1 + 2 * memindex + 1) * 2 + 1]; + { + if (match == 0) + { + AxiArray.Copy(Tilemap.bb0F, 0, pen_data, 0, 0x40); + } + else + { + for (j = 0; j < 0x08; j++) + { + AxiArray.Copy(CPS.gfx1rom, code * 0x80 + gfxset * 8 + j * 0x10, pen_data, j * 8, 8); + } + } + palette_base0 = 0x10 * ((attr & 0x1f) + 0x20); + flags0 = (byte)(((attr & 0x60) >> 5) & 3); + } + group0 = (byte)((attr & 0x0180) >> 7); + } + { + int offset = 0; + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + if ((flags0 & Tilemap.TILE_FLIPY) != 0) + { + y0 += 0x07; + dy0 = -1; + } + if ((flags0 & Tilemap.TILE_FLIPX) != 0) + { + x0 += 0x07; + dx0 = -1; + } + for (ty = 0; ty < 0x08; ty++) + { + int offsetx1 = x0; + int offsety1 = y0; + int xoffs = 0; + y0 += dy0; + for (tx = 0; tx < 0x08; tx++) + { + byte pen, map; + pen = pen_data[offset]; + map = pen_to_flags[group0, pen]; + pixmap[offsety1 * 0x200 + offsetx1 + xoffs] = (ushort)(palette_base0 + pen); + flagsmap[offsety1, offsetx1 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + offset++; + } + } + tileflags[row, col] = (byte)(andmask ^ ormask); + } + } + public void tile_updateC1(int col, int row) + { + byte group1, flags1; + int x0 = 0x10 * col; + int y0 = 0x10 * row; + int palette_base1; + int code, attr; + int memindex; + int match; + memindex = (row & 0x0f) + ((col & 0x3f) << 4) + ((row & 0x30) << 6); + { + code = CPS.gfxram[(CPS.scroll2 + 2 * memindex) * 2] * 0x100 + CPS.gfxram[(CPS.scroll2 + 2 * memindex) * 2 + 1]; + match = 0; + foreach (CPS.gfx_range r in CPS.lsRange1) + { + if (code >= r.start && code <= r.end) + { + code += r.add; + match = 1; + break; + } + } + code %= CPS.ttmap[1].total_elements; + attr = CPS.gfxram[(CPS.scroll2 + 2 * memindex + 1) * 2] * 0x100 + CPS.gfxram[(CPS.scroll2 + 2 * memindex + 1) * 2 + 1]; + if (match == 0) + { + AxiArray.Copy(Tilemap.bb0F, 0, pen_data, 0, 0x100); + } + else + { + AxiArray.Copy(CPS.gfx1rom, code * 0x100, pen_data, 0, 0x100); + } + palette_base1 = 0x10 * ((attr & 0x1f) + 0x40); + flags1 = (byte)(((attr & 0x60) >> 5) & 3); + group1 = (byte)((attr & 0x0180) >> 7); + } + { + int offset = 0; + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + if ((flags1 & Tilemap.TILE_FLIPY) != 0) + { + y0 += 0x0f; + dy0 = -1; + } + if ((flags1 & Tilemap.TILE_FLIPX) != 0) + { + x0 += 0x0f; + dx0 = -1; + } + for (ty = 0; ty < 0x10; ty++) + { + int offsetx1 = x0; + int offsety1 = y0; + int xoffs = 0; + y0 += dy0; + for (tx = 0; tx < 0x10; tx++) + { + byte pen, map; + pen = pen_data[offset]; + map = pen_to_flags[group1, pen]; + pixmap[offsety1 * 0x400 + offsetx1 + xoffs] = (ushort)(palette_base1 + pen); + flagsmap[offsety1, offsetx1 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + offset++; + } + } + tileflags[row, col] = (byte)(andmask ^ ormask); + } + } + public void tile_updateC2(int col, int row) + { + byte group2, flags2; + int x0 = 0x20 * col; + int y0 = 0x20 * row; + int palette_base2; + int code, attr; + int memindex; + int match; + memindex = (row & 0x07) + ((col & 0x3f) << 3) + ((row & 0x38) << 6); + { + code = (CPS.gfxram[(CPS.scroll3 + 2 * memindex) * 2] * 0x100 + CPS.gfxram[(CPS.scroll3 + 2 * memindex) * 2 + 1]) & 0x3fff; + match = 0; + foreach (CPS.gfx_range r in CPS.lsRange2) + { + if (code >= r.start && code <= r.end) + { + code += r.add; + match = 1; + break; + } + } + code %= CPS.ttmap[2].total_elements; + attr = CPS.gfxram[(CPS.scroll3 + 2 * memindex + 1) * 2] * 0x100 + CPS.gfxram[(CPS.scroll3 + 2 * memindex + 1) * 2 + 1]; + if (match == 0) + { + AxiArray.Copy(Tilemap.bb0F, 0, pen_data, 0, 0x400); + } + else + { + AxiArray.Copy(CPS.gfx1rom, code * 0x400, pen_data, 0, 0x400); + } + palette_base2 = 0x10 * ((attr & 0x1f) + 0x60); + flags2 = (byte)(((attr & 0x60) >> 5) & 3); + group2 = (byte)((attr & 0x0180) >> 7); + } + { + int offset = 0; + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + if ((flags2 & Tilemap.TILE_FLIPY) != 0) + { + y0 += 0x1f; + dy0 = -1; + } + if ((flags2 & Tilemap.TILE_FLIPX) != 0) + { + x0 += 0x1f; + dx0 = -1; + } + for (ty = 0; ty < 0x20; ty++) + { + int offsetx1 = x0; + int offsety1 = y0; + int xoffs = 0; + y0 += dy0; + for (tx = 0; tx < 0x20; tx++) + { + byte pen, map; + pen = pen_data[offset]; + map = pen_to_flags[group2, pen]; + pixmap[offsety1 * 0x800 + offsetx1 + xoffs] = (ushort)(palette_base2 + pen); + flagsmap[offsety1, offsetx1 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + offset++; + } + } + tileflags[row, col] = (byte)(andmask ^ ormask); + } + } + public void tilemap_draw_instanceC(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + continue; + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x200 + xpos + x_start, x_end - x_start); + if (priority != 0) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = pixmap[offsety2 * width + i - xpos]; + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Tilemap.cs.meta new file mode 100644 index 00000000..1600fe98 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 66ffb440d3161434cbc8e12a4ffb472f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Video.cs new file mode 100644 index 00000000..6437a0fa --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Video.cs @@ -0,0 +1,884 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class CPS + { + private static int iXAll, iYAll, nBitmap; + //private static Bitmap bmAll=new Bitmap(512,512); + private static List lBitmapHash = new List(); + private static int cpsb_addr, cpsb_value, mult_factor1, mult_factor2, mult_result_lo, mult_result_hi; + public static int layercontrol, layer_control, palette_control, in2_addr, in3_addr, out2_addr, bootleg_kludge; + public static int[] priority, layer_enable_mask; + public static int total_elements; + public static uint[] primasks; + private static int CPS1_OBJ_BASE = 0; /* Base address of objects */ + private static int CPS1_SCROLL1_BASE = (0x02 / 2); /* Base address of scroll 1 */ + private static int CPS1_SCROLL2_BASE = (0x04 / 2); /* Base address of scroll 2 */ + private static int CPS1_SCROLL3_BASE = (0x06 / 2); /* Base address of scroll 3 */ + private static int CPS1_OTHER_BASE = (0x08 / 2); /* Base address of other video */ + private static int CPS1_PALETTE_BASE = (0x0a / 2); /* Base address of palette */ + public static int CPS1_SCROLL1_SCROLLX = (0x0c / 2); /* Scroll 1 X */ + public static int CPS1_SCROLL1_SCROLLY = (0x0e / 2); /* Scroll 1 Y */ + public static int CPS1_SCROLL2_SCROLLX = (0x10 / 2); /* Scroll 2 X */ + public static int CPS1_SCROLL2_SCROLLY = (0x12 / 2); /* Scroll 2 Y */ + public static int CPS1_SCROLL3_SCROLLX = (0x14 / 2); /* Scroll 3 X */ + public static int CPS1_SCROLL3_SCROLLY = (0x16 / 2); /* Scroll 3 Y */ + private static int CPS1_STARS1_SCROLLX = (0x18 / 2); /* Stars 1 X */ + private static int CPS1_STARS1_SCROLLY = (0x1a / 2); /* Stars 1 Y */ + private static int CPS1_STARS2_SCROLLX = (0x1c / 2); /* Stars 2 X */ + private static int CPS1_STARS2_SCROLLY = (0x1e / 2); /* Stars 2 Y */ + public static int CPS1_ROWSCROLL_OFFS = (0x20 / 2); /* base of row scroll offsets in other RAM */ + private static int CPS1_VIDEOCONTROL = (0x22 / 2); /* flip screen, rowscroll enable */ + public static int scroll1, scroll2, scroll3; + public static int scroll1xoff = 0, scroll2xoff = 0, scroll3xoff = 0; + public static int obj, other; + private static ushort[] cps1_buffered_obj, /*cps2_buffered_obj,*/ uuBFF; + private static int cps1_last_sprite_offset; + private static int[] cps1_stars_enabled; + private static byte TILEMAP_PIXEL_TRANSPARENT = 0x00; /* transparent if in none of the layers below */ + private static byte TILEMAP_PIXEL_LAYER0 = 0x10; /* pixel is opaque in layer 0 */ + private static byte TILEMAP_PIXEL_LAYER1 = 0x20; /* pixel is opaque in layer 1 */ + private static byte TILEMAP_PIXEL_LAYER2 = 0x40; /* pixel is opaque in layer 2 */ + public static int scroll1x, scroll1y; + public static int scroll2x, scroll2y; + public static int scroll3x, scroll3y; + private static int stars1x, stars1y, stars2x, stars2y; + public static int pri_ctrl; + + public static bool bRecord; + + + #region //指针化 cps2_buffered_obj + static ushort[] cps2_buffered_obj_src; + static GCHandle cps2_buffered_obj_handle; + public static ushort* cps2_buffered_obj; + public static int cps2_buffered_objLength; + public static bool cps2_buffered_obj_IsNull => cps2_buffered_obj == null; + public static ushort[] cps2_buffered_obj_set + { + set + { + cps2_buffered_obj_handle.ReleaseGCHandle(); + cps2_buffered_obj_src = value; + cps2_buffered_objLength = value.Length; + cps2_buffered_obj_src.GetObjectPtr(ref cps2_buffered_obj_handle, ref cps2_buffered_obj); + } + } + #endregion + + private static int cps1_base(int offset, int boundary) + { + int base1 = cps_a_regs[offset] * 256; + int poffset; + base1 &= ~(boundary - 1); + poffset = base1 & 0x3ffff; + return poffset / 2; + } + private static void cps1_cps_a_w(int add, byte data) + { + int offset = add / 2; + if (add % 2 == 0) + { + cps_a_regs[offset] = (ushort)((data << 8) | (cps_a_regs[offset] & 0xff)); + } + else + { + cps_a_regs[offset] = (ushort)((cps_a_regs[offset] & 0xff00) | data); + } + if (offset == CPS1_PALETTE_BASE) + { + cps1_build_palette(cps1_base(CPS1_PALETTE_BASE, 0x0400)); + } + } + private static void cps1_cps_a_w(int offset, ushort data) + { + cps_a_regs[offset] = data; + if (offset == CPS1_PALETTE_BASE) + { + cps1_build_palette(cps1_base(CPS1_PALETTE_BASE, 0x0400)); + } + } + private static ushort cps1_cps_b_r(int offset) + { + if (offset == cpsb_addr / 2) + return (ushort)cpsb_value; + if (offset == mult_result_lo / 2) + return (ushort)((cps_b_regs[mult_factor1 / 2] * cps_b_regs[mult_factor2 / 2]) & 0xffff); + if (offset == mult_result_hi / 2) + return (ushort)((cps_b_regs[mult_factor1 / 2] * cps_b_regs[mult_factor2 / 2]) >> 16); + if (offset == in2_addr / 2) /* Extra input ports (on C-board) */ + { + return (ushort)short2; + } + if (offset == in3_addr / 2) /* Player 4 controls (on C-board) ("Captain Commando") */ + { + return (ushort)sbyte3; + } + if (cps_version == 2) + { + if (offset == 0x10 / 2) + { + return cps_b_regs[0x10 / 2]; + } + if (offset == 0x12 / 2) + { + return cps_b_regs[0x12 / 2]; + } + } + return 0xffff; + } + private static void cps1_cps_b_w(int offset, ushort data) + { + cps_b_regs[offset] = data; + if (cps_version == 2) + { + if (offset == 0x0e / 2) + { + return; + } + if (offset == 0x10 / 2) + { + cps1_scanline1 = (data & 0x1ff); + return; + } + if (offset == 0x12 / 2) + { + cps1_scanline2 = (data & 0x1ff); + return; + } + } + if (offset == out2_addr / 2) + { + Generic.coin_lockout_w(2, ~data & 0x02); + Generic.coin_lockout_w(3, ~data & 0x08); + } + } + private static void cps1_get_video_base() + { + int videocontrol; + if (scroll1 != cps1_base(CPS1_SCROLL1_BASE, 0x4000)) + { + scroll1 = cps1_base(CPS1_SCROLL1_BASE, 0x4000); + ttmap[0].all_tiles_dirty = true; + } + if (scroll2 != cps1_base(CPS1_SCROLL2_BASE, 0x4000)) + { + scroll2 = cps1_base(CPS1_SCROLL2_BASE, 0x4000); + ttmap[1].all_tiles_dirty = true; + } + if (scroll3 != cps1_base(CPS1_SCROLL3_BASE, 0x4000)) + { + scroll3 = cps1_base(CPS1_SCROLL3_BASE, 0x4000); + ttmap[2].all_tiles_dirty = true; + } + if (bootleg_kludge == 1) + { + cps_a_regs[CPS1_OBJ_BASE] = 0x9100; + } + else if (bootleg_kludge == 2) + { + cps_a_regs[CPS1_OBJ_BASE] = 0x9100; + } + else if (bootleg_kludge == 0x88) // 3wondersb + { + cps_b_regs[0x30 / 2] = 0x3f; + cps_a_regs[CPS1_VIDEOCONTROL] = 0x3e; + cps_a_regs[CPS1_SCROLL2_BASE] = 0x90c0; + cps_a_regs[CPS1_SCROLL3_BASE] = 0x9100; + cps_a_regs[CPS1_PALETTE_BASE] = 0x9140; + } + obj = cps1_base(CPS1_OBJ_BASE, 0x800); + other = cps1_base(CPS1_OTHER_BASE, 0x800); + scroll1x = cps_a_regs[CPS1_SCROLL1_SCROLLX] + scroll1xoff; + scroll1y = cps_a_regs[CPS1_SCROLL1_SCROLLY]; + scroll2x = cps_a_regs[CPS1_SCROLL2_SCROLLX] + scroll2xoff; + scroll2y = cps_a_regs[CPS1_SCROLL2_SCROLLY]; + scroll3x = cps_a_regs[CPS1_SCROLL3_SCROLLX] + scroll3xoff; + scroll3y = cps_a_regs[CPS1_SCROLL3_SCROLLY]; + ttmap[0].rowscroll[0] = cps_a_regs[CPS1_SCROLL1_SCROLLX] + scroll1xoff; + ttmap[0].colscroll[0] = cps_a_regs[CPS1_SCROLL1_SCROLLX]; + ttmap[1].rowscroll[0] = cps_a_regs[CPS1_SCROLL2_SCROLLX] + scroll1xoff; + ttmap[1].colscroll[0] = cps_a_regs[CPS1_SCROLL2_SCROLLX]; + ttmap[2].rowscroll[0] = cps_a_regs[CPS1_SCROLL3_SCROLLX] + scroll1xoff; + ttmap[2].colscroll[0] = cps_a_regs[CPS1_SCROLL3_SCROLLX]; + stars1x = cps_a_regs[CPS1_STARS1_SCROLLX]; + stars1y = cps_a_regs[CPS1_STARS1_SCROLLY]; + stars2x = cps_a_regs[CPS1_STARS2_SCROLLX]; + stars2y = cps_a_regs[CPS1_STARS2_SCROLLY]; + layercontrol = cps_b_regs[layer_control / 2]; + videocontrol = cps_a_regs[CPS1_VIDEOCONTROL]; + ttmap[0].enable = ((layercontrol & layer_enable_mask[0]) != 0); + ttmap[1].enable = ((layercontrol & layer_enable_mask[1]) != 0 && (videocontrol & 4) != 0); + ttmap[2].enable = ((layercontrol & layer_enable_mask[2]) != 0 && (videocontrol & 8) != 0); + cps1_stars_enabled[0] = layercontrol & layer_enable_mask[3]; + cps1_stars_enabled[1] = layercontrol & layer_enable_mask[4]; + } + private static void cps1_gfxram_w(int offset) + { + int row, col; + int page = (offset >> 7) & 0x3c0; + int memindex; + if (page == (cps_a_regs[CPS1_SCROLL1_BASE] & 0x3c0)) + { + memindex = offset / 2 & 0x0fff; + row = memindex / 0x800 * 0x20; + memindex %= 0x800; + row += memindex % 0x20; + col = memindex / 0x20; + ttmap[0].tilemap_mark_tile_dirty(row, col); + } + if (page == (cps_a_regs[CPS1_SCROLL2_BASE] & 0x3c0)) + { + memindex = offset / 2 & 0x0fff; + row = memindex / 0x400 * 0x10; + memindex %= 0x400; + row += memindex % 0x10; + col = memindex / 0x10; + ttmap[1].tilemap_mark_tile_dirty(row, col); + } + if (page == (cps_a_regs[CPS1_SCROLL3_BASE] & 0x3c0)) + { + memindex = offset / 2 & 0x0fff; + row = memindex / 0x200 * 0x08; + memindex %= 0x200; + row += memindex % 0x08; + col = memindex / 0x08; + ttmap[2].tilemap_mark_tile_dirty(row, col); + } + } + private static void cps1_update_transmasks() + { + int group, pen, mask; + for (group = 0; group < 4; group++) + { + if (priority[group] != -1) + { + mask = cps_b_regs[priority[group] / 2] ^ 0xffff; + } + else + { + if ((layercontrol & (1 << group)) != 0) + { + mask = 0x8000; + } + else + { + mask = 0xffff; + } + } + for (pen = 0; pen < 16; pen++) + { + byte fgbits = (((mask >> pen) & 1) != 0) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER0; + byte bgbits = (((0x8000 >> pen) & 1) != 0) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER1; + byte layermask = (byte)(fgbits | bgbits); + if (ttmap[0].pen_to_flags[group, pen] != layermask) + { + ttmap[0].pen_to_flags[group, pen] = layermask; + ttmap[0].all_tiles_dirty = true; + } + if (ttmap[1].pen_to_flags[group, pen] != layermask) + { + ttmap[1].pen_to_flags[group, pen] = layermask; + ttmap[1].all_tiles_dirty = true; + } + if (ttmap[2].pen_to_flags[group, pen] != layermask) + { + ttmap[2].pen_to_flags[group, pen] = layermask; + ttmap[2].all_tiles_dirty = true; + } + } + } + } + public static void video_start_cps() + { + //bmAll = new Bitmap(512, 512); + //Graphics g = Graphics.FromImage(bmAll); + //g.Clear(Color.Magenta); + //g.Dispose(); + int i; + ttmap[0].enable = true; + ttmap[1].enable = true; + ttmap[2].enable = true; + ttmap[0].all_tiles_dirty = true; + ttmap[1].all_tiles_dirty = true; + ttmap[2].all_tiles_dirty = true; + Array.Clear(ttmap[0].pen_to_flags, 0, 0x40); + Array.Clear(ttmap[1].pen_to_flags, 0, 0x40); + Array.Clear(ttmap[2].pen_to_flags, 0, 0x40); + cps1_update_transmasks(); + for (i = 0; i < 0xc00; i++) + { + Palette.palette_entry_set_color1(i, Palette.make_rgb(0, 0, 0)); + } + primasks = new uint[8]; + cps1_stars_enabled = new int[2]; + cps1_buffered_obj = new ushort[0x400]; + cps2_buffered_obj_set = new ushort[0x1000]; + cps2_objram1_set = new ushort[0x1000]; + cps2_objram2_set = new ushort[0x1000]; + + uuBFF = new ushort[0x200 * 0x200]; + for (i = 0; i < 0x40000; i++) + { + uuBFF[i] = 0xbff; + } + Array.Clear(cps1_buffered_obj, 0, 0x400); + AxiArray.Clear(cps2_buffered_obj, 0, 0x1000); + + AxiArray.Clear(gfxram, 0, 0x30000); + AxiArray.Clear(cps_a_regs, 0, 0x20); + AxiArray.Clear(cps_b_regs, 0, 0x20); + AxiArray.Clear(cps2_objram1, 0, 0x1000); + AxiArray.Clear(cps2_objram2, 0, 0x1000); + + cps_a_regs[CPS1_OBJ_BASE] = 0x9200; + cps_a_regs[CPS1_SCROLL1_BASE] = 0x9000; + cps_a_regs[CPS1_SCROLL2_BASE] = 0x9040; + cps_a_regs[CPS1_SCROLL3_BASE] = 0x9080; + cps_a_regs[CPS1_OTHER_BASE] = 0x9100; + if (bootleg_kludge == 0) + { + scroll1xoff = 0; + scroll2xoff = 0; + scroll3xoff = 0; + } + else if (bootleg_kludge == 1) + { + scroll1xoff = -0x0c; + scroll2xoff = -0x0e; + scroll3xoff = -0x10; + } + else if (bootleg_kludge == 2) + { + scroll1xoff = -0x0c; + scroll2xoff = -0x10; + scroll3xoff = -0x10; + } + else if (bootleg_kludge == 3) + { + scroll1xoff = -0x08; + scroll2xoff = -0x0b; + scroll3xoff = -0x0c; + } + else if (bootleg_kludge == 0x88) + { + scroll1xoff = 0x4; + scroll2xoff = 0x6; + scroll3xoff = 0xa; + } + cps1_get_video_base(); /* Calculate base pointers */ + cps1_get_video_base(); /* Calculate old base pointers */ + } + private static void cps1_build_palette(int palette_offset) + { + int offset, page; + int pallete_offset1 = palette_offset; + int ctrl = cps_b_regs[palette_control / 2]; + for (page = 0; page < 6; ++page) + { + if (((ctrl >> page) & 1) != 0) + { + for (offset = 0; offset < 0x200; ++offset) + { + int palette = gfxram[pallete_offset1 * 2] * 0x100 + gfxram[pallete_offset1 * 2 + 1]; + pallete_offset1++; + int r, g, b, bright; + bright = 0x0f + ((palette >> 12) << 1); + r = ((palette >> 8) & 0x0f) * 0x11 * bright / 0x2d; + g = ((palette >> 4) & 0x0f) * 0x11 * bright / 0x2d; + b = ((palette >> 0) & 0x0f) * 0x11 * bright / 0x2d; + Palette.palette_entry_set_color1(0x200 * page + offset, Palette.make_rgb(r, g, b)); + } + } + else + { + if (pallete_offset1 != palette_offset) + pallete_offset1 += 0x200; + } + } + } + private static void cps1_find_last_sprite() /* Find the offset of last sprite */ + { + int offset = 0; + /* Locate the end of table marker */ + while (offset < 0x400) + { + if (bootleg_kludge == 3) + { + /* captcommb - same end of sprite marker as CPS-2 */ + int colour = cps1_buffered_obj[offset + 1]; + if (colour >= 0x8000) + { + /* Marker found. This is the last sprite. */ + cps1_last_sprite_offset = offset - 4; + return; + } + } + else + { + int colour = cps1_buffered_obj[offset + 3]; + if ((colour & 0xff00) == 0xff00) + { + /* Marker found. This is the last sprite. */ + cps1_last_sprite_offset = offset - 4; + return; + } + } + offset += 4; + } + /* Sprites must use full sprite RAM */ + cps1_last_sprite_offset = 0x400 - 4; + } + private static void cps1_render_sprites() + { + int i, match; + int baseoffset, baseadd; + if ((bootleg_kludge == 1) || (bootleg_kludge == 2) || (bootleg_kludge == 3)) + { + baseoffset = cps1_last_sprite_offset; + baseadd = -4; + } + else + { + baseoffset = 0; + baseadd = 4; + } + for (i = 0; i <= cps1_last_sprite_offset; i += 4) + { + int x, y, code, colour, col; + x = cps1_buffered_obj[baseoffset]; + y = cps1_buffered_obj[baseoffset + 1]; + code = cps1_buffered_obj[baseoffset + 2]; + colour = cps1_buffered_obj[baseoffset + 3]; + col = colour & 0x1f; + if (x == 0 && y == 0 && code == 0 && colour == 0) + { + baseoffset += baseadd; + continue; + } + match = 0; + foreach (gfx_range r in lsRangeS) + { + if (code >= r.start && code <= r.end) + { + code += r.add; + match = 1; + break; + } + } + if (match == 0) + { + baseoffset += baseadd; + continue; + } + y += 0x100; + if ((colour & 0xff00) != 0) + { + int nx = (colour & 0x0f00) >> 8; + int ny = (colour & 0xf000) >> 12; + int nxs, nys, sx, sy; + nx++; + ny++; + if ((colour & 0x40) != 0) + { + /* Y flip */ + if ((colour & 0x20) != 0) + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16) & 0x1ff; + sy = (y + nys * 16) & 0x1ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, (code & ~0xf) + ((code + (nx - 1) - nxs) & 0xf) + 0x10 * (ny - 1 - nys), col, 1, 1, sx, sy, 0x80000002, Video.screenstate.visarea); + } + } + } + else + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16) & 0x1ff; + sy = (y + nys * 16) & 0x1ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, (code & ~0xf) + ((code + nxs) & 0xf) + 0x10 * (ny - 1 - nys), col, 0, 1, sx, sy, 0x80000002, Video.screenstate.visarea); + } + } + } + } + else + { + if ((colour & 0x20) != 0) + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16) & 0x1ff; + sy = (y + nys * 16) & 0x1ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, (code & ~0xf) + ((code + (nx - 1) - nxs) & 0xf) + 0x10 * nys, col, 1, 0, sx, sy, 0x80000002, Video.screenstate.visarea); + } + } + } + else + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16) & 0x1ff; + sy = (y + nys * 16) & 0x1ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, (code & ~0xf) + ((code + nxs) & 0xf) + 0x10 * nys, col, 0, 0, sx, sy, 0x80000002, Video.screenstate.visarea); + } + } + } + } + } + else + { + Drawgfx.common_drawgfx_c(CPS.gfx1rom, code, col, colour & 0x20, colour & 0x40, x & 0x1ff, y & 0x1ff, 0x80000002, Video.screenstate.visarea); + } + baseoffset += baseadd; + } + } + private static void cps2_render_sprites() + { + int i, x, y, priority, code, colour, col, cps2_last_sprite_offset; + int xoffs = 64 - cps2_port(0x08); + int yoffs = 16 - cps2_port(0x0a); + cps2_last_sprite_offset = 0x3ff; + for (i = 0; i < 0x400; i++) + { + y = cps2_buffered_obj[i * 4 + 1]; + colour = cps2_buffered_obj[i * 4 + 3]; + if (y >= 0x8000 || colour >= 0xff00) + { + cps2_last_sprite_offset = i - 1; + break; + } + } + for (i = cps2_last_sprite_offset; i >= 0; i--) + { + x = cps2_buffered_obj[i * 4]; + y = cps2_buffered_obj[i * 4 + 1]; + priority = (x >> 13) & 0x07; + code = cps2_buffered_obj[i * 4 + 2] + ((y & 0x6000) << 3); + colour = cps2_buffered_obj[i * 4 + 3]; + col = colour & 0x1f; + if ((colour & 0x80) != 0) + { + x += cps2_port(0x08); /* fix the offset of some games */ + y += cps2_port(0x0a); /* like Marvel vs. Capcom ending credits */ + } + y += 0x100; + if ((colour & 0xff00) != 0) + { + /* handle blocked sprites */ + int nx = (colour & 0x0f00) >> 8; + int ny = (colour & 0xf000) >> 12; + int nxs, nys, sx, sy; + nx++; + ny++; + if ((colour & 0x40) != 0) + { + /* Y flip */ + if ((colour & 0x20) != 0) + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16 + xoffs) & 0x3ff; + sy = (y + nys * 16 + yoffs) & 0x3ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, code + (nx - 1) - nxs + 0x10 * (ny - 1 - nys), (col & 0x1f), 1, 1, sx, sy, (uint)(primasks[priority] | 0x80000000), Video.screenstate.visarea); + } + } + } + else + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16 + xoffs) & 0x3ff; + sy = (y + nys * 16 + yoffs) & 0x3ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, code + nxs + 0x10 * (ny - 1 - nys), (col & 0x1f), 0, 1, sx, sy, (uint)(primasks[priority] | 0x80000000), Video.screenstate.visarea); + } + } + } + } + else + { + if ((colour & 0x20) != 0) + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16 + xoffs) & 0x3ff; + sy = (y + nys * 16 + yoffs) & 0x3ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, code + (nx - 1) - nxs + 0x10 * nys, (col & 0x1f), 1, 0, sx, sy, (uint)(primasks[priority] | 0x80000000), Video.screenstate.visarea); + } + } + } + else + { + for (nys = 0; nys < ny; nys++) + { + for (nxs = 0; nxs < nx; nxs++) + { + sx = (x + nxs * 16 + xoffs) & 0x3ff; + sy = (y + nys * 16 + yoffs) & 0x3ff; + Drawgfx.common_drawgfx_c(CPS.gfx1rom, (code & ~0xf) + ((code + nxs) & 0xf) + 0x10 * nys, (col & 0x1f), 0, 0, sx, sy, (uint)(primasks[priority] | 0x80000000), Video.screenstate.visarea); + } + } + } + } + } + else + { + /* Simple case... 1 sprite */ + Drawgfx.common_drawgfx_c(CPS.gfx1rom, code, (col & 0x1f), colour & 0x20, colour & 0x40, (x + xoffs) & 0x3ff, (y + yoffs) & 0x3ff, (uint)(primasks[priority] | 0x80000000), Video.screenstate.visarea); + } + } + } + private static void cps1_render_stars() + { + int offs; + if (starsrom == null && (cps1_stars_enabled[0] != 0 || cps1_stars_enabled[1] != 0)) + { + return;//stars enabled but no stars ROM + } + if (cps1_stars_enabled[0] != 0) + { + for (offs = 0; offs < 0x2000 / 2; offs++) + { + int col = starsrom[8 * offs + 4]; + if (col != 0x0f) + { + int sx = (offs / 256) * 32; + int sy = (offs % 256); + sx = (sx - stars2x + (col & 0x1f)) & 0x1ff; + sy = ((sy - stars2y) & 0xff) + 0x100; + col = (int)(((col & 0xe0) >> 1) + (Video.screenstate.frame_number / 16 & 0x0f)); + if (sx >= Video.screenstate.visarea.min_x && sx <= Video.screenstate.visarea.max_x && sy >= Video.screenstate.visarea.min_y && sy <= Video.screenstate.visarea.max_y) + Video.bitmapbase_Ptrs[Video.curbitmap][sy * 0x200 + sx] = (ushort)(0xa00 + col); + } + } + } + if (cps1_stars_enabled[1] != 0) + { + for (offs = 0; offs < 0x2000 / 2; offs++) + { + int col = starsrom[8 * offs]; + if (col != 0x0f) + { + int sx = (offs / 256) * 32; + int sy = (offs % 256); + sx = (sx - stars1x + (col & 0x1f)) & 0x1ff; + sy = ((sy - stars1y) & 0xff) + 0x100; + col = (int)(((col & 0xe0) >> 1) + (Video.screenstate.frame_number / 16 & 0x0f)); + if (sx >= Video.screenstate.visarea.min_x && sx <= Video.screenstate.visarea.max_x && sy >= Video.screenstate.visarea.min_y && sy <= Video.screenstate.visarea.max_y) + Video.bitmapbase_Ptrs[Video.curbitmap][sy * 0x200 + sx] = (ushort)(0x800 + col); + } + } + } + } + private static void cps1_render_layer(int layer, byte primask) + { + switch (layer) + { + case 0: + cps1_render_sprites(); + break; + case 1: + ttmap[0].tilemap_draw_primask(Video.screenstate.visarea, 0x20, primask); + break; + case 2: + ttmap[1].tilemap_draw_primask(Video.screenstate.visarea, 0x20, primask); + break; + case 3: + ttmap[2].tilemap_draw_primask(Video.screenstate.visarea, 0x20, primask); + break; + } + } + private static void cps1_render_high_layer(int layer) + { + switch (layer) + { + case 0: + break; + case 1: + ttmap[0].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 1); + break; + case 2: + ttmap[1].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 1); + break; + case 3: + ttmap[2].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 1); + break; + } + } + public unsafe static void video_update_cps1() + { + int i; + int l0, l1, l2, l3; + int videocontrol = cps_a_regs[CPS1_VIDEOCONTROL]; + layercontrol = cps_b_regs[layer_control / 2]; + cps1_get_video_base(); + cps1_find_last_sprite(); + cps1_update_transmasks(); + ttmap[0].tilemap_set_scrollx(0, scroll1x); + ttmap[0].tilemap_set_scrolly(0, scroll1y); + if ((videocontrol & 0x01) != 0) /* linescroll enable */ + { + int scrly = -scroll2y; + int otheroffs; + ttmap[1].scrollrows = 1024; + otheroffs = cps_a_regs[CPS1_ROWSCROLL_OFFS]; + for (i = 0; i < 0x400; i++)//0x100 + { + ttmap[1].tilemap_set_scrollx((i - scrly) & 0x3ff, scroll2x + gfxram[(other + ((otheroffs + i) & 0x3ff)) * 2] * 0x100 + gfxram[(other + ((otheroffs + i) & 0x3ff)) * 2 + 1]); + } + } + else + { + ttmap[1].scrollrows = 1; + ttmap[1].tilemap_set_scrollx(0, scroll2x); + } + ttmap[1].tilemap_set_scrolly(0, scroll2y); + ttmap[2].tilemap_set_scrollx(0, scroll3x); + ttmap[2].tilemap_set_scrolly(0, scroll3y); + Array.Copy(uuBFF, Video.bitmapbase[Video.curbitmap], 0x40000); + cps1_render_stars(); + l0 = (layercontrol >> 0x06) & 03; + l1 = (layercontrol >> 0x08) & 03; + l2 = (layercontrol >> 0x0a) & 03; + l3 = (layercontrol >> 0x0c) & 03; + Array.Clear(Tilemap.priority_bitmap, 0, 0x40000); + if (cps_version == 1) + { + if ((bootleg_kludge & 0x80) != 0) + { + cps1_build_palette(cps1_base(CPS1_PALETTE_BASE, 0x0400)); + } + cps1_render_layer(l0, 0); + if (l1 == 0) + cps1_render_high_layer(l0); /* prepare mask for sprites */ + cps1_render_layer(l1, 0); + if (l2 == 0) + cps1_render_high_layer(l1); /* prepare mask for sprites */ + cps1_render_layer(l2, 0); + if (l3 == 0) + cps1_render_high_layer(l2); /* prepare mask for sprites */ + cps1_render_layer(l3, 0); + } + else + { + int l0pri, l1pri, l2pri, l3pri; + l0pri = (pri_ctrl >> 4 * l0) & 0x0f; + l1pri = (pri_ctrl >> 4 * l1) & 0x0f; + l2pri = (pri_ctrl >> 4 * l2) & 0x0f; + l3pri = (pri_ctrl >> 4 * l3) & 0x0f; + /* take out the CPS1 sprites layer */ + if (l0 == 0) + { + l0 = l1; l1 = 0; l0pri = l1pri; + } + if (l1 == 0) + { + l1 = l2; l2 = 0; l1pri = l2pri; + } + if (l2 == 0) + { + l2 = l3; l3 = 0; l2pri = l3pri; + } + { + int mask0 = 0xaa; + int mask1 = 0xcc; + if (l0pri > l1pri) + { + mask0 &= ~0x88; + } + if (l0pri > l2pri) + { + mask0 &= ~0xa0; + } + if (l1pri > l2pri) + { + mask1 &= ~0xc0; + } + primasks[0] = 0xff; + for (i = 1; i < 8; i++) + { + if (i <= l0pri && i <= l1pri && i <= l2pri) + { + primasks[i] = 0xfe; + continue; + } + primasks[i] = 0; + if (i <= l0pri) + { + primasks[i] |= (uint)mask0; + } + if (i <= l1pri) + { + primasks[i] |= (uint)mask1; + } + if (i <= l2pri) + { + primasks[i] |= 0xf0; + } + } + } + cps1_render_layer(l0, 1); + cps1_render_layer(l1, 2); + cps1_render_layer(l2, 4); + cps2_render_sprites();//screen->machine, bitmap, cliprect, primasks); + } + } + public static void video_eof_cps1() + { + int i; + cps1_get_video_base(); + if (cps_version == 1) + { + for (i = 0; i < 0x400; i++) + { + cps1_buffered_obj[i] = (ushort)(gfxram[obj * 2 + i * 2] * 0x100 + gfxram[obj * 2 + i * 2 + 1]); + } + } + } + public static int cps2_port(int offset) + { + return cps2_output[offset / 2]; + } + public static void cps2_set_sprite_priorities() + { + pri_ctrl = cps2_port(0x04); + } + public static void cps2_objram_latch() + { + cps2_set_sprite_priorities(); + //memcpy(cps2_buffered_obj, cps2_objbase(), cps2_obj_size); + int baseptr; + baseptr = 0x7000; + if ((cps2_objram_bank & 1) != 0) + { + baseptr ^= 0x0080; + } + if (baseptr == 0x7000) + { + AxiArray.Copy(cps2_objram1, cps2_buffered_obj, 0x1000); + } + else + { + AxiArray.Copy(cps2_objram2, cps2_buffered_obj, 0x1000); + } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Video.cs.meta new file mode 100644 index 00000000..007fbc9d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/cps/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd4e6b9b4543616469b8be6255ea53ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast.meta new file mode 100644 index 00000000..af876b3a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f48bf30c1e71a140ae0d890aa5799f9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Drawgfx.cs new file mode 100644 index 00000000..c1f59ce4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Drawgfx.cs @@ -0,0 +1,105 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_pcktgal(byte* bb1, int gfxwidth, int gfxheight, int gfxsrcmodulo, int gfxtotal_elements, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + code %= gfxtotal_elements; + ox = sx; + oy = sy; + ex = sx + gfxwidth - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x100) + { + ex = 0x100 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + gfxheight - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = gfxwidth; + int sh = gfxheight; + int sm = gfxsrcmodulo; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 4 * color; + blockmove_8toN_transpen16_pcktgal(bb1, code, sw, sh, sm, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx); + } + public static void blockmove_8toN_transpen16_pcktgal(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsety, int offsetx) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * srcwidth * srcheight; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x100 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Drawgfx.cs.meta new file mode 100644 index 00000000..6f283cff --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5be279c89d192a34db4c7d0d96bb2ba7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Input.cs new file mode 100644 index 00000000..6612783c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Input.cs @@ -0,0 +1,232 @@ +using MAME.Core; +using System.Collections.Generic; + +namespace MAME.Core +{ + public partial class Dataeast + { + public class fr1 + { + public int fr; + public byte by; + public fr1(int i1, byte b1) + { + fr = i1; + by = b1; + } + } + public static int i3 = 70; + public static List lfr = new List(); + public static void loop_inputports_dataeast_pcktgal() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + byte1 &= unchecked((byte)~0x10); + } + else + { + byte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + byte1 &= unchecked((byte)~0x20); + } + else + { + byte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte1 &= unchecked((byte)~0x01); + } + else + { + byte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte1 &= unchecked((byte)~0x02); + } + else + { + byte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte1 &= unchecked((byte)~0x04); + } + else + { + byte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte1 &= unchecked((byte)~0x08); + } + else + { + byte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte1 &= unchecked((byte)~0x80); + } + else + { + byte1 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte1 &= unchecked((byte)~0x40); + } + else + { + byte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + byte2 &= unchecked((byte)~0x01); + } + else + { + byte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + byte2 &= unchecked((byte)~0x02); + } + else + { + byte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + byte2 &= unchecked((byte)~0x04); + } + else + { + byte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte2 &= unchecked((byte)~0x80); + } + else + { + byte2 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + byte2 &= unchecked((byte)~0x40); + } + else + { + byte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_N))//if (Keyboard.IsPressed(Corekey.N)) + { + lfr = new List(); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0x7f)); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2 + i3), 0x7f)); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2 + i3 + 1), 0xff)); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + lfr = new List(); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xf7)); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + lfr = new List(); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfb)); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); + } + + if (Keyboard.IsPressed(MotionKey.UNKNOW_V))//if (Keyboard.IsPressed(Corekey.V)) + { + lfr = new List(); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfd)); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_B))//if (Keyboard.IsPressed(Corekey.B)) + { + lfr = new List(); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfe)); + lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); + } + foreach (fr1 f in lfr) + { + if (Video.screenstate.frame_number == f.fr) + { + byte1 = f.by; + lfr.Remove(f); + break; + } + } + } + public static void record_port_pcktgal() + { + if (byte1 != byte1_old || byte2 != byte2_old) + { + byte1_old = byte1; + byte2_old = byte2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(byte1); + Mame.bwRecord.Write(byte2); + } + } + public static void replay_port_pcktgal() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + byte1_old = Mame.brRecord.ReadByte(); + byte2_old = Mame.brRecord.ReadByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + byte1 = byte1_old; + byte2 = byte2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Input.cs.meta new file mode 100644 index 00000000..7d7933d0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82160dfc2f3e3b54e86010fc33d9a290 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Memory.cs new file mode 100644 index 00000000..82386d89 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Memory.cs @@ -0,0 +1,238 @@ +namespace MAME.Core +{ + public unsafe partial class Dataeast + { + public static byte byte1, byte2; + public static byte byte1_old, byte2_old; + public static byte D0ReadOp(ushort address) + { + byte result = 0; + if (address <= 0x7ff) + { + result = Memory.mainram[address]; + } + else if (address >= 0x4000 && address <= 0x5fff) + { + int offset = address - 0x4000; + result = Memory.mainrom[basebankmain1 + offset]; + } + else if (address >= 0x6000 && address <= 0x7fff) + { + int offset = address - 0x6000; + result = Memory.mainrom[basebankmain2 + offset]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte D0ReadOpArg(ushort address) + { + byte result = 0; + if (address <= 0x7ff) + { + result = Memory.mainram[address]; + } + else if (address >= 0x4000 && address <= 0x5fff) + { + int offset = address - 0x4000; + result = Memory.mainrom[basebankmain1 + offset]; + } + else if (address >= 0x6000 && address <= 0x7fff) + { + int offset = address - 0x6000; + result = Memory.mainrom[basebankmain2 + offset]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte D0ReadMemory(ushort address) + { + byte result = 0; + if (address <= 0x7ff) + { + result = Memory.mainram[address]; + } + else if (address == 0x1800) + { + result = byte1; + } + else if (address == 0x1a00) + { + result = byte2; + } + else if (address == 0x1c00) + { + result = dsw; + } + else if (address >= 0x4000 && address <= 0x5fff) + { + int offset = address - 0x4000; + result = Memory.mainrom[basebankmain1 + offset]; + } + else if (address >= 0x6000 && address <= 0x7fff) + { + int offset = address - 0x6000; + result = Memory.mainrom[basebankmain2 + offset]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static void D0WriteMemory(ushort address, byte data) + { + if (address <= 0x7ff) + { + Memory.mainram[address] = data; + } + else if (address >= 0x800 && address <= 0xfff) + { + int offset = address - 0x800; + pcktgal_videoram_w(offset, data); + } + else if (address >= 0x1000 && address <= 0x11ff) + { + int offset = address - 0x1000; + Generic.spriteram[offset] = data; + } + else if (address == 0x1801) + { + pcktgal_flipscreen_w(data); + } + else if (address == 0x1a00) + { + pcktgal_sound_w(data); + } + else if (address == 0x1c00) + { + pcktgal_bank_w(data); + } + else if (address >= 0x4000 && address <= 0xffff) + { + Memory.mainrom[address] = data; + } + } + public static byte D1ReadOp(ushort address) + { + byte result = 0; + if (address <= 0x7ff) + { + result = Memory.audioram[address]; + } + else if (address >= 0x4000 && address <= 0x7fff) + { + int offset = address - 0x4000; + result = audioromop[basebanksnd + offset]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + int offset = address - 0x8000; + result = audioromop[offset]; + } + return result; + } + public static byte D1ReadOp_2(ushort address) + { + byte result = 0; + if (address <= 0x7ff) + { + result = Memory.audioram[address]; + } + else if (address >= 0x4000 && address <= 0x7fff) + { + int offset = address - 0x4000; + result = Memory.audiorom[basebanksnd + offset]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static byte D1ReadOpArg(ushort address) + { + byte result = 0; + if (address <= 0x7ff) + { + result = Memory.audioram[address]; + } + else if (address >= 0x4000 && address <= 0x7fff) + { + int offset = address - 0x4000; + result = Memory.audiorom[basebanksnd + offset]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static byte D1ReadMemory(ushort address) + { + byte result = 0; + if (address <= 0x7ff) + { + result = Memory.audioram[address]; + } + else if (address == 0x3000) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address == 0x3400) + { + result = pcktgal_adpcm_reset_r(); + } + else if (address >= 0x4000 && address <= 0x7fff) + { + int offset = address - 0x4000; + result = Memory.audiorom[basebanksnd + offset]; + } + else if (address >= 0x8000 && address <= 0xffff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static void D1WriteMemory(ushort address, byte data) + { + if (address <= 0x7ff) + { + Memory.audioram[address] = data; + } + else if (address == 0x0800) + { + YM2203.ym2203_control_port_0_w(data); + } + else if (address == 0x0801) + { + YM2203.ym2203_write_port_0_w(data); + } + else if (address == 0x1000) + { + YM3812.ym3812_control_port_0_w(data); + } + else if (address == 0x1001) + { + YM3812.ym3812_write_port_0_w(data); + } + else if (address == 0x1800) + { + pcktgal_adpcm_data_w(data); + } + else if (address == 0x2000) + { + pcktgal_sound_bank_w(data); + } + else if (address >= 0x4000 && address <= 0xffff) + { + Memory.audiorom[address] = data; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Memory.cs.meta new file mode 100644 index 00000000..ee1e4904 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f1a42dd5bf5e684383f488fe0e69b0e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Pcktgal.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Pcktgal.cs new file mode 100644 index 00000000..f763a538 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Pcktgal.cs @@ -0,0 +1,228 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Dataeast + { + //public static byte[] /*audioromop,*/ /*gfx1rom,*/ gfx2rom, gfx12rom, gfx22rom, prom; + + + #region //指针化 audioromop + static byte[] audioromop_src; + static GCHandle audioromop_handle; + public static byte* audioromop; + public static int audioromopLength; + public static bool audioromop_IsNull => audioromop == null; + public static byte[] audioromop_set + { + set + { + audioromop_handle.ReleaseGCHandle(); + audioromop_src = value; + audioromopLength = value.Length; + audioromop_src.GetObjectPtr(ref audioromop_handle, ref audioromop); + } + } + #endregion + + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + #region //指针化 gfx12rom + static byte[] gfx12rom_src; + static GCHandle gfx12rom_handle; + public static byte* gfx12rom; + public static int gfx12romLength; + public static bool gfx12rom_IsNull => gfx12rom == null; + public static byte[] gfx12rom_set + { + set + { + gfx12rom_handle.ReleaseGCHandle(); + gfx12rom_src = value; + gfx12romLength = value.Length; + gfx12rom_src.GetObjectPtr(ref gfx12rom_handle, ref gfx12rom); + } + } + #endregion + + #region //指针化 gfx22rom + static byte[] gfx22rom_src; + static GCHandle gfx22rom_handle; + public static byte* gfx22rom; + public static int gfx22romLength; + public static bool gfx22rom_IsNull => gfx22rom == null; + public static byte[] gfx22rom_set + { + set + { + gfx22rom_handle.ReleaseGCHandle(); + gfx22rom_src = value; + gfx22romLength = value.Length; + gfx22rom_src.GetObjectPtr(ref gfx22rom_handle, ref gfx22rom); + } + } + #endregion + + #region //指针化 prom + static byte[] prom_src; + static GCHandle prom_handle; + public static byte* prom; + public static int promLength; + public static bool prom_IsNull => prom == null; + public static byte[] prom_set + { + set + { + prom_handle.ReleaseGCHandle(); + prom_src = value; + promLength = value.Length; + prom_src.GetObjectPtr(ref prom_handle, ref prom); + } + } + #endregion + + public static byte dsw; + public static int basebankmain1, basebankmain2, basebanksnd, msm5205next, toggle; + public static void DataeastInit() + { + int i, n; + Machine.bRom = true; + Memory.Set_mainram(new byte[0x800]); + Memory.Set_audioram(new byte[0x800]); + Generic.spriteram_set = new byte[0x200]; + Generic.videoram_set = new byte[0x800]; + switch (Machine.sName) + { + case "pcktgal": + case "pcktgalb": + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + audioromop_set = Machine.GetRom("audiocpuop.rom"); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + gfx2rom_set = Machine.GetRom("gfx2.rom"); + prom_set = Machine.GetRom("proms.rom"); + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || audioromop == null || gfx1rom == null || gfx2rom == null || prom == null) + { + Machine.bRom = false; + } + break; + case "pcktgal2": + case "pcktgal2j": + case "spool3": + case "spool3i": + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + gfx2rom_set = Machine.GetRom("gfx2.rom"); + prom_set = Machine.GetRom("proms.rom"); + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || gfx1rom == null || gfx2rom == null || prom == null) + { + Machine.bRom = false; + } + break; + } + if (Machine.bRom) + { + dsw = 0xbf; + } + } + public static void irqhandler(int irq) + { + + } + public static void pcktgal_bank_w(byte data) + { + if ((data & 1) != 0) + { + basebankmain1 = 0x4000; + } + else + { + basebankmain1 = 0x10000; + } + if ((data & 2) != 0) + { + basebankmain2 = 0x6000; + } + else + { + basebankmain2 = 0x12000; + } + } + public static void pcktgal_sound_bank_w(byte data) + { + basebanksnd = 0x10000 + 0x4000 * ((data >> 2) & 1); + } + public static void pcktgal_sound_w(byte data) + { + Sound.soundlatch_w(data); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + public static void pcktgal_adpcm_int(int data) + { + MSM5205.msm5205_data_w(0, msm5205next >> 4); + msm5205next <<= 4; + toggle = 1 - toggle; + if (toggle != 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + } + public static void pcktgal_adpcm_data_w(byte data) + { + msm5205next = data; + } + public static byte pcktgal_adpcm_reset_r() + { + MSM5205.msm5205_reset_w(0, 0); + return 0; + } + public static void machine_reset_dataeast() + { + basebankmain1 = 0; + basebankmain2 = 0; + basebanksnd = 0; + msm5205next = 0; + toggle = 0; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Pcktgal.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Pcktgal.cs.meta new file mode 100644 index 00000000..7c49c2d8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Pcktgal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a3a2c4ef1d2ae5428efc884d0d57ea9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/State.cs new file mode 100644 index 00000000..fca5115c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/State.cs @@ -0,0 +1,95 @@ +using cpu.m6502; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Dataeast + { + public static void SaveStateBinary_pcktgal(BinaryWriter writer) + { + int i; + writer.Write(dsw); + writer.Write(basebankmain1); + writer.Write(basebankmain2); + writer.Write(basebanksnd); + writer.Write(msm5205next); + writer.Write(toggle); + for (i = 0; i < 0x200; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x800); + writer.Write(Generic.videoram, 0, 0x800); + writer.Write(Generic.spriteram, 0, 0x200); + writer.Write(Memory.audioram, 0, 0x800); + M6502.mm1[0].SaveStateBinary(writer); + M6502.mm1[1].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + YM2203.FF2203[0].SaveStateBinary(writer); + YM3812.SaveStateBinary(writer); + MSM5205.mm1[0].SaveStateBinary(writer); + writer.Write(Sound.latched_value[0]); + writer.Write(Sound.utempdata[0]); + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_base_sampindex); + writer.Write(Sound.ym3812stream.output_sampindex); + writer.Write(Sound.ym3812stream.output_base_sampindex); + writer.Write(MSM5205.mm1[0].voice.stream.output_sampindex); + writer.Write(MSM5205.mm1[0].voice.stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_pcktgal(BinaryReader reader) + { + int i; + dsw = reader.ReadByte(); + basebankmain1 = reader.ReadInt32(); + basebankmain2 = reader.ReadInt32(); + basebanksnd = reader.ReadInt32(); + msm5205next = reader.ReadInt32(); + toggle = reader.ReadInt32(); + for (i = 0; i < 0x200; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x800)); + Generic.videoram_set = reader.ReadBytes(0x800); + Generic.spriteram_set = reader.ReadBytes(0x200); + Memory.Set_audioram(reader.ReadBytes(0x800)); + M6502.mm1[0].LoadStateBinary(reader); + M6502.mm1[1].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + YM2203.FF2203[0].LoadStateBinary(reader); + YM3812.LoadStateBinary(reader); + MSM5205.mm1[0].LoadStateBinary(reader); + Sound.latched_value[0] = reader.ReadUInt16(); + Sound.utempdata[0] = reader.ReadUInt16(); + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_base_sampindex = reader.ReadInt32(); + Sound.ym3812stream.output_sampindex = reader.ReadInt32(); + Sound.ym3812stream.output_base_sampindex = reader.ReadInt32(); + MSM5205.mm1[0].voice.stream.output_sampindex = reader.ReadInt32(); + MSM5205.mm1[0].voice.stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/State.cs.meta new file mode 100644 index 00000000..a63155c5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2bf3fa41744c9641859cf26adb4645e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Tilemap.cs new file mode 100644 index 00000000..27325ab6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Tilemap.cs @@ -0,0 +1,196 @@ +using System; + +namespace MAME.Core +{ + public partial class Dataeast + { + public static Tmap bg_tilemap; + public static void tilemap_init() + { + int i; + bg_tilemap = new Tmap(); + bg_tilemap.cols = 32; + bg_tilemap.rows = 32; + bg_tilemap.tilewidth = 8; + bg_tilemap.tileheight = 8; + bg_tilemap.width = 0x100; + bg_tilemap.height = 0x100; + bg_tilemap.enable = true; + bg_tilemap.all_tiles_dirty = true; + bg_tilemap.total_elements = gfx1romLength / 0x40; + bg_tilemap.pixmap = new ushort[0x100 * 0x100]; + bg_tilemap.flagsmap = new byte[0x100, 0x100]; + bg_tilemap.tileflags = new byte[32, 32]; + bg_tilemap.pen_data_set = new byte[0x100]; + bg_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 16; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x10; + } + bg_tilemap.scrollrows = 1; + bg_tilemap.scrollcols = 1; + bg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap.tilemap_draw_instance3 = bg_tilemap.tilemap_draw_instanceDataeast_pcktgal; + bg_tilemap.tile_update3 = bg_tilemap.tile_updatePcktgalbg; + } + } + public unsafe partial class Tmap + { + public void tile_updatePcktgalbg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + code = Generic.videoram[tile_index * 2 + 1] + ((Generic.videoram[tile_index * 2] & 0x0f) << 8); + color = Generic.videoram[tile_index * 2] >> 4; + flags = 0; + pen_data_offset = code * 0x40; + palette_base = 0x100 + 0x10 * color; + group = 0; + tileflags[row, col] = tile_drawPcktgalbg(Dataeast.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public byte tile_drawPcktgalbg(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public void tilemap_draw_instanceDataeast_pcktgal(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + { + continue; + } + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x100 + xpos + x_start, x_end - x_start); + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x100 + i] = pixmap[offsety2 * width + i - xpos]; + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + { + break; + } + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Tilemap.cs.meta new file mode 100644 index 00000000..86e1599d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48b52f88b4ab08246930c845740b1933 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Video.cs new file mode 100644 index 00000000..4b1bda10 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Video.cs @@ -0,0 +1,92 @@ +namespace MAME.Core +{ + public unsafe partial class Dataeast + { + public static void palette_init_pcktgal(byte* color_prom) + { + int i; + for (i = 0; i < 0x200; i++) + { + int bit0, bit1, bit2, bit3, r, g, b; + bit0 = (color_prom[i] >> 0) & 0x01; + bit1 = (color_prom[i] >> 1) & 0x01; + bit2 = (color_prom[i] >> 2) & 0x01; + bit3 = (color_prom[i] >> 3) & 0x01; + r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = (color_prom[i] >> 4) & 0x01; + bit1 = (color_prom[i] >> 5) & 0x01; + bit2 = (color_prom[i] >> 6) & 0x01; + bit3 = (color_prom[i] >> 7) & 0x01; + g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = (color_prom[i + 0x200] >> 0) & 0x01; + bit1 = (color_prom[i + 0x200] >> 1) & 0x01; + bit2 = (color_prom[i + 0x200] >> 2) & 0x01; + bit3 = (color_prom[i + 0x200] >> 3) & 0x01; + b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + Palette.palette_set_callback(i, Palette.make_rgb(r, g, b)); + } + } + public static void pcktgal_videoram_w(int offset, byte data) + { + int row, col; + Generic.videoram[offset] = data; + row = (offset / 2) / 0x20; + col = (offset / 2) % 0x20; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void pcktgal_flipscreen_w(byte data) + { + if (Generic.flip_screen_get() != (data & 0x80)) + { + Generic.flip_screen_set(data & 0x80); + bg_tilemap.all_tiles_dirty = true; + } + } + public static void draw_sprites(RECT cliprect) + { + int offs; + for (offs = 0; offs < 0x200; offs += 4) + { + if (Generic.spriteram[offs] != 0xf8) + { + int sx, sy, flipx, flipy; + sx = 240 - Generic.spriteram[offs + 2]; + sy = 240 - Generic.spriteram[offs]; + flipx = Generic.spriteram[offs + 1] & 0x04; + flipy = Generic.spriteram[offs + 1] & 0x02; + if (Generic.flip_screen_get() != 0) + { + sx = 240 - sx; + sy = 240 - sy; + if (flipx != 0) + { + flipx = 0; + } + else + { + flipx = 1; + } + if (flipy != 0) + { + flipy = 0; + } + else + { + flipy = 1; + } + } + Drawgfx.common_drawgfx_pcktgal(gfx2rom, 16, 16, 16, 0x400, Generic.spriteram[offs + 3] + ((Generic.spriteram[offs + 1] & 1) << 8), (Generic.spriteram[offs + 1] & 0x70) >> 4, flipx, flipy, sx, sy, cliprect); + } + } + } + public static void video_update_pcktgal() + { + bg_tilemap.tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + draw_sprites(Video.screenstate.visarea); + } + public static void video_eof_pcktgal() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Video.cs.meta new file mode 100644 index 00000000..6c6f7a7d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/dataeast/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10628831f408d554884f82f8d043d51e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011.meta new file mode 100644 index 00000000..44aff514 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d3f224a499a2b4c4e96ed81b26de1ed6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/IGS011.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/IGS011.cs new file mode 100644 index 00000000..516c44a6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/IGS011.cs @@ -0,0 +1,1089 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class IGS011 + { + //public static ushort[] priority_ram, paletteram16; + public static byte prot1, prot2, prot1_swap; + public static uint prot1_addr; + //public static ushort[] igs003_reg, vbowl_trackball; + public static ushort priority, igs_dips_sel, igs_input_sel, lhb_irq_enable; + public static byte igs012_prot, igs012_prot_swap; + private static bool igs012_prot_mode; + //public static byte[] /*gfx1rom,*/ /*gfx2rom*/; + public static byte dsw1, dsw2, dsw3, dsw4, dsw5; + + #region //指针化 priority_ram + static ushort[] priority_ram_src; + static GCHandle priority_ram_handle; + public static ushort* priority_ram; + public static int priority_ramLength; + public static bool priority_ram_IsNull => priority_ram == null; + public static ushort[] priority_ram_set + { + set + { + priority_ram_handle.ReleaseGCHandle(); + priority_ram_src = value; + priority_ramLength = value.Length; + priority_ram_src.GetObjectPtr(ref priority_ram_handle, ref priority_ram); + } + } + #endregion + + + #region //指针化 paletteram16 + static ushort[] paletteram16_src; + static GCHandle paletteram16_handle; + public static ushort* paletteram16; + public static int paletteram16Length; + public static bool paletteram16_IsNull => paletteram16 == null; + public static ushort[] paletteram16_set + { + set + { + paletteram16_handle.ReleaseGCHandle(); + paletteram16_src = value; + paletteram16Length = value.Length; + paletteram16_src.GetObjectPtr(ref paletteram16_handle, ref paletteram16); + } + } + #endregion + + #region //指针化 igs003_reg + static ushort[] igs003_reg_src; + static GCHandle igs003_reg_handle; + public static ushort* igs003_reg; + public static int igs003_regLength; + public static bool igs003_reg_IsNull => igs003_reg == null; + public static ushort[] igs003_reg_set + { + set + { + igs003_reg_handle.ReleaseGCHandle(); + igs003_reg_src = value; + igs003_regLength = value.Length; + igs003_reg_src.GetObjectPtr(ref igs003_reg_handle, ref igs003_reg); + } + } + #endregion + + #region //指针化 vbowl_trackball + static ushort[] vbowl_trackball_src; + static GCHandle vbowl_trackball_handle; + public static ushort* vbowl_trackball; + public static int vbowl_trackballLength; + public static bool vbowl_trackball_IsNull => vbowl_trackball == null; + public static ushort[] vbowl_trackball_set + { + set + { + vbowl_trackball_handle.ReleaseGCHandle(); + if (value == null) + return; + vbowl_trackball_src = value; + vbowl_trackballLength = value.Length; + vbowl_trackball_src.GetObjectPtr(ref vbowl_trackball_handle, ref vbowl_trackball); + } + } + #endregion + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + public static void IGS011Init() + { + Machine.bRom = true; + Generic.generic_nvram_set = new byte[0x4000]; + priority_ram_set = new ushort[0x800]; + paletteram16_set = new ushort[0x1000]; + igs003_reg_set = new ushort[2]; + vbowl_trackball_set = new ushort[2]; + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + OKI6295.okirom = Machine.GetRom("oki.rom"); + dsw1 = 0xff; + dsw2 = 0xff; + dsw3 = 0xff; + if (Memory.mainrom_IsNull || gfx1rom == null || OKI6295.okirom == null) + { + Machine.bRom = false; + } + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + OKI6295.okirom = Machine.GetRom("oki.rom"); + dsw1 = 0xf7; + dsw2 = 0xff; + dsw3 = 0xff; + dsw4 = 0xf0; + dsw5 = 0xff; + if (Memory.mainrom_IsNull || gfx1rom == null || OKI6295.okirom == null) + { + Machine.bRom = false; + } + break; + case "lhb2": + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + gfx2rom_set = Machine.GetRom("gfx2.rom"); + + break; + } + } + public static void machine_reset_igs011() + { + + } + private static void igs_dips_w(int offset, byte data) + { + if (offset % 2 == 0) + { + igs_dips_sel = (ushort)((data << 8) | (igs_dips_sel & 0xff)); + } + else if (offset % 2 == 1) + { + igs_dips_sel = (ushort)((igs_dips_sel & 0xff00) | data); + } + } + private static void igs_dips_w(ushort data) + { + igs_dips_sel = data; + } + private static byte igs_dips_r(int num) + { + int i; + byte ret = 0; + byte[] dip = new byte[] { dsw1, dsw2, dsw3, dsw4, dsw5 }; + for (i = 0; i < num; i++) + { + if (((~igs_dips_sel) & (1 << i)) != 0) + { + ret = dip[i]; + } + } + return ret; + } + private static byte igs_3_dips_r() + { + return igs_dips_r(3); + } + private static byte igs_4_dips_r() + { + return igs_dips_r(4); + } + private static byte igs_5_dips_r() + { + return igs_dips_r(5); + } + public static void igs011_prot1_w1(int offset, byte data) + { + switch (offset) + { + case 0: // COPY ACCESSING_BITS_8_15 + if ((data & 0xff) == 0x33) + { + prot1 = prot1_swap; + return; + } + break; + case 2: // INC + if ((data & 0xff) == 0xff) + { + prot1++; + return; + } + break; + case 4: // DEC + if ((data & 0xff) == 0xaa) + { + prot1--; + return; + } + break; + case 6: // SWAP + if ((data & 0xff) == 0x55) + { + byte x = prot1; + prot1_swap = (byte)((BIT(x, 1) << 3) | ((BIT(x, 2) | BIT(x, 3)) << 2) | (BIT(x, 2) << 1) | (BIT(x, 0) & BIT(x, 3))); + return; + } + break; + } + } + public static void igs011_prot1_w(int offset, ushort data) + { + offset *= 2; + switch (offset) + { + case 0: // COPY ACCESSING_BITS_8_15 + if ((data & 0xff00) == 0x3300) + { + prot1 = prot1_swap; + return; + } + break; + case 2: // INC + if ((data & 0xff00) == 0xff00) + { + prot1++; + return; + } + break; + case 4: // DEC + if ((data & 0xff00) == 0xaa00) + { + prot1--; + return; + } + break; + case 6: // SWAP + if ((data & 0xff00) == 0x5500) + { + byte x = prot1; + prot1_swap = (byte)((BIT(x, 1) << 3) | ((BIT(x, 2) | BIT(x, 3)) << 2) | (BIT(x, 2) << 1) | (BIT(x, 0) & BIT(x, 3))); + return; + } + break; + } + } + public static byte igs011_prot1_r() + { + byte x = prot1; + return (byte)((((BIT(x, 1) & BIT(x, 2)) ^ 1) << 5) | ((BIT(x, 0) ^ BIT(x, 3)) << 2)); + } + public static void igs011_prot_addr_w(ushort data) + { + prot1 = 0x00; + prot1_swap = 0x00; + prot1_addr = (uint)((data << 4) ^ 0x8340); + } + public static void igs011_prot2_reset_w() + { + prot2 = 0x00; + } + public static int igs011_prot2_reset_r() + { + prot2 = 0x00; + return 0; + } + public static void igs011_prot2_inc_w() + { + prot2++; + } + public static void igs011_prot2_dec_w() + { + prot2--; + } + public static void chmplst2_interrupt() + { + switch (Cpuexec.iloops) + { + case 0: + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + break; + case 1: + default: + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + break; + } + } + public static void drgnwrld_igs011_prot2_swap_w() + { + byte x = prot2; + prot2 = (byte)(((BIT(x, 3) & BIT(x, 0)) << 4) | (BIT(x, 2) << 3) | ((BIT(x, 0) | BIT(x, 1)) << 2) | ((BIT(x, 2) ^ BIT(x, 4) ^ 1) << 1) | (BIT(x, 1) ^ 1 ^ BIT(x, 3))); + } + public static void lhb_igs011_prot2_swap_w(int offset) + { + offset *= 2; + { + byte x = prot2; + prot2 = (byte)((((BIT(x, 0) ^ 1) | BIT(x, 1)) << 2) | (BIT(x, 2) << 1) | (BIT(x, 0) & BIT(x, 1))); + } + } + public static void wlcc_igs011_prot2_swap_w(int offset) + { + offset *= 2; + { + byte x = prot2; + prot2 = (byte)(((BIT(x, 3) ^ BIT(x, 2)) << 4) | ((BIT(x, 2) ^ BIT(x, 1)) << 3) | ((BIT(x, 1) ^ BIT(x, 0)) << 2) | ((BIT(x, 4) ^ BIT(x, 0) ^ 1) << 1) | (BIT(x, 4) ^ BIT(x, 3) ^ 1)); + } + } + private static void vbowl_igs011_prot2_swap_w(int offset) + { + offset *= 2; + { + byte x = prot2; + prot2 = (byte)(((BIT(x, 3) ^ BIT(x, 2)) << 4) | ((BIT(x, 2) ^ BIT(x, 1)) << 3) | ((BIT(x, 1) ^ BIT(x, 0)) << 2) | ((BIT(x, 4) ^ BIT(x, 0)) << 1) | (BIT(x, 4) ^ BIT(x, 3))); + } + } + private static ushort drgnwrldv21_igs011_prot2_r() + { + byte x = prot2; + byte b9 = (byte)((BIT(x, 4) ^ 1) | ((BIT(x, 0) ^ 1) & BIT(x, 2)) | ((BIT(x, 3) ^ BIT(x, 1) ^ 1) & ((((BIT(x, 4) ^ 1) & BIT(x, 0)) | BIT(x, 2)) ^ 1))); + return (ushort)(b9 << 9); + } + private static ushort drgnwrldv20j_igs011_prot2_r() + { + byte x = prot2; + byte b9 = (byte)(((BIT(x, 4) ^ 1) | (BIT(x, 0) ^ 1)) | ((BIT(x, 3) | BIT(x, 1)) ^ 1) | ((BIT(x, 2) & BIT(x, 0)) ^ 1)); + return (ushort)(b9 << 9); + } + private static ushort lhb_igs011_prot2_r() + { + byte x = prot2; + byte b9 = (byte)((BIT(x, 2) ^ 1) | (BIT(x, 1) & BIT(x, 0))); + return (ushort)(b9 << 9); + } + private static ushort dbc_igs011_prot2_r() + { + byte x = prot2; + byte b9 = (byte)((BIT(x, 1) ^ 1) | ((BIT(x, 0) ^ 1) & BIT(x, 2))); + return (ushort)(b9 << 9); + } + private static ushort ryukobou_igs011_prot2_r() + { + byte x = prot2; + byte b9 = (byte)(((BIT(x, 1) ^ 1) | BIT(x, 2)) & BIT(x, 0)); + return (ushort)(b9 << 9); + } + private static ushort lhb2_igs011_prot2_r() + { + byte x = prot2; + byte b3 = (byte)((BIT(x, 2) ^ 1) | (BIT(x, 1) ^ 1) | BIT(x, 0)); + return (ushort)(b3 << 3); + } + private static ushort vbowl_igs011_prot2_r() + { + byte x = prot2; + byte b9 = (byte)(((BIT(x, 4) ^ 1) & (BIT(x, 3) ^ 1)) | ((BIT(x, 2) & BIT(x, 1)) ^ 1) | ((BIT(x, 4) | BIT(x, 0)) ^ 1)); + return (ushort)(b9 << 9); + } + private static void igs012_prot_reset_w() + { + igs012_prot = 0x00; + igs012_prot_swap = 0x00; + igs012_prot_mode = false; + } + private static bool MODE_AND_DATA(bool _MODE, byte _DATA, byte data) + { + bool b1; + b1 = ((igs012_prot_mode == _MODE) && (data == _DATA)); + return b1; + } + private static bool MODE_AND_DATA(bool _MODE, byte _DATA, ushort data) + { + bool b1; + b1 = (igs012_prot_mode == _MODE) && (((data & 0xff00) == (_DATA << 8)) || ((data & 0xff) == _DATA)); + return b1; + } + private static void igs012_prot_mode_w(ushort data) + { + if (MODE_AND_DATA(false, 0xcc, data) || MODE_AND_DATA(true, 0xdd, data)) + { + igs012_prot_mode = igs012_prot_mode ^ true; + } + } + private static void igs012_prot_inc_w(ushort data) + { + if (MODE_AND_DATA(false, 0xff, data)) + { + igs012_prot = (byte)((igs012_prot + 1) & 0x1f); + } + } + private static void igs012_prot_dec_inc_w(byte data) + { + if (MODE_AND_DATA(false, 0xaa, data)) + { + igs012_prot = (byte)((igs012_prot - 1) & 0x1f); + } + else if (MODE_AND_DATA(true, 0xfa, data)) + { + igs012_prot = (byte)((igs012_prot + 1) & 0x1f); + } + } + private static void igs012_prot_dec_inc_w(ushort data) + { + if (MODE_AND_DATA(false, 0xaa, data)) + { + igs012_prot = (byte)((igs012_prot - 1) & 0x1f); + } + else if (MODE_AND_DATA(true, 0xfa, data)) + { + igs012_prot = (byte)((igs012_prot + 1) & 0x1f); + } + } + private static void igs012_prot_dec_copy_w(ushort data) + { + if (MODE_AND_DATA(false, 0x33, data)) + { + igs012_prot = igs012_prot_swap; + } + else if (MODE_AND_DATA(true, 0x5a, data)) + { + igs012_prot = (byte)((igs012_prot - 1) & 0x1f); + } + } + private static void igs012_prot_copy_w(ushort data) + { + if (MODE_AND_DATA(true, 0x22, data)) + { + igs012_prot = igs012_prot_swap; + } + } + private static void igs012_prot_swap_w(ushort data) + { + if (MODE_AND_DATA(false, 0x55, data) || MODE_AND_DATA(true, 0xa5, data)) + { + byte x = igs012_prot; + igs012_prot_swap = (byte)((((BIT(x, 3) | BIT(x, 1)) ^ 1) << 3) | ((BIT(x, 2) & BIT(x, 1)) << 2) | ((BIT(x, 3) ^ BIT(x, 0)) << 1) | (BIT(x, 2) ^ 1)); + } + } + private static byte igs012_prot_r() + { + byte x = igs012_prot; + byte b1 = (byte)((BIT(x, 3) | BIT(x, 1)) ^ 1); + byte b0 = (byte)(BIT(x, 3) ^ BIT(x, 0)); + return (byte)((b1 << 1) | (b0 << 0)); + } + public static void drgnwrld_igs003_w(int offset, byte data) + { + if ((offset & 1) == 0) + { + igs003_reg[offset / 2] = (ushort)((data << 8) | (igs003_reg[offset / 2] & 0xff)); + } + else if ((offset & 1) == 1) + { + igs003_reg[offset / 2] = (ushort)((igs003_reg[offset / 2] & 0xff00) | data); + } + if ((offset / 2) == 0) + { + return; + } + switch (igs003_reg[0]) + { + case 0x00: + if ((offset & 1) == 1) + { + Generic.coin_counter_w(0, data & 2); + } + break; + } + } + public static void drgnwrld_igs003_w(int offset, ushort data) + { + igs003_reg[offset] = data; + if (offset == 0) + { + return; + } + switch (igs003_reg[0]) + { + case 0x00: + Generic.coin_counter_w(0, data & 2); + break; + default: + break; + } + } + public static byte drgnwrld_igs003_r() + { + switch (igs003_reg[0]) + { + case 0x00: + /*if (Video.screenstate.frame_number >= 70 && Video.screenstate.frame_number <= 71) + { + return 0xfe; + } + else if (Video.screenstate.frame_number >= 80 && Video.screenstate.frame_number <= 81) + { + return 0xfb; + } + else*/ + { + return (byte)sbyte0; + } + case 0x01: return (byte)sbyte1; + case 0x02: + /*if (Video.screenstate.frame_number >= 90 && Video.screenstate.frame_number <= 91) + { + return 0xfb; + } + else*/ + { + return (byte)sbyte2; + } + case 0x20: return 0x49; + case 0x21: return 0x47; + case 0x22: return 0x53; + case 0x24: return 0x41; + case 0x25: return 0x41; + case 0x26: return 0x7f; + case 0x27: return 0x41; + case 0x28: return 0x41; + case 0x2a: return 0x3e; + case 0x2b: return 0x41; + case 0x2c: return 0x49; + case 0x2d: return 0xf9; + case 0x2e: return 0x0a; + case 0x30: return 0x26; + case 0x31: return 0x49; + case 0x32: return 0x49; + case 0x33: return 0x49; + case 0x34: return 0x32; + + default: + break; + } + return 0; + } + private static void lhb_inputs_w(int offset, byte data) + { + if (offset == 0) + { + igs_input_sel = (ushort)((data << 8) | (igs_input_sel & 0xff)); + } + else if (offset == 1) + { + igs_input_sel = (ushort)((igs_input_sel & 0xff00) | data); + Generic.coin_counter_w(0, data & 0x20); + } + } + private static void lhb_inputs_w(ushort data) + { + igs_input_sel = data; + Generic.coin_counter_w(0, data & 0x20); + } + private static ushort lhb_inputs_r(int offset) + { + switch (offset) + { + case 0: + return igs_input_sel; + case 1: + if ((~igs_input_sel & 0x01) != 0) + { + return bkey0; + } + if ((~igs_input_sel & 0x02) != 0) + { + return bkey1; + } + if ((~igs_input_sel & 0x04) != 0) + { + return bkey2; + } + if ((~igs_input_sel & 0x08) != 0) + { + return bkey3; + } + if ((~igs_input_sel & 0x10) != 0) + { + return bkey4; + } + break; + } + return 0; + } + private static void lhb2_igs003_w1(int offset, byte data) + { + igs003_reg[offset] = (ushort)((data << 8) | (igs003_reg[offset] & 0xff)); + if (offset == 0) + { + return; + } + switch (igs003_reg[0]) + { + case 0x00: + igs_input_sel = (ushort)((data << 8) | (igs_input_sel & 0xff)); + break; + } + } + private static void lhb2_igs003_w2(int offset, byte data) + { + igs003_reg[offset] = (ushort)((igs003_reg[offset] & 0xff00) | data); + if (offset == 0) + { + return; + } + switch (igs003_reg[0]) + { + case 0x00: + igs_input_sel = (ushort)((igs_input_sel & 0xff00) | data); + //if (ACCESSING_BITS_0_7) + { + Generic.coin_counter_w(0, data & 0x20); + } + break; + case 0x02: + //if (ACCESSING_BITS_0_7) + { + lhb2_pen_hi = (byte)(data & 0x07); + OKI6295.okim6295_set_bank_base((data & 0x08) != 0 ? 0x40000 : 0); + } + break; + } + } + private static void lhb2_igs003_w(int offset, ushort data) + { + igs003_reg[offset] = data; + if (offset == 0) + { + return; + } + switch (igs003_reg[0]) + { + case 0x00: + igs_input_sel = data; + //if (ACCESSING_BITS_0_7) + { + Generic.coin_counter_w(0, data & 0x20); + } + break; + case 0x02: + //if (ACCESSING_BITS_0_7) + { + lhb2_pen_hi = (byte)(data & 0x07); + OKI6295.okim6295_set_bank_base((data & 0x08) != 0 ? 0x40000 : 0); + } + break; + } + } + private static ushort lhb2_igs003_r() + { + switch (igs003_reg[0]) + { + case 0x01: + if ((~igs_input_sel & 0x01) != 0) + { + //return input_port_read(machine, "KEY0"); + } + if ((~igs_input_sel & 0x02) != 0) + { + //return input_port_read(machine, "KEY1"); + } + if ((~igs_input_sel & 0x04) != 0) + { + //return input_port_read(machine, "KEY2"); + } + if ((~igs_input_sel & 0x08) != 0) + { + //return input_port_read(machine, "KEY3"); + } + if ((~igs_input_sel & 0x10) != 0) + { + //return input_port_read(machine, "KEY4"); + } + break; + case 0x03: return 0xff; + + case 0x20: return 0x49; + case 0x21: return 0x47; + case 0x22: return 0x53; + + case 0x24: return 0x41; + case 0x25: return 0x41; + case 0x26: return 0x7f; + case 0x27: return 0x41; + case 0x28: return 0x41; + + case 0x2a: return 0x3e; + case 0x2b: return 0x41; + case 0x2c: return 0x49; + case 0x2d: return 0xf9; + case 0x2e: return 0x0a; + + case 0x30: return 0x26; + case 0x31: return 0x49; + case 0x32: return 0x49; + case 0x33: return 0x49; + case 0x34: return 0x32; + } + return 0; + } + private static void wlcc_igs003_w1(int offset, byte data) + { + igs003_reg[offset] = (ushort)((data << 8) | (igs003_reg[offset] & 0xff)); + if (offset == 0) + { + return; + } + } + private static void wlcc_igs003_w2(int offset, byte data) + { + igs003_reg[offset] = (ushort)((igs003_reg[offset] & 0xff00) | data); + if (offset == 0) + { + return; + } + switch (igs003_reg[0]) + { + case 0x02: + //if (ACCESSING_BITS_0_7) + { + Generic.coin_counter_w(0, data & 0x01); + OKI6295.okim6295_set_bank_base((data & 0x10) != 0 ? 0x40000 : 0); + } + break; + } + } + private static void wlcc_igs003_w(int offset, ushort data) + { + igs003_reg[offset] = data; + if (offset == 0) + { + return; + } + switch (igs003_reg[0]) + { + case 0x02: + //if (ACCESSING_BITS_0_7) + { + Generic.coin_counter_w(0, data & 0x01); + OKI6295.okim6295_set_bank_base((data & 0x10) != 0 ? 0x40000 : 0); + } + break; + } + } + private static byte wlcc_igs003_r() + { + switch (igs003_reg[0]) + { + case 0x00: return (byte)sbyte0; + + case 0x20: return 0x49; + case 0x21: return 0x47; + case 0x22: return 0x53; + + case 0x24: return 0x41; + case 0x25: return 0x41; + case 0x26: return 0x7f; + case 0x27: return 0x41; + case 0x28: return 0x41; + + case 0x2a: return 0x3e; + case 0x2b: return 0x41; + case 0x2c: return 0x49; + case 0x2d: return 0xf9; + case 0x2e: return 0x0a; + + case 0x30: return 0x26; + case 0x31: return 0x49; + case 0x32: return 0x49; + case 0x33: return 0x49; + case 0x34: return 0x32; + } + return 0; + } + private static void xymg_igs003_w(int offset, ushort data) + { + igs003_reg[offset] = data; + if (offset == 0) + return; + switch (igs003_reg[0]) + { + case 0x01: + igs_input_sel = data; + //if (ACCESSING_BITS_0_7) + { + Generic.coin_counter_w(0, data & 0x20); + } + break; + } + } + private static byte xymg_igs003_r() + { + switch (igs003_reg[0]) + { + case 0x00: + return (byte)sbytec; + case 0x02: + if ((~igs_input_sel & 0x01) != 0) + { + //return input_port_read(machine, "KEY0"); + } + if ((~igs_input_sel & 0x02) != 0) + { + //return input_port_read(machine, "KEY1"); + } + if ((~igs_input_sel & 0x04) != 0) + { + //return input_port_read(machine, "KEY2"); + } + if ((~igs_input_sel & 0x08) != 0) + { + //return input_port_read(machine, "KEY3"); + } + if ((~igs_input_sel & 0x10) != 0) + { + //return input_port_read(machine, "KEY4"); + } + break; + case 0x20: return 0x49; + case 0x21: return 0x47; + case 0x22: return 0x53; + + case 0x24: return 0x41; + case 0x25: return 0x41; + case 0x26: return 0x7f; + case 0x27: return 0x41; + case 0x28: return 0x41; + + case 0x2a: return 0x3e; + case 0x2b: return 0x41; + case 0x2c: return 0x49; + case 0x2d: return 0xf9; + case 0x2e: return 0x0a; + + case 0x30: return 0x26; + case 0x31: return 0x49; + case 0x32: return 0x49; + case 0x33: return 0x49; + case 0x34: return 0x32; + } + return 0; + } + private static void vbowl_igs003_w(int offset, ushort data) + { + igs003_reg[offset] = data; + if (offset == 0) + return; + switch (igs003_reg[0]) + { + case 0x02: + //if (ACCESSING_BITS_0_7) + { + Generic.coin_counter_w(0, data & 1); + Generic.coin_counter_w(1, data & 2); + } + break; + } + } + private static byte vbowl_igs003_r() + { + switch (igs003_reg[0]) + { + case 0x00: + return (byte)sbyte0; + case 0x01: + return (byte)sbyte1; + case 0x20: return 0x49; + case 0x21: return 0x47; + case 0x22: return 0x53; + + case 0x24: return 0x41; + case 0x25: return 0x41; + case 0x26: return 0x7f; + case 0x27: return 0x41; + case 0x28: return 0x41; + + case 0x2a: return 0x3e; + case 0x2b: return 0x41; + case 0x2c: return 0x49; + case 0x2d: return 0xf9; + case 0x2e: return 0x0a; + + case 0x30: return 0x26; + case 0x31: return 0x49; + case 0x32: return 0x49; + case 0x33: return 0x49; + case 0x34: return 0x32; + } + return 0; + } + private static void igs_YM3812_control_port_0_w(byte data) + { + //if (ACCESSING_BITS_0_7) + YM3812.ym3812_control_port_0_w(data); + } + private static void igs_YM3812_write_port_0_w(byte data) + { + //if (ACCESSING_BITS_0_7) + YM3812.ym3812_write_port_0_w(data); + } + private static void lhb_irq_enable_w(int offset, byte data) + { + if ((offset & 1) == 0) + { + lhb_irq_enable = (ushort)((data << 8) | (lhb_irq_enable & 0xff)); + } + else if ((offset & 1) == 1) + { + lhb_irq_enable = (ushort)((lhb_irq_enable & 0xff00) | data); + } + } + private static void lhb_irq_enable_w(ushort data) + { + lhb_irq_enable = data; + } + private static void lhb_okibank_w(byte data) + { + //ACCESSING_BITS_8_15 + OKI6295.okim6295_set_bank_base((data & 0x2) != 0 ? 0x40000 : 0); + } + private static void lhb_okibank_w(ushort data) + { + OKI6295.okim6295_set_bank_base((data & 0x200) != 0 ? 0x40000 : 0); + } + private static byte ics2115_0_word_r1(int offset) + { + switch (offset) + { + case 0: + return 0; + case 1: + return 0; + case 2: + return ICS2115.ics2115_r(3); + } + return 0; + } + private static byte ics2115_0_word_r2(int offset) + { + switch (offset) + { + case 0: + return ICS2115.ics2115_r(0); + case 1: + return ICS2115.ics2115_r(1); + case 2: + return ICS2115.ics2115_r(2); + } + return 0xff; + } + private static ushort ics2115_0_word_r(int offset) + { + switch (offset) + { + case 0: + return ICS2115.ics2115_r(0); + case 1: + return ICS2115.ics2115_r(1); + case 2: + return (ushort)((ICS2115.ics2115_r(3) << 8) | ICS2115.ics2115_r(2)); + } + return 0xff; + } + private static void ics2115_0_word_w1(int offset, byte data) + { + switch (offset) + { + case 1: + break; + case 2: + ICS2115.ics2115_w(3, data); + break; + } + } + private static void ics2115_0_word_w2(int offset, byte data) + { + switch (offset) + { + case 1: + ICS2115.ics2115_w(1, data); + break; + case 2: + ICS2115.ics2115_w(2, data); + break; + } + } + private static void ics2115_0_word_w(int offset, ushort data) + { + switch (offset) + { + case 1: + ICS2115.ics2115_w(1, (byte)data); + break; + case 2: + ICS2115.ics2115_w(2, (byte)data); + ICS2115.ics2115_w(3, (byte)(data >> 8)); + break; + } + } + private static byte vbowl_unk_r1() + { + return 0xff; + } + private static ushort vbowl_unk_r() + { + return 0xffff; + } + public static void video_eof_vbowl() + { + vbowl_trackball[0] = vbowl_trackball[1]; + //vbowl_trackball[1] = (input_port_read(machine, "AN1") << 8) | input_port_read(machine, "AN0"); + } + private static void vbowl_pen_hi_w(byte data) + { + //if (ACCESSING_BITS_0_7) + { + lhb2_pen_hi = (byte)(data & 0x07); + } + } + private static void vbowl_link_0_w() + { + + } + private static void vbowl_link_1_w() + { + + } + private static void vbowl_link_2_w() + { + + } + private static void vbowl_link_3_w() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/IGS011.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/IGS011.cs.meta new file mode 100644 index 00000000..32a60d47 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/IGS011.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f42800d4ee6d2624fbf5fca2432379ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Input.cs new file mode 100644 index 00000000..e0affd81 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Input.cs @@ -0,0 +1,714 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class IGS011 + { + public static void loop_inputports_igs011_drgnwrld() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbytec &= ~0x01; + } + else + { + sbytec |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbytec &= ~0x02; + } + else + { + sbytec |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + //if (Keyboard.IsPressed(Corekey.D))// || Mouse.deltaX > 0) + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))// || Mouse.deltaX > 0) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A))// || Mouse.deltaX < 0) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S))// || Mouse.deltaY > 0) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W))// || Mouse.deltaY < 0) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J))// || Mouse.buttons[0] != 0) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K))// || Mouse.buttons[1] != 0) + { + sbyte0 &= ~0x40; + } + else + { + sbyte0 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + sbyte1 &= unchecked((sbyte)~0x80); + } + else + { + sbyte1 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbytec &= ~0x08; + } + else + { + sbytec |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbytec &= ~0x10; + } + else + { + sbytec |= 0x10; + } + } + public static void loop_inputports_igs011_lhb() + { + /* + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbytec &= ~0x10; + } + else + { + sbytec |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + bkey0 &= unchecked((byte)~0x20); + } + else + { + bkey0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + bkey1 &= unchecked((byte)~0x20); + } + else + { + bkey1 |= 0x20; + } + if (Keyboard.IsPressed(Corekey.D3)) + { + bkey4 &= unchecked((byte)~0x10); + } + else + { + bkey4 |= 0x10; + } + if (Keyboard.IsPressed(Corekey.D4)) + { + bkey4 &= unchecked((byte)~0x20); + } + else + { + bkey4 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + bkey0 &= unchecked((byte)~0x01); + } + else + { + bkey0 |= 0x01; + } + if (Keyboard.IsPressed(Corekey.B)) + { + bkey1 &= unchecked((byte)~0x01); + } + else + { + bkey1 |= 0x01; + } + if (Keyboard.IsPressed(Corekey.C)) + { + bkey2 &= unchecked((byte)~0x01); + } + else + { + bkey2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + bkey3 &= unchecked((byte)~0x01); + } + else + { + bkey3 |= 0x01; + } + if (Keyboard.IsPressed(Corekey.E)) + { + bkey0 &= unchecked((byte)~0x02); + } + else + { + bkey0 |= 0x02; + } + if (Keyboard.IsPressed(Corekey.F)) + { + bkey1 &= unchecked((byte)~0x02); + } + else + { + bkey1 |= 0x02; + } + if (Keyboard.IsPressed(Corekey.G)) + { + bkey2 &= unchecked((byte)~0x02); + } + else + { + bkey2 |= 0x02; + } + if (Keyboard.IsPressed(Corekey.H)) + { + bkey3 &= unchecked((byte)~0x02); + } + else + { + bkey3 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + bkey0 &= unchecked((byte)~0x04); + } + else + { + bkey0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + bkey1 &= unchecked((byte)~0x04); + } + else + { + bkey1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + bkey2 &= unchecked((byte)~0x04); + } + else + { + bkey2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UNKNOW_E))//if (Keyboard.IsPressed(Corekey.L)) + { + bkey3 &= unchecked((byte)~0x04); + } + else + { + bkey3 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_M))//if (Keyboard.IsPressed(Corekey.M)) + { + bkey0 &= unchecked((byte)~0x08); + } + else + { + bkey0 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_N))//if (Keyboard.IsPressed(Corekey.N)) + { + bkey1 &= unchecked((byte)~0x08); + } + else + { + bkey1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UNKNOW_E))//if (Keyboard.IsPressed(Corekey.O)) + { + bkey4 &= unchecked((byte)~0x04); + } + else + { + bkey4 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_Q))//if (Keyboard.IsPressed(Corekey.Q)) + { + bkey0 &= unchecked((byte)~0x10); + } + else + { + bkey0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + bkey1 &= unchecked((byte)~0x10); + } + else + { + bkey1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + bkey2 &= unchecked((byte)~0x08); + } + else + { + bkey2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + bkey4 &= unchecked((byte)~0x02); + } + else + { + bkey4 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + bkey3 &= unchecked((byte)~0x08); + } + else + { + bkey3 |= 0x08; + } + if (Keyboard.IsPressed(Corekey.Y)) + { + bkey4 &= unchecked((byte)~0x01); + } + else + { + bkey4 |= 0x01; + } + if (Keyboard.IsPressed(Corekey.Z)) + { + bkey2 &= unchecked((byte)~0x10); + } + else + { + bkey2 |= 0x10; + } + */ + } + public static void loop_inputports_igs011_lhb2() + { + /* + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbytec &= ~0x10; + } + else + { + sbytec |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + bkey0 &= unchecked((byte)~0x20); + } + else + { + bkey0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + bkey1 &= unchecked((byte)~0x20); + } + else + { + bkey1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + bkey0 &= unchecked((byte)~0x01); + } + else + { + bkey0 |= 0x01; + } + if (Keyboard.IsPressed(Corekey.B)) + { + bkey1 &= unchecked((byte)~0x01); + } + else + { + bkey1 |= 0x01; + } + if (Keyboard.IsPressed(Corekey.C)) + { + bkey2 &= unchecked((byte)~0x01); + } + else + { + bkey2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + bkey3 &= unchecked((byte)~0x01); + } + else + { + bkey3 |= 0x01; + } + if (Keyboard.IsPressed(Corekey.E)) + { + bkey0 &= unchecked((byte)~0x02); + } + else + { + bkey0 |= 0x02; + } + if (Keyboard.IsPressed(Corekey.F)) + { + bkey1 &= unchecked((byte)~0x02); + } + else + { + bkey1 |= 0x02; + } + if (Keyboard.IsPressed(Corekey.G)) + { + bkey2 &= unchecked((byte)~0x02); + } + else + { + bkey2 |= 0x02; + } + if (Keyboard.IsPressed(Corekey.H)) + { + bkey3 &= unchecked((byte)~0x02); + } + else + { + bkey3 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + bkey0 &= unchecked((byte)~0x04); + } + else + { + bkey0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + bkey1 &= unchecked((byte)~0x04); + } + else + { + bkey1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + bkey2 &= unchecked((byte)~0x04); + } + else + { + bkey2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UNKNOW_E))//if (Keyboard.IsPressed(Corekey.L)) + { + bkey3 &= unchecked((byte)~0x04); + } + else + { + bkey3 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_M))//if (Keyboard.IsPressed(Corekey.M)) + { + bkey0 &= unchecked((byte)~0x08); + } + else + { + bkey0 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_N))//if (Keyboard.IsPressed(Corekey.N)) + { + bkey1 &= unchecked((byte)~0x08); + } + else + { + bkey1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_Q))//if (Keyboard.IsPressed(Corekey.Q)) + { + bkey0 &= unchecked((byte)~0x10); + } + else + { + bkey0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + bkey1 &= unchecked((byte)~0x10); + } + else + { + bkey1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + bkey2 &= unchecked((byte)~0x08); + } + else + { + bkey2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + bkey3 &= unchecked((byte)~0x08); + } + else + { + bkey3 |= 0x08; + } + if (Keyboard.IsPressed(Corekey.Z)) + { + bkey2 &= unchecked((byte)~0x10); + } + else + { + bkey2 |= 0x10; + } + */ + } + public static void record_port_drgnwrld() + { + if (sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old || sbytec != sbytec_old) + { + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + sbytec_old = sbytec; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbytec); + } + } + public static void replay_port_drgnwrld() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbytec_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + sbytec = sbytec_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + public static void record_port_lhb() + { + if (sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old || sbytec != sbytec_old) + { + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + sbytec_old = sbytec; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbytec); + } + } + public static void replay_port_lhb() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbytec_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + sbytec = sbytec_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Input.cs.meta new file mode 100644 index 00000000..41521c6d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eda801c67becc51459fc26195b8448ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Machine.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Machine.cs new file mode 100644 index 00000000..38fe7d24 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Machine.cs @@ -0,0 +1,58 @@ +namespace MAME.Core +{ + public partial class IGS011 + { + public static void lhb2_interrupt() + { + if (Cpuexec.iloops == 0) + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + else + { + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + } + } + public static void wlcc_interrupt() + { + if (Cpuexec.iloops == 0) + { + Cpuint.cpunum_set_input_line(0, 3, LineState.HOLD_LINE); + } + else + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + } + public static void lhb_interrupt() + { + if (lhb_irq_enable == 0) + { + return; + } + if (Cpuexec.iloops == 0) + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + else + { + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + } + } + public static void vbowl_interrupt() + { + if (Cpuexec.iloops == 0) + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + else + { + Cpuint.cpunum_set_input_line(0, 3, LineState.HOLD_LINE); + } + } + public static int BIT(int x, int n) + { + return (x >> n) & 1; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Machine.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Machine.cs.meta new file mode 100644 index 00000000..1ba4a3bf --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Machine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd4db071577d67d4f82b9485a9eeadfd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory.cs new file mode 100644 index 00000000..4bd757e8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory.cs @@ -0,0 +1,449 @@ +namespace MAME.Core +{ + public unsafe partial class IGS011 + { + public static byte bkey0, bkey1, bkey2, bkey3, bkey4; + public static byte bkey0_old, bkey1_old, bkey2_old, bkey3_old, bkey4_old; + public static sbyte sbyte0, sbyte1, sbyte2, sbytec; + public static sbyte sbyte0_old, sbyte1_old, sbyte2_old, sbytec_old; + public static sbyte MReadOpByte_drgnwrld(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0 && address <= 0x7ffff) + { + result = (sbyte)Memory.mainrom[address]; + } + return result; + } + public static sbyte MReadByte_drgnwrld(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0 && address <= 0x7ffff) + { + result = (sbyte)Memory.mainrom[address]; + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Generic.generic_nvram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(priority_ram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)priority_ram[offset]; + } + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)paletteram16[offset]; + } + } + else if (address >= 0x500000 && address <= 0x500001) + { + if (address == 0x500001) + { + result = sbytec; + } + } + else if (address >= 0x600000 && address <= 0x600001) + { + //if (address == 0x600001) + { + result = (sbyte)OKI6295.okim6295_status_0_lsb_r(); + } + } + else if (address >= 0x800002 && address <= 0x800003) + { + /*if (address == 0x800002) + { + int i1 = 1; + } + else*/ + if (address == 0x800003) + { + result = (sbyte)drgnwrld_igs003_r(); + } + } + else if (address >= 0xa88000 && address <= 0xa88001) + { + result = (sbyte)igs_3_dips_r(); + } + return result; + } + public static short MReadOpWord_drgnwrld(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0 && address + 1 <= 0x7ffff) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + return result; + } + public static short MReadWord_drgnwrld(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0 && address + 1 <= 0x7ffff) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = (short)paletteram16[offset]; + } + else if (address >= 0x500000 && address + 1 <= 0x500001) + { + /*if (Video.screenstate.frame_number >= 60&&Video.screenstate.frame_number<=61) + { + result = (short)(0xfe); + } + else*/ + { + result = (short)((byte)sbytec); + } + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x800002 && address + 1 <= 0x800003) + { + result = (short)drgnwrld_igs003_r(); + } + else if (address >= 0xa88000 && address + 1 <= 0xa88001) + { + result = (short)igs_3_dips_r(); + } + return result; + } + public static int MReadOpLong_drgnwrld(int address) + { + address &= 0xffffff; + 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]; + } + return result; + } + public static int MReadLong_drgnwrld(int address) + { + address &= 0xffffff; + 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]; + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = Generic.generic_nvram[offset] * 0x1000000 + Generic.generic_nvram[offset + 1] * 0x10000 + Generic.generic_nvram[offset + 2] * 0x100 + Generic.generic_nvram[offset + 3]; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = priority_ram[offset] * 0x10000 + priority_ram[offset + 1]; + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = paletteram16[offset] * 0x10000 + paletteram16[offset + 1]; + } + else + { + int i1 = 1; + } + return result; + } + public static void MWriteByte_drgnwrld(int address, sbyte value) + { + address &= 0xffffff; + if (address >= prot1_addr && address <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w1(offset, (byte)value); + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if ((address & 1) == 0) + { + priority_ram[offset] = (ushort)((value << 8) | (priority_ram[offset] & 0xff)); + } + else if ((address & 1) == 1) + { + priority_ram[offset] = (ushort)((priority_ram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = address - 0x400000; + igs011_palette(offset, (byte)value); + } + else if (address >= 0x600000 && address <= 0x600001) + { + if (address == 0x600001) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + } + else if (address >= 0x700000 && address <= 0x700001) + { + if (address == 0x700001) + { + igs_YM3812_control_port_0_w((byte)value); + } + } + else if (address >= 0x700002 && address <= 0x700003) + { + if (address == 0x700003) + { + igs_YM3812_write_port_0_w((byte)value); + } + } + else if (address >= 0x800000 && address <= 0x800003) + { + int offset = address - 0x800000; + drgnwrld_igs003_w(offset, (byte)value); + } + else if (address >= 0xa20000 && address <= 0xa20001) + { + int offset = address - 0xa20000; + igs011_priority_w(offset, (byte)value); + } + else if (address >= 0xa40000 && address <= 0xa40001) + { + //igs_dips_w((ushort)value); + } + else if (address >= 0xa50000 && address <= 0xa50001) + { + int i1 = 1; + } + else if (address >= 0xa58000 && address <= 0xa58001) + { + int offset = address - 0xa58000; + igs011_blit_x_w(offset, (byte)value); + } + else if (address >= 0xa58800 && address <= 0xa58801) + { + int offset = address - 0xa58800; + igs011_blit_y_w(offset, (byte)value); + } + else if (address >= 0xa59000 && address <= 0xa59001) + { + int offset = address - 0xa59000; + igs011_blit_w_w(offset, (byte)value); + } + else if (address >= 0xa59800 && address <= 0xa59801) + { + int offset = address - 0xa59800; + igs011_blit_h_w(offset, (byte)value); + } + else if (address >= 0xa5a000 && address <= 0xa5a001) + { + int offset = address - 0xa5a000; + igs011_blit_gfx_lo_w(offset, (byte)value); + } + else if (address >= 0xa5a800 && address <= 0xa5a801) + { + int offset = address - 0xa5a800; + igs011_blit_gfx_hi_w(offset, (byte)value); + } + else if (address >= 0xa5b000 && address <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address <= 0xa5b801) + { + int offset = address - 0xa5b800; + igs011_blit_pen_w(offset, (byte)value); + } + else if (address >= 0xa5c000 && address <= 0xa5c001) + { + int offset = address - 0xa5c000; + igs011_blit_depth_w(offset, (byte)value); + } + } + public static void MWriteWord_drgnwrld(int address, short value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 1 <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w(offset, (ushort)value); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 8); + Generic.generic_nvram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)value; + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + else if (address >= 0x700000 && address + 1 <= 0x700001) + { + igs_YM3812_control_port_0_w((byte)value); + } + else if (address >= 0x700002 && address + 1 <= 0x700003) + { + igs_YM3812_write_port_0_w((byte)value); + } + else if (address >= 0x800000 && address + 1 <= 0x800003) + { + int offset = (address - 0x800000) / 2; + drgnwrld_igs003_w(offset, (ushort)value); + } + else if (address >= 0xa20000 && address + 1 <= 0xa20001) + { + igs011_priority_w((ushort)value); + } + else if (address >= 0xa40000 && address + 1 <= 0xa40001) + { + igs_dips_w((ushort)value); + } + else if (address >= 0xa50000 && address + 1 <= 0xa50001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0xa58000 && address + 1 <= 0xa58001) + { + igs011_blit_x_w((ushort)value); + } + else if (address >= 0xa58800 && address + 1 <= 0xa58801) + { + igs011_blit_y_w((ushort)value); + } + else if (address >= 0xa59000 && address + 1 <= 0xa59001) + { + igs011_blit_w_w((ushort)value); + } + else if (address >= 0xa59800 && address + 1 <= 0xa59801) + { + igs011_blit_h_w((ushort)value); + } + else if (address >= 0xa5a000 && address + 1 <= 0xa5a001) + { + igs011_blit_gfx_lo_w((ushort)value); + } + else if (address >= 0xa5a800 && address + 1 <= 0xa5a801) + { + igs011_blit_gfx_hi_w((ushort)value); + } + else if (address >= 0xa5b000 && address + 1 <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address + 1 <= 0xa5b801) + { + igs011_blit_pen_w((ushort)value); + } + else if (address >= 0xa5c000 && address + 1 <= 0xa5c001) + { + igs011_blit_depth_w((ushort)value); + } + } + public static void MWriteLong_drgnwrld(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 24); + Generic.generic_nvram[offset + 1] = (byte)(value >> 16); + Generic.generic_nvram[offset + 2] = (byte)(value >> 8); + Generic.generic_nvram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)(value >> 16); + priority_ram[offset + 1] = (ushort)value; + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)(value >> 16)); + igs011_palette(offset + 1, (ushort)value); + } + else if (address >= 0x800000 && address + 3 <= 0x800003) + { + drgnwrld_igs003_w(0, (ushort)(value >> 16)); + drgnwrld_igs003_w(1, (ushort)value); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory.cs.meta new file mode 100644 index 00000000..ada0b36e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 63e47a86a56d5234e9752a28dcef2a05 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory2.cs new file mode 100644 index 00000000..21fa181f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory2.cs @@ -0,0 +1,3790 @@ +namespace MAME.Core +{ + public unsafe partial class IGS011 + { + public static sbyte MReadByte_drgnwrld_igs012(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0 && address <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001610 && address2 <= 0x00161f) + { + if (address2 % 2 == 1) + { + result = (sbyte)igs012_prot_r(); + } + } + else if (address2 >= 0x001660 && address2 <= 0x00166f) + { + if (address2 % 2 == 1) + { + result = (sbyte)igs012_prot_r(); + } + } + else if (address >= 0x00d4c0 && address <= 0x00d4ff) + { + if (address2 % 2 == 0) + { + result = (sbyte)(drgnwrldv20j_igs011_prot2_r() >> 8); + } + } + else + { + result = MReadByte_drgnwrld(address); + } + } + else + { + result = MReadByte_drgnwrld(address); + } + return result; + } + public static short MReadWord_drgnwrld_igs012(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0 && address + 1 <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001610 && address2 + 1 <= 0x00161f) + { + result = (short)igs012_prot_r(); + } + else if (address2 >= 0x001660 && address2 + 1 <= 0x00166f) + { + result = (short)igs012_prot_r(); + } + else if (address >= 0x00d4c0 && address + 1 <= 0x00d4ff) + { + result = (short)drgnwrldv20j_igs011_prot2_r(); + } + else + { + result = MReadWord_drgnwrld(address); + } + } + else + { + result = MReadWord_drgnwrld(address); + } + return result; + } + public static int MReadLong_drgnwrld_igs012(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0 && address + 3 <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001610 && address2 + 3 <= 0x00161f) + { + int i1 = 1; + } + else if (address2 >= 0x001660 && address2 + 3 <= 0x00166f) + { + int i1 = 1; + } + else if (address >= 0x00d4c0 && address + 3 <= 0x00d4ff) + { + int i1 = 1; + } + else + { + result = MReadLong_drgnwrld(address); + } + } + else + { + result = MReadLong_drgnwrld(address); + } + return result; + } + public static void MWriteByte_drgnwrld_igs012(int address, sbyte value) + { + address &= 0xffffff; + if (address >= prot1_addr && address <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w1(offset, (byte)value); + } + else if (address >= 0 && address <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001600 && address2 <= 0x00160f) + { + igs012_prot_swap_w((byte)value); + } + else if (address2 >= 0x001620 && address2 <= 0x00162f) + { + igs012_prot_dec_inc_w((byte)value); + } + else if (address2 >= 0x001630 && address2 <= 0x00163f) + { + igs012_prot_inc_w((byte)value); + } + else if (address2 >= 0x001640 && address2 <= 0x00164f) + { + igs012_prot_copy_w((byte)value); + } + else if (address2 >= 0x001650 && address2 <= 0x00165f) + { + igs012_prot_dec_copy_w((byte)value); + } + else if (address2 >= 0x001670 && address2 <= 0x00167f) + { + igs012_prot_mode_w((byte)value); + } + else if (address >= 0x00d400 && address <= 0x00d43f) + { + igs011_prot2_dec_w(); + } + else if (address >= 0x00d440 && address <= 0x00d47f) + { + drgnwrld_igs011_prot2_swap_w(); + } + else if (address >= 0x00d480 && address <= 0x00d4bf) + { + igs011_prot2_reset_w(); + } + else + { + MWriteByte_drgnwrld(address, value); + } + } + else if (address >= 0x902000 && address <= 0x902fff) + { + igs012_prot_reset_w(); + } + else + { + MWriteByte_drgnwrld(address, value); + } + } + public static void MWriteWord_drgnwrld_igs012(int address, short value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 1 <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w(offset, (ushort)value); + } + else if (address >= 0 && address <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001600 && address2 + 1 <= 0x00160f) + { + igs012_prot_swap_w((ushort)value); + } + else if (address2 >= 0x001620 && address2 + 1 <= 0x00162f) + { + igs012_prot_dec_inc_w((ushort)value); + } + else if (address2 >= 0x001630 && address2 + 1 <= 0x00163f) + { + igs012_prot_inc_w((ushort)value); + } + else if (address2 >= 0x001640 && address2 + 1 <= 0x00164f) + { + igs012_prot_copy_w((ushort)value); + } + else if (address2 >= 0x001650 && address2 + 1 <= 0x00165f) + { + igs012_prot_dec_copy_w((ushort)value); + } + else if (address2 >= 0x001670 && address2 + 1 <= 0x00167f) + { + igs012_prot_mode_w((ushort)value); + } + else if (address >= 0x00d400 && address + 1 <= 0x00d43f) + { + igs011_prot2_dec_w(); + } + else if (address >= 0x00d440 && address + 1 <= 0x00d47f) + { + drgnwrld_igs011_prot2_swap_w(); + } + else if (address >= 0x00d480 && address + 1 <= 0x00d4bf) + { + igs011_prot2_reset_w(); + } + else + { + MWriteWord_drgnwrld(address, value); + } + } + else if (address >= 0x902000 && address + 1 <= 0x902fff) + { + igs012_prot_reset_w(); + } + else + { + MWriteWord_drgnwrld(address, value); + } + } + public static void MWriteLong_drgnwrld_igs012(int address, int value) + { + address &= 0xffffff; + if (address >= 0 && address <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001600 && address2 + 3 <= 0x00160f) + { + int i1 = 1; + } + else if (address2 >= 0x001620 && address2 + 3 <= 0x00162f) + { + int i1 = 1; + } + else if (address2 >= 0x001630 && address2 + 3 <= 0x00163f) + { + int i1 = 1; + } + else if (address2 >= 0x001640 && address2 + 3 <= 0x00164f) + { + int i1 = 1; + } + else if (address2 >= 0x001650 && address2 + 3 <= 0x00165f) + { + int i1 = 1; + } + else if (address2 >= 0x001670 && address2 + 3 <= 0x00167f) + { + int i1 = 1; + } + else if (address >= 0x00d400 && address + 3 <= 0x00d43f) + { + int i1 = 1; + } + else if (address >= 0x00d440 && address + 3 <= 0x00d47f) + { + int i1 = 1; + } + else if (address >= 0x00d480 && address + 3 <= 0x00d4bf) + { + int i1 = 1; + } + else + { + MWriteLong_drgnwrld(address, value); + } + } + else if (address >= 0x902000 && address + 3 <= 0x902fff) + { + int i1 = 1; + } + else + { + MWriteLong_drgnwrld(address, value); + } + } + public static short MReadWord_drgnwrld_igs012_drgnwrldv21(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0 && address + 1 <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001610 && address2 + 1 <= 0x00161f) + { + result = (short)igs012_prot_r(); + } + else if (address2 >= 0x001660 && address2 + 1 <= 0x00166f) + { + result = (short)igs012_prot_r(); + } + else if (address >= 0x00d4c0 && address + 1 <= 0x00d4ff) + { + result = (short)drgnwrldv21_igs011_prot2_r(); + } + else + { + result = MReadWord_drgnwrld(address); + } + } + else + { + result = MReadWord_drgnwrld(address); + } + return result; + } + public static sbyte MReadByte_lhb(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x010600 && address <= 0x0107ff) + { + if (address % 2 == 0) + { + result = (sbyte)(lhb_igs011_prot2_r() >> 8); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + result = (sbyte)Memory.mainrom[address]; + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Generic.generic_nvram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(priority_ram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)priority_ram[offset]; + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = address - 0x300000; + if (address % 2 == 0) + { + result = (sbyte)igs011_layers_r1(offset / 2); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_layers_r2(offset / 2); + } + } + else if (address >= 0x600000 && address <= 0x600001) + { + //if (address == 0x600001) + { + result = (sbyte)OKI6295.okim6295_status_0_lsb_r(); + } + } + else if (address >= 0x700000 && address <= 0x700001) + { + if (address == 0x700001) + { + result = sbytec; + } + } + else if (address >= 0x700002 && address <= 0x700005) + { + int offset = (address - 0x700002) / 2; + if (address % 2 == 0) + { + int i1 = 1; + } + else if (address % 2 == 1) + { + result = (sbyte)lhb_inputs_r(offset); + } + } + else if (address >= 0x888000 && address <= 0x888001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)igs_5_dips_r(); + } + } + return result; + } + public static short MReadOpWord_lhb(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x010600 && address + 1 <= 0x0107ff) + { + result = (short)lhb_igs011_prot2_r(); + } + else if (address >= 0 && address + 1 <= 0x7ffff) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + return result; + } + public static short MReadWord_lhb(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x010600 && address + 1 <= 0x0107ff) + { + result = (short)lhb_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x700000 && address + 1 <= 0x700001) + { + result = (short)((byte)sbytec); + } + else if (address >= 0x700002 && address + 1 <= 0x700005) + { + int offset = (address - 0x700002) / 2; + result = (short)lhb_inputs_r(offset); + } + else if (address >= 0x888000 && address + 1 <= 0x888001) + { + result = (short)((byte)igs_5_dips_r()); + } + return result; + } + public static int MReadLong_lhb(int address) + { + address &= 0xffffff; + 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]; + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = Generic.generic_nvram[offset] * 0x1000000 + Generic.generic_nvram[offset + 1] * 0x10000 + Generic.generic_nvram[offset + 2] * 0x100 + Generic.generic_nvram[offset + 3]; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = priority_ram[offset] * 0x10000 + priority_ram[offset + 1]; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = igs011_layers_r(offset) * 0x10000 + igs011_layers_r(offset + 1); + } + else if (address >= 0x700002 && address + 3 <= 0x700005) + { + int offset = (address - 0x700002) / 2; + result = lhb_inputs_r(offset) * 0x10000 + lhb_inputs_r(offset + 1); + } + return result; + } + public static void MWriteByte_lhb(int address, sbyte value) + { + address &= 0xffffff; + if (address >= prot1_addr && address <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w1(offset, (byte)value); + } + else if (address >= 0x010000 && address <= 0x010001) + { + if (address % 2 == 0) + { + lhb_okibank_w((byte)value); + } + } + else if (address >= 0x010200 && address <= 0x0103ff) + { + igs011_prot2_inc_w(); + } + else if (address >= 0x010400 && address <= 0x0105ff) + { + int offset = (address - 0x010400) / 2; + lhb_igs011_prot2_swap_w(offset); + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + priority_ram[offset] = (ushort)((value << 8) | (priority_ram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + priority_ram[offset] = (ushort)((priority_ram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = address - 0x300000; + igs011_layers_w(offset, (byte)value); + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = address - 0x400000; + igs011_palette(offset, (byte)value); + } + else if (address >= 0x600000 && address <= 0x600001) + { + if (address == 0x600001) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + } + else if (address >= 0x700002 && address <= 0x700003) + { + int offset = address - 0x700002; + lhb_inputs_w(offset, (byte)value); + } + else if (address >= 0x820000 && address <= 0x820001) + { + int offset = address - 0x820000; + igs011_priority_w(offset, (byte)value); + } + else if (address >= 0x838000 && address <= 0x838001) + { + int offset = address - 0x838000; + lhb_irq_enable_w(offset, (byte)value); + } + else if (address >= 0x840000 && address <= 0x840001) + { + int offset = address - 0x840000; + igs_dips_w(offset, (byte)value); + } + else if (address >= 0x850000 && address <= 0x850001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0x858000 && address <= 0x858001) + { + int offset = address - 0x858000; + igs011_blit_x_w(offset, (byte)value); + } + else if (address >= 0x858800 && address <= 0x858801) + { + int offset = address - 0x858800; + igs011_blit_y_w(offset, (byte)value); + } + else if (address >= 0x859000 && address <= 0x859001) + { + int offset = address - 0x859000; + igs011_blit_w_w(offset, (byte)value); + } + else if (address >= 0x859800 && address <= 0x859801) + { + int offset = address - 0x859800; + igs011_blit_h_w(offset, (byte)value); + } + else if (address >= 0x85a000 && address <= 0x85a001) + { + int offset = address - 0x85a000; + igs011_blit_gfx_lo_w(offset, (byte)value); + } + else if (address >= 0x85a800 && address <= 0x85a801) + { + int offset = address - 0x85a800; + igs011_blit_gfx_hi_w(offset, (byte)value); + } + else if (address >= 0x85b000 && address <= 0x85b001) + { + int i1 = 1; + //igs011_blit_flags_w((byte)value); + } + else if (address >= 0x85b800 && address <= 0x85b801) + { + int offset = address - 0x85b800; + igs011_blit_pen_w(offset, (byte)value); + } + else if (address >= 0x85c000 && address <= 0x85c001) + { + int offset = address - 0x85c000; + igs011_blit_depth_w(offset, (byte)value); + } + } + public static void MWriteWord_lhb(int address, short value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 1 <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w(offset, (ushort)value); + } + else if (address >= 0x010000 && address + 1 <= 0x010001) + { + lhb_okibank_w((ushort)value); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 8); + Generic.generic_nvram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)value; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)value); + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + else if (address >= 0x700002 && address + 1 <= 0x700003) + { + lhb_inputs_w((ushort)value); + } + else if (address >= 0x820000 && address + 1 <= 0x820001) + { + igs011_priority_w((ushort)value); + } + else if (address >= 0x838000 && address + 1 <= 0x838001) + { + lhb_irq_enable_w((ushort)value); + } + else if (address >= 0x840000 && address + 1 <= 0x840001) + { + igs_dips_w((ushort)value); + } + else if (address >= 0x850000 && address <= 0x850001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0x858000 && address + 1 <= 0x858001) + { + igs011_blit_x_w((ushort)value); + } + else if (address >= 0x858800 && address + 1 <= 0x858801) + { + igs011_blit_y_w((ushort)value); + } + else if (address >= 0x859000 && address + 1 <= 0x859001) + { + igs011_blit_w_w((ushort)value); + } + else if (address >= 0x859800 && address + 1 <= 0x859801) + { + igs011_blit_h_w((ushort)value); + } + else if (address >= 0x85a000 && address + 1 <= 0x85a001) + { + igs011_blit_gfx_lo_w((ushort)value); + } + else if (address >= 0x85a800 && address + 1 <= 0x85a801) + { + igs011_blit_gfx_hi_w((ushort)value); + } + else if (address >= 0x85b000 && address + 1 <= 0x85b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0x85b800 && address + 1 <= 0x85b801) + { + igs011_blit_pen_w((ushort)value); + } + else if (address >= 0x85c000 && address + 1 <= 0x85c001) + { + igs011_blit_depth_w((ushort)value); + } + } + public static void MWriteLong_lhb(int address, int value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 3 <= prot1_addr + 7) + { + int i1 = 1; + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 24); + Generic.generic_nvram[offset + 1] = (byte)(value >> 16); + Generic.generic_nvram[offset + 2] = (byte)(value >> 8); + Generic.generic_nvram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)(value >> 16); + priority_ram[offset + 1] = (ushort)value; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)(value >> 16)); + igs011_layers_w(offset + 1, (ushort)value); + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)(value >> 16)); + igs011_palette(offset + 1, (ushort)value); + } + } + public static short MReadWord_dbc(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x010600 && address + 1 <= 0x0107ff) + { + result = (short)dbc_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x700000 && address + 1 <= 0x700001) + { + result = (short)((byte)sbytec); + } + else if (address >= 0x700002 && address + 1 <= 0x700005) + { + int offset = (address - 0x700002) / 2; + result = (short)lhb_inputs_r(offset); + } + else if (address >= 0x888000 && address + 1 <= 0x888001) + { + result = (short)((byte)igs_5_dips_r()); + } + return result; + } + public static short MReadWord_ryukobou(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x010600 && address + 1 <= 0x0107ff) + { + result = (short)ryukobou_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x700000 && address + 1 <= 0x700001) + { + result = (short)((byte)sbytec); + } + else if (address >= 0x700002 && address + 1 <= 0x700005) + { + int offset = (address - 0x700002) / 2; + result = (short)lhb_inputs_r(offset); + } + else if (address >= 0x888000 && address + 1 <= 0x888001) + { + result = (short)((byte)igs_5_dips_r()); + } + return result; + } + public static sbyte MReadOpByte_lhb2(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x020400 && address <= 0x0205ff) + { + if (address % 2 == 1) + { + result = (sbyte)lhb2_igs011_prot2_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MReadByte_lhb2(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x020400 && address <= 0x0205ff) + { + if (address % 2 == 1) + { + result = (sbyte)lhb2_igs011_prot2_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Generic.generic_nvram[offset]; + } + else if (address >= 0x200000 && address <= 0x200001) + { + result = (sbyte)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x208002 && address <= 0x208003) + { + if (address % 2 == 1) + { + result = (sbyte)lhb2_igs003_r(); + } + } + else if (address >= 0x20c000 && address <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(priority_ram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)priority_ram[offset]; + } + } + else if (address >= 0x210000 && address <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)paletteram16[offset]; + } + } + else if (address >= 0x214000 && address <= 0x214001) + { + if (address % 2 == 1) + { + result = sbytec; + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)igs011_layers_r1(offset / 2); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_layers_r2(offset / 2); + } + } + else if (address >= 0xa88000 && address <= 0xa88001) + { + result = (sbyte)igs_3_dips_r(); + } + return result; + } + public static short MReadOpWord_lhb2(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x020400 && address + 1 <= 0x0205ff) + { + result = (short)lhb2_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_lhb2(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x020400 && address + 1 <= 0x0205ff) + { + result = (short)lhb2_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200001) + { + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x208002 && address + 1 <= 0x208003) + { + result = (short)lhb2_igs003_r(); + } + else if (address >= 0x20c000 && address + 1 <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x210000 && address + 1 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + result = (short)paletteram16[offset]; + } + else if (address >= 0x214000 && address + 1 <= 0x214001) + { + result = (short)((byte)sbytec); + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0xa88000 && address + 1 <= 0xa88001) + { + result = (short)igs_3_dips_r(); + } + return result; + } + public static int MReadOpLong_lhb2(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MReadLong_lhb2(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = Generic.generic_nvram[offset] * 0x1000000 + Generic.generic_nvram[offset + 1] * 0x10000 + Generic.generic_nvram[offset + 2] * 0x100 + Generic.generic_nvram[offset + 3]; + } + else if (address >= 0x20c000 && address + 3 <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + result = priority_ram[offset] * 0x10000 + priority_ram[offset + 1]; + } + else if (address >= 0x210000 && address + 3 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + result = paletteram16[offset] * 0x10000 + paletteram16[offset + 1]; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = igs011_layers_r(offset) * 0x10000 + igs011_layers_r(offset + 1); + } + return result; + } + public static void MWriteByte_lhb2(int address, sbyte value) + { + address &= 0xffffff; + if (address >= prot1_addr && address <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w1(offset, (byte)value); + } + else if (address >= 0x020000 && address <= 0x0201ff) + { + igs011_prot2_inc_w(); + } + else if (address >= 0x020200 && address <= 0x0203ff) + { + int offset = (address - 0x020200) / 2; + lhb_igs011_prot2_swap_w(offset); + } + else if (address >= 0x020600 && address <= 0x0207ff) + { + igs011_prot2_reset_w(); + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200001) + { + if (address % 2 == 1) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + } + else if (address >= 0x204000 && address <= 0x204003) + { + int offset = (address - 0x204000) / 2; + if (address % 2 == 1) + { + YM2413.ym2413_write(offset, value); + } + } + else if (address >= 0x208000 && address <= 0x208003) + { + int offset = (address - 0x208000) / 2; + if (address % 2 == 0) + { + lhb2_igs003_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + lhb2_igs003_w2(offset, (byte)value); + } + } + else if (address >= 0x20c000 && address <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + if (address % 2 == 0) + { + priority_ram[offset] = (ushort)((value << 8) | (priority_ram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + priority_ram[offset] = (ushort)((priority_ram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x210000 && address <= 0x211fff) + { + int offset = address - 0x210000; + igs011_palette(offset, (byte)value); + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = address - 0x300000; + igs011_layers_w(offset, (byte)value); + } + else if (address >= 0xa20000 && address <= 0xa20001) + { + int offset = address - 0xa20000; + igs011_priority_w(offset, (byte)value); + } + else if (address >= 0xa40000 && address <= 0xa40001) + { + int offset = address - 0xa40000; + igs_dips_w(offset, (byte)value); + } + else if (address >= 0xa50000 && address <= 0xa50001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0xa58000 && address <= 0xa58001) + { + int offset = address - 0xa58000; + igs011_blit_x_w(offset, (byte)value); + } + else if (address >= 0xa58800 && address <= 0xa58801) + { + int offset = address - 0xa58800; + igs011_blit_y_w(offset, (byte)value); + } + else if (address >= 0xa59000 && address <= 0xa59001) + { + int offset = address - 0xa59000; + igs011_blit_w_w(offset, (byte)value); + } + else if (address >= 0xa59800 && address <= 0xa59801) + { + int offset = address - 0xa59800; + igs011_blit_h_w(offset, (byte)value); + } + else if (address >= 0xa5a000 && address <= 0xa5a001) + { + int offset = address - 0xa5a000; + igs011_blit_gfx_lo_w(offset, (byte)value); + } + else if (address >= 0xa5a800 && address <= 0xa5a801) + { + int offset = address - 0xa5a800; + igs011_blit_gfx_hi_w(offset, (byte)value); + } + else if (address >= 0xa5b000 && address <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address <= 0xa5b801) + { + int offset = address - 0xa5b800; + igs011_blit_pen_w(offset, (byte)value); + } + else if (address >= 0xa5c000 && address <= 0xa5c001) + { + int offset = address - 0xa5c000; + igs011_blit_depth_w(offset, (byte)value); + } + } + public static void MWriteWord_lhb2(int address, short value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 1 <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w(offset, (ushort)value); + } + else if (address >= 0x020000 && address + 1 <= 0x0201ff) + { + igs011_prot2_inc_w(); + } + else if (address >= 0x020200 && address + 1 <= 0x0203ff) + { + int offset = (address - 0x020200) / 2; + lhb_igs011_prot2_swap_w(offset); + } + else if (address >= 0x020600 && address + 1 <= 0x0207ff) + { + igs011_prot2_reset_w(); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 8); + Generic.generic_nvram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200001) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + else if (address >= 0x204000 && address + 1 <= 0x204003) + { + int offset = (address - 0x204000) / 2; + YM2413.ym2413_write(offset, value); + } + else if (address >= 0x208000 && address + 1 <= 0x208003) + { + int offset = (address - 0x208000) / 2; + lhb2_igs003_w(offset, (ushort)value); + } + else if (address >= 0x20c000 && address + 1 <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + priority_ram[offset] = (ushort)value; + } + else if (address >= 0x210000 && address + 1 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + igs011_palette(offset, (ushort)value); + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)value); + } + else if (address >= 0xa20000 && address + 1 <= 0xa20001) + { + igs011_priority_w((ushort)value); + } + else if (address >= 0xa40000 && address + 1 <= 0xa40001) + { + igs_dips_w((ushort)value); + } + else if (address >= 0xa50000 && address + 1 <= 0xa50001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0xa58000 && address + 1 <= 0xa58001) + { + igs011_blit_x_w((ushort)value); + } + else if (address >= 0xa58800 && address + 1 <= 0xa58801) + { + igs011_blit_y_w((ushort)value); + } + else if (address >= 0xa59000 && address + 1 <= 0xa59001) + { + igs011_blit_w_w((ushort)value); + } + else if (address >= 0xa59800 && address + 1 <= 0xa59801) + { + igs011_blit_h_w((ushort)value); + } + else if (address >= 0xa5a000 && address + 1 <= 0xa5a001) + { + igs011_blit_gfx_lo_w((ushort)value); + } + else if (address >= 0xa5a800 && address + 1 <= 0xa5a801) + { + igs011_blit_gfx_hi_w((ushort)value); + } + else if (address >= 0xa5b000 && address + 1 <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address + 1 <= 0xa5b801) + { + igs011_blit_pen_w((ushort)value); + } + else if (address >= 0xa5c000 && address + 1 <= 0xa5c001) + { + igs011_blit_depth_w((ushort)value); + } + } + public static void MWriteLong_lhb2(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + +3 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 24); + Generic.generic_nvram[offset + 1] = (byte)(value >> 16); + Generic.generic_nvram[offset + 2] = (byte)(value >> 8); + Generic.generic_nvram[offset + 3] = (byte)value; + } + else if (address >= 0x20c000 && address + 3 <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + priority_ram[offset] = (ushort)(value >> 16); + priority_ram[offset + 1] = (ushort)value; + } + else if (address >= 0x210000 && address + 3 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + igs011_palette(offset, (ushort)(value >> 16)); + igs011_palette(offset + 1, (ushort)value); + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)(value >> 16)); + igs011_layers_w(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_xymg(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MReadByte_xymg(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x010600 && address <= 0x0107ff) + { + if (address % 2 == 0) + { + result = (sbyte)(lhb2_igs011_prot2_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)lhb2_igs011_prot2_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x1f0000 && address <= 0x1f3fff) + { + int offset = address - 0x1f0000; + result = (sbyte)Generic.generic_nvram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(priority_ram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)priority_ram[offset]; + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)igs011_layers_r1(offset / 2); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_layers_r2(offset / 2); + } + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)paletteram16[offset]; + } + } + else if (address >= 0x600000 && address <= 0x600001) + { + result = (sbyte)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x700002 && address <= 0x700003) + { + result = (sbyte)xymg_igs003_r(); + } + else if (address >= 0x888000 && address <= 0x888001) + { + result = (sbyte)igs_3_dips_r(); + } + return result; + } + public static short MReadOpWord_xymg(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_xymg(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x010600 && address + 1 <= 0x0107ff) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x1f0000 && address + 1 <= 0x1f3fff) + { + int offset = address - 0x1f0000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = (short)paletteram16[offset]; + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x700002 && address + 1 <= 0x700003) + { + result = (short)xymg_igs003_r(); + } + else if (address >= 0x888000 && address + 1 <= 0x888001) + { + result = (short)igs_3_dips_r(); + } + return result; + } + public static int MReadOpLong_xymg(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x010001) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_xymg(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x1f0000 && address + 3 <= 0x1f3fff) + { + int offset = address - 0x1f0000; + result = Generic.generic_nvram[offset] * 0x1000000 + Generic.generic_nvram[offset + 1] * 0x10000 + Generic.generic_nvram[offset + 2] * 0x100 + Generic.generic_nvram[offset + 3]; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = priority_ram[offset] * 0x10000 + priority_ram[offset + 1]; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = igs011_layers_r(offset) * 0x10000 + igs011_layers_r(offset + 1); + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = paletteram16[offset] * 0x10000 + paletteram16[offset + 1]; + } + return result; + } + public static void MWriteByte_xymg(int address, sbyte value) + { + address &= 0xffffff; + if (address >= prot1_addr && address <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w1(offset, (byte)value); + } + else if (address >= 0x010000 && address <= 0x010001) + { + if (address % 2 == 0) + { + lhb_okibank_w((byte)value); + } + } + else if (address >= 0x010200 && address <= 0x0103ff) + { + igs011_prot2_inc_w(); + } + else if (address >= 0x010400 && address <= 0x0105ff) + { + int offset = (address - 0x010400) / 2; + lhb_igs011_prot2_swap_w(offset); + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value); + } + else if (address >= 0x1f0000 && address <= 0x1f3fff) + { + int offset = address - 0x1f0000; + Generic.generic_nvram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + priority_ram[offset] = (ushort)((value << 8) | (priority_ram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + priority_ram[offset] = (ushort)((priority_ram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = address - 0x300000; + igs011_layers_w(offset, (byte)value); + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = address - 0x400000; + igs011_palette(offset, (byte)value); + } + else if (address >= 0x600000 && address <= 0x600001) + { + if (address % 2 == 1) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + } + else if (address >= 0x700000 && address <= 0x700003) + { + int offset = (address - 0x700000) / 2; + xymg_igs003_w(offset, (ushort)value); + } + else if (address >= 0x820000 && address <= 0x820001) + { + int offset = address - 0x820000; + igs011_priority_w(offset, (byte)value); + } + else if (address >= 0x840000 && address <= 0x840001) + { + igs_dips_w((ushort)value); + } + else if (address >= 0x850000 && address <= 0x850001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0x858000 && address <= 0x858001) + { + int offset = address - 0x858000; + igs011_blit_x_w(offset, (byte)value); + } + else if (address >= 0x858800 && address <= 0x858801) + { + int offset = address - 0x858800; + igs011_blit_y_w(offset, (byte)value); + } + else if (address >= 0x859000 && address <= 0x859001) + { + int offset = address - 0x859000; + igs011_blit_w_w(offset, (byte)value); + } + else if (address >= 0x859800 && address <= 0x859801) + { + int offset = address - 0x859800; + igs011_blit_h_w(offset, (byte)value); + } + else if (address >= 0x85a000 && address <= 0x85a001) + { + int offset = address - 0x85a000; + igs011_blit_gfx_lo_w(offset, (byte)value); + } + else if (address >= 0x85a800 && address <= 0x85a801) + { + int offset = address - 0x85a800; + igs011_blit_gfx_hi_w(offset, (byte)value); + } + else if (address >= 0x85b000 && address <= 0x85b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0x85b800 && address <= 0x85b801) + { + int offset = address - 0x85b800; + igs011_blit_pen_w(offset, (byte)value); + } + else if (address >= 0x85c000 && address <= 0x85c001) + { + int offset = address - 0x85c000; + igs011_blit_depth_w(offset, (byte)value); + } + } + public static void MWriteWord_xymg(int address, short value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 1 <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w(offset, (ushort)value); + } + else if (address >= 0x010000 && address + 1 <= 0x010001) + { + lhb_okibank_w((ushort)value); + } + else if (address >= 0x010200 && address + 1 <= 0x0103ff) + { + igs011_prot2_inc_w(); + } + else if (address >= 0x010400 && address + 1 <= 0x0105ff) + { + int offset = (address - 0x010400) / 2; + lhb_igs011_prot2_swap_w(offset); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x1f0000 && address + 1 <= 0x1f3fff) + { + int offset = address - 0x1f0000; + Generic.generic_nvram[offset] = (byte)(value >> 8); + Generic.generic_nvram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)value; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)value); + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + else if (address >= 0x700000 && address + 1 <= 0x700003) + { + int offset = (address - 0x700000) / 2; + xymg_igs003_w(offset, (ushort)value); + } + else if (address >= 0x820000 && address + 1 <= 0x820001) + { + igs011_priority_w((ushort)value); + } + else if (address >= 0x840000 && address + 1 <= 0x840001) + { + igs_dips_w((ushort)value); + } + else if (address >= 0x850000 && address + 1 <= 0x850001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0x858000 && address + 1 <= 0x858001) + { + igs011_blit_x_w((ushort)value); + } + else if (address >= 0x858800 && address + 1 <= 0x858801) + { + igs011_blit_y_w((ushort)value); + } + else if (address >= 0x859000 && address + 1 <= 0x859001) + { + igs011_blit_w_w((ushort)value); + } + else if (address >= 0x859800 && address + 1 <= 0x859801) + { + igs011_blit_h_w((ushort)value); + } + else if (address >= 0x85a000 && address + 1 <= 0x85a001) + { + igs011_blit_gfx_lo_w((ushort)value); + } + else if (address >= 0x85a800 && address + 1 <= 0x85a801) + { + igs011_blit_gfx_hi_w((ushort)value); + } + else if (address >= 0x85b000 && address + 1 <= 0x85b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0x85b800 && address + 1 <= 0x85b801) + { + igs011_blit_pen_w((ushort)value); + } + else if (address >= 0x85c000 && address + 1 <= 0x85c001) + { + igs011_blit_depth_w((ushort)value); + } + } + public static void MWriteLong_xymg(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x1f0000 && address + 3 <= 0x1f3fff) + { + int offset = address - 0x1f0000; + Generic.generic_nvram[offset] = (byte)(value >> 24); + Generic.generic_nvram[offset + 1] = (byte)(value >> 16); + Generic.generic_nvram[offset + 2] = (byte)(value >> 8); + Generic.generic_nvram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)(value >> 16); + priority_ram[offset + 1] = (ushort)value; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)(value >> 16)); + igs011_layers_w(offset + 1, (ushort)value); + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)(value >> 16)); + igs011_palette(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_wlcc(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MReadByte_wlcc(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x518800 && address <= 0x5189ff) + { + result = (sbyte)igs011_prot2_reset_r(); + } + else if (address >= 0x519000 && address <= 0x5195ff) + { + if (address % 2 == 0) + { + result = (sbyte)(lhb2_igs011_prot2_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)lhb2_igs011_prot2_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Generic.generic_nvram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(priority_ram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)priority_ram[offset]; + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)igs011_layers_r1(offset / 2); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_layers_r2(offset / 2); + } + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)paletteram16[offset]; + } + } + else if (address >= 0x520000 && address <= 0x520001) + { + if (address % 2 == 1) + { + result = sbytec; + } + } + else if (address >= 0x600000 && address <= 0x600001) + { + result = (sbyte)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x800002 && address <= 0x800003) + { + if (address % 2 == 1) + { + result = (sbyte)wlcc_igs003_r(); + } + } + else if (address >= 0xa88000 && address <= 0xa88001) + { + result = (sbyte)igs_4_dips_r(); + } + return result; + } + public static short MReadOpWord_wlcc(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_wlcc(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x518800 && address + 1 <= 0x5189ff) + { + result = (short)igs011_prot2_reset_r(); + } + else if (address >= 0x519000 && address + 1 <= 0x5195ff) + { + result = (short)lhb2_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = (short)paletteram16[offset]; + } + else if (address >= 0x520000 && address + 1 <= 0x520001) + { + int offset = (address - 0x520000) / 2; + result = (short)((byte)sbytec); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + int offset = (address - 0x600000) / 2; + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x800002 && address + 1 <= 0x800003) + { + int offset = (address - 0x800002) / 2; + result = (short)wlcc_igs003_r(); + } + else if (address >= 0xa88000 && address + 1 <= 0xa88001) + { + int offset = (address - 0xa88000) / 2; + result = (short)igs_4_dips_r(); + } + return result; + } + public static int MReadOpLong_wlcc(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MReadLong_wlcc(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(Generic.generic_nvram[offset] * 0x1000000 + Generic.generic_nvram[offset + 1] * 0x10000 + Generic.generic_nvram[offset + 2] * 0x100 + Generic.generic_nvram[offset + 3]); + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(priority_ram[offset] * 0x10000 + priority_ram[offset + 1]); + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = igs011_layers_r(offset) * 0x10000 + igs011_layers_r(offset + 1); + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = (int)(paletteram16[offset] * 0x10000 + paletteram16[offset + 1]); + } + return result; + } + public static void MWriteByte_wlcc(int address, sbyte value) + { + address &= 0xffffff; + if (address >= prot1_addr && address <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w1(offset, (byte)value); + } + else if (address >= 0x518000 && address <= 0x5181ff) + { + igs011_prot2_inc_w(); + } + else if (address >= 0x518200 && address <= 0x5183ff) + { + int offset = (address - 0x518200) / 2; + wlcc_igs011_prot2_swap_w(offset); + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + priority_ram[offset] = (ushort)((value << 8) | (priority_ram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + priority_ram[offset] = (ushort)((priority_ram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = address - 0x300000; + igs011_layers_w(offset, (byte)value); + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = address - 0x400000; + igs011_palette(offset, (byte)value); + } + else if (address >= 0x600000 && address <= 0x600001) + { + if (address % 2 == 1) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + } + else if (address >= 0x800000 && address <= 0x800003) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + wlcc_igs003_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + wlcc_igs003_w2(offset, (byte)value); + } + } + else if (address >= 0xa20000 && address <= 0xa20001) + { + int offset = address - 0xa20000; + igs011_priority_w(offset, (byte)value); + } + else if (address >= 0xa40000 && address <= 0xa40001) + { + igs_dips_w((ushort)value); + } + else if (address >= 0xa50000 && address <= 0xa50001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0xa58000 && address <= 0xa58001) + { + int offset = address - 0xa58000; + igs011_blit_x_w(offset, (byte)value); + } + else if (address >= 0xa58800 && address <= 0xa58801) + { + int offset = address - 0xa58800; + igs011_blit_y_w(offset, (byte)value); + } + else if (address >= 0xa59000 && address <= 0xa59001) + { + int offset = address - 0xa59000; + igs011_blit_w_w(offset, (byte)value); + } + else if (address >= 0xa59800 && address <= 0xa59801) + { + int offset = address - 0xa59800; + igs011_blit_h_w(offset, (byte)value); + } + else if (address >= 0xa5a000 && address <= 0xa5a001) + { + int offset = address - 0xa5a000; + igs011_blit_gfx_lo_w(offset, (byte)value); + } + else if (address >= 0xa5a800 && address <= 0xa5a801) + { + int offset = address - 0xa5a800; + igs011_blit_gfx_hi_w(offset, (byte)value); + } + else if (address >= 0xa5b000 && address <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address <= 0xa5b801) + { + int offset = address - 0xa5b800; + igs011_blit_pen_w(offset, (byte)value); + } + else if (address >= 0xa5c000 && address <= 0xa5c001) + { + int offset = address - 0xa5c000; + igs011_blit_depth_w(offset, (byte)value); + } + } + public static void MWriteWord_wlcc(int address, short value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 1 <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w(offset, (ushort)value); + } + else if (address >= 0x518000 && address + 1 <= 0x5181ff) + { + igs011_prot2_inc_w(); + } + else if (address >= 0x518200 && address + 1 <= 0x5183ff) + { + int offset = (address - 0x518200) / 2; + wlcc_igs011_prot2_swap_w(offset); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 8); + Generic.generic_nvram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)value; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)value); + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x600001) + { + OKI6295.okim6295_data_0_lsb_w((byte)value); + } + else if (address >= 0x800000 && address + 1 <= 0x800003) + { + int offset = (address - 0x800000) / 2; + wlcc_igs003_w(offset, (ushort)value); + } + else if (address >= 0xa20000 && address + 1 <= 0xa20001) + { + igs011_priority_w((ushort)value); + } + else if (address >= 0xa40000 && address + 1 <= 0xa40001) + { + int offset = (address - 0xa40000) / 2; + igs_dips_w((ushort)value); + } + else if (address >= 0xa50000 && address + 1 <= 0xa50001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0xa58000 && address + 1 <= 0xa58001) + { + igs011_blit_x_w((ushort)value); + } + else if (address >= 0xa58800 && address + 1 <= 0xa58801) + { + igs011_blit_y_w((ushort)value); + } + else if (address >= 0xa59000 && address + 1 <= 0xa59001) + { + igs011_blit_w_w((ushort)value); + } + else if (address >= 0xa59800 && address + 1 <= 0xa59801) + { + igs011_blit_h_w((ushort)value); + } + else if (address >= 0xa5a000 && address + 1 <= 0xa5a001) + { + igs011_blit_gfx_lo_w((ushort)value); + } + else if (address >= 0xa5a800 && address + 1 <= 0xa5a801) + { + igs011_blit_gfx_hi_w((ushort)value); + } + else if (address >= 0xa5b000 && address + 1 <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address + 1 <= 0xa5b801) + { + igs011_blit_pen_w((ushort)value); + } + else if (address >= 0xa5c000 && address + 1 <= 0xa5c001) + { + igs011_blit_depth_w((ushort)value); + } + } + public static void MWriteLong_wlcc(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 24); + Generic.generic_nvram[offset + 1] = (byte)(value >> 16); + Generic.generic_nvram[offset + 2] = (byte)(value >> 8); + Generic.generic_nvram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)(value >> 16); + priority_ram[offset + 1] = (ushort)value; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)(value >> 16)); + igs011_layers_w(offset + 1, (ushort)value); + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)(value >> 16)); + igs011_palette(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_vbowl(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MReadByte_vbowl(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0 && address <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001610 && address2 <= 0x00161f) + { + if (address2 % 2 == 1) + { + result = (sbyte)igs012_prot_r(); + } + } + else if (address2 >= 0x001660 && address2 <= 0x00166f) + { + if (address2 % 2 == 1) + { + result = (sbyte)igs012_prot_r(); + } + } + else if (address >= 0x00d4c0 && address <= 0x00d4ff) + { + if (address2 % 2 == 0) + { + result = (sbyte)(drgnwrldv20j_igs011_prot2_r() >> 8); + } + } + } + else if (address >= 0x50f600 && address <= 0x50f7ff) + { + int offset = (address - 0x50f600) / 2; + if (address % 2 == 0) + { + result = (sbyte)(vbowl_igs011_prot2_r() >> 8); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Generic.generic_nvram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(priority_ram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)priority_ram[offset]; + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)igs011_layers_r1(offset / 2); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_layers_r2(offset / 2); + } + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)paletteram16[offset]; + } + } + else if (address >= 0x520000 && address <= 0x520001) + { + if (address % 2 == 1) + { + result = sbytec; + } + } + else if (address >= 0x600000 && address <= 0x600007) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + result = (sbyte)ics2115_0_word_r1(offset); + } + else if (address % 2 == 1) + { + result = (sbyte)ics2115_0_word_r2(offset); + } + } + else if (address >= 0x700000 && address <= 0x700003) + { + int offset = (address - 0x700000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(vbowl_trackball[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)vbowl_trackball[offset]; + } + } + else if (address >= 0x800002 && address <= 0x800003) + { + if (address % 2 == 1) + { + result = (sbyte)vbowl_igs003_r(); + } + } + else if (address >= 0xa80000 && address <= 0xa80001) + { + int offset = (address - 0xa80000) / 2; + result = (sbyte)vbowl_unk_r(); + } + else if (address >= 0xa88000 && address <= 0xa88001) + { + int offset = (address - 0xa88000) / 2; + result = (sbyte)igs_4_dips_r(); + } + else if (address >= 0xa90000 && address <= 0xa90001) + { + int offset = (address - 0xa90000) / 2; + result = (sbyte)vbowl_unk_r(); + } + else if (address >= 0xa98000 && address <= 0xa98001) + { + int offset = (address - 0xa98000) / 2; + result = (sbyte)vbowl_unk_r(); + } + return result; + } + public static short MReadOpWord_vbowl(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_vbowl(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0 && address <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001610 && address2 + 1 <= 0x00161f) + { + result = (short)igs012_prot_r(); + } + else if (address2 >= 0x001660 && address2 + 1 <= 0x00166f) + { + result = (short)igs012_prot_r(); + } + else if (address >= 0x00d4c0 && address + 1 <= 0x00d4ff) + { + result = (short)drgnwrldv20j_igs011_prot2_r(); + } + } + else if (address >= 0x50f600 && address + 1 <= 0x50f7ff) + { + result = (short)vbowl_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = (short)paletteram16[offset]; + } + else if (address >= 0x520000 && address + 1 <= 0x520001) + { + result = (short)((byte)sbytec); + } + else if (address >= 0x600000 && address + 1 <= 0x600007) + { + int offset = (address - 0x600000) / 2; + result = (short)ics2115_0_word_r(offset); + } + else if (address >= 0x700000 && address + 1 <= 0x700003) + { + int offset = (address - 0x700000) / 2; + result = (short)vbowl_trackball[offset]; + } + else if (address >= 0x800002 && address + 1 <= 0x800003) + { + int offset = (address - 0x800002) / 2; + result = (short)vbowl_igs003_r(); + } + else if (address >= 0xa80000 && address + 1 <= 0xa80001) + { + int offset = (address - 0xa80000) / 2; + result = (short)vbowl_unk_r(); + } + else if (address >= 0xa88000 && address + 1 <= 0xa88001) + { + int offset = (address - 0xa88000) / 2; + result = (short)igs_4_dips_r(); + } + else if (address >= 0xa90000 && address + 1 <= 0xa90001) + { + int offset = (address - 0xa90000) / 2; + result = (short)vbowl_unk_r(); + } + else if (address >= 0xa98000 && address + 1 <= 0xa98001) + { + int offset = (address - 0xa98000) / 2; + result = (short)vbowl_unk_r(); + } + return result; + } + public static int MReadOpLong_vbowl(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MReadLong_vbowl(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(Generic.generic_nvram[offset] * 0x1000000 + Generic.generic_nvram[offset + 1] * 0x10000 + Generic.generic_nvram[offset + 2] * 0x100 + Generic.generic_nvram[offset + 3]); + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(priority_ram[offset] * 0x10000 + priority_ram[offset + 1]); + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = igs011_layers_r(offset) * 0x10000 + igs011_layers_r(offset + 1); + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + result = (int)(paletteram16[offset] * 0x10000 + paletteram16[offset + 1]); + } + return result; + } + public static void MWriteByte_vbowl(int address, sbyte value) + { + address &= 0xffffff; + if (address >= prot1_addr && address <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w1(offset, (byte)value); + } + else if (address >= 0 && address <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001600 && address2 <= 0x00160f) + { + igs012_prot_swap_w((ushort)value); + } + else if (address2 >= 0x001620 && address2 <= 0x00162f) + { + igs012_prot_dec_inc_w((byte)value); + } + else if (address2 >= 0x001630 && address2 <= 0x00163f) + { + igs012_prot_inc_w((ushort)value); + } + else if (address2 >= 0x001640 && address2 <= 0x00164f) + { + igs012_prot_copy_w((ushort)value); + } + else if (address2 >= 0x001650 && address2 <= 0x00165f) + { + igs012_prot_dec_copy_w((ushort)value); + } + else if (address2 >= 0x001670 && address2 <= 0x00167f) + { + igs012_prot_mode_w((ushort)value); + } + else if (address >= 0x00d400 && address <= 0x00d43f) + { + igs011_prot2_dec_w(); + } + else if (address >= 0x00d440 && address <= 0x00d47f) + { + drgnwrld_igs011_prot2_swap_w(); + } + else if (address >= 0x00d480 && address <= 0x00d4bf) + { + igs011_prot2_reset_w(); + } + } + else if (address >= 0x50f000 && address <= 0x50f1ff) + { + igs011_prot2_dec_w(); + } + else if (address >= 0x50f200 && address <= 0x50f3ff) + { + int offset = (address - 0x50f200) / 2; + vbowl_igs011_prot2_swap_w(offset); + } + else if (address >= 0x50f400 && address <= 0x50f5ff) + { + igs011_prot2_reset_w(); + } + else if (address >= 0x902000 && address <= 0x902fff) + { + igs012_prot_reset_w(); + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + priority_ram[offset] = (ushort)((value << 8) | (priority_ram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + priority_ram[offset] = (ushort)((priority_ram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = address - 0x300000; + igs011_layers_w(offset, (byte)value); + } + else if (address >= 0x400000 && address <= 0x401fff) + { + int offset = address - 0x400000; + igs011_palette(offset, (byte)value); + } + else if (address >= 0x600000 && address <= 0x600007) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + ics2115_0_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + ics2115_0_word_w2(offset, (byte)value); + } + } + else if (address >= 0x700000 && address <= 0x700003) + { + int offset = (address - 0x700000) / 2; + if (address % 2 == 0) + { + vbowl_trackball[offset] = (ushort)((value << 8) | vbowl_trackball[offset] & 0xff); + } + else if (address % 2 == 1) + { + vbowl_trackball[offset] = (ushort)((vbowl_trackball[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x700004 && address <= 0x700005) + { + vbowl_pen_hi_w((byte)value); + } + else if (address >= 0x800000 && address <= 0x800003) + { + int offset = (address - 0x800000) / 2; + vbowl_igs003_w(offset, (ushort)value); + } + else if (address >= 0xa00000 && address <= 0xa00001) + { + vbowl_link_0_w(); + } + else if (address >= 0xa08000 && address <= 0xa08001) + { + vbowl_link_1_w(); + } + else if (address >= 0xa10000 && address <= 0xa10001) + { + vbowl_link_2_w(); + } + else if (address >= 0xa18000 && address <= 0xa18001) + { + vbowl_link_3_w(); + } + else if (address >= 0xa20000 && address <= 0xa20001) + { + int offset = address - 0xa20000; + igs011_priority_w(offset, (byte)value); + } + else if (address >= 0xa40000 && address <= 0xa40001) + { + int offset = address - 0xa40000; + igs_dips_w(offset, (byte)value); + } + else if (address >= 0xa48000 && address <= 0xa48001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0xa58000 && address <= 0xa58001) + { + int offset = address - 0xa58000; + igs011_blit_x_w(offset, (byte)value); + } + else if (address >= 0xa58800 && address <= 0xa58801) + { + int offset = address - 0xa58800; + igs011_blit_y_w(offset, (byte)value); + } + else if (address >= 0xa59000 && address <= 0xa59001) + { + int offset = address - 0xa59000; + igs011_blit_w_w(offset, (byte)value); + } + else if (address >= 0xa59800 && address <= 0xa59801) + { + int offset = address - 0xa59800; + igs011_blit_h_w(offset, (byte)value); + } + else if (address >= 0xa5a000 && address <= 0xa5a001) + { + int offset = address - 0xa5a000; + igs011_blit_gfx_lo_w(offset, (byte)value); + } + else if (address >= 0xa5a800 && address <= 0xa5a801) + { + int offset = address - 0xa5a800; + igs011_blit_gfx_hi_w(offset, (byte)value); + } + else if (address >= 0xa5b000 && address <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address <= 0xa5b801) + { + int offset = address - 0xa5b800; + igs011_blit_pen_w(offset, (byte)value); + } + else if (address >= 0xa5c000 && address <= 0xa5c001) + { + int offset = address - 0xa5c000; + igs011_blit_depth_w(offset, (byte)value); + } + } + public static void MWriteWord_vbowl(int address, short value) + { + address &= 0xffffff; + if (address >= prot1_addr && address + 1 <= prot1_addr + 7) + { + int offset = (int)(address - prot1_addr); + igs011_prot1_w(offset, (ushort)value); + } + else if (address >= 0 && address + 1 <= 0x1ffff) + { + int address2 = address & ~0x1c000; + if (address2 >= 0x001600 && address2 + 1 <= 0x00160f) + { + igs012_prot_swap_w((ushort)value); + } + else if (address2 >= 0x001620 && address2 + 1 <= 0x00162f) + { + igs012_prot_dec_inc_w((ushort)value); + } + else if (address2 >= 0x001630 && address2 + 1 <= 0x00163f) + { + igs012_prot_inc_w((ushort)value); + } + else if (address2 >= 0x001640 && address2 + 1 <= 0x00164f) + { + igs012_prot_copy_w((ushort)value); + } + else if (address2 >= 0x001650 && address2 + 1 <= 0x00165f) + { + igs012_prot_dec_copy_w((ushort)value); + } + else if (address2 >= 0x001670 && address2 + 1 <= 0x00167f) + { + igs012_prot_mode_w((ushort)value); + } + else if (address >= 0x00d400 && address + 1 <= 0x00d43f) + { + igs011_prot2_dec_w(); + } + else if (address >= 0x00d440 && address + 1 <= 0x00d47f) + { + drgnwrld_igs011_prot2_swap_w(); + } + else if (address >= 0x00d480 && address + 1 <= 0x00d4bf) + { + igs011_prot2_reset_w(); + } + } + else if (address >= 0x50f000 && address + 1 <= 0x50f1ff) + { + igs011_prot2_dec_w(); + } + else if (address >= 0x50f200 && address + 1 <= 0x50f3ff) + { + int offset = (address - 0x50f200) / 2; + vbowl_igs011_prot2_swap_w(offset); + } + else if (address >= 0x50f400 && address + 1 <= 0x50f5ff) + { + igs011_prot2_reset_w(); + } + else if (address >= 0x902000 && address + 1 <= 0x902fff) + { + igs012_prot_reset_w(); + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 8); + Generic.generic_nvram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)value; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)value); + } + else if (address >= 0x400000 && address + 1 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x600007) + { + int offset = (address - 0x600000) / 2; + ics2115_0_word_w(offset, (ushort)value); + } + else if (address >= 0x700000 && address + 1 <= 0x700003) + { + int offset = (address - 0x700000) / 2; + vbowl_trackball[offset] = (ushort)value; + } + else if (address >= 0x700004 && address + 1 <= 0x700005) + { + vbowl_pen_hi_w((byte)value); + } + else if (address >= 0x800000 && address + 1 <= 0x800003) + { + int offset = (address - 0x800000) / 2; + vbowl_igs003_w(offset, (ushort)value); + } + else if (address >= 0xa00000 && address + 1 <= 0xa00001) + { + vbowl_link_0_w(); + } + else if (address >= 0xa08000 && address + 1 <= 0xa08001) + { + vbowl_link_1_w(); + } + else if (address >= 0xa10000 && address + 1 <= 0xa10001) + { + vbowl_link_2_w(); + } + else if (address >= 0xa18000 && address + 1 <= 0xa18001) + { + vbowl_link_3_w(); + } + else if (address >= 0xa20000 && address + 1 <= 0xa20001) + { + igs011_priority_w((ushort)value); + } + else if (address >= 0xa40000 && address + 1 <= 0xa40001) + { + igs_dips_w((ushort)value); + } + else if (address >= 0xa48000 && address + 1 <= 0xa48001) + { + igs011_prot_addr_w((ushort)value); + } + else if (address >= 0xa58000 && address + 1 <= 0xa58001) + { + igs011_blit_x_w((ushort)value); + } + else if (address >= 0xa58800 && address + 1 <= 0xa58801) + { + igs011_blit_y_w((ushort)value); + } + else if (address >= 0xa59000 && address + 1 <= 0xa59001) + { + igs011_blit_w_w((ushort)value); + } + else if (address >= 0xa59800 && address + 1 <= 0xa59801) + { + igs011_blit_h_w((ushort)value); + } + else if (address >= 0xa5a000 && address + 1 <= 0xa5a001) + { + igs011_blit_gfx_lo_w((ushort)value); + } + else if (address >= 0xa5a800 && address + 1 <= 0xa5a801) + { + igs011_blit_gfx_hi_w((ushort)value); + } + else if (address >= 0xa5b000 && address + 1 <= 0xa5b001) + { + igs011_blit_flags_w((ushort)value); + } + else if (address >= 0xa5b800 && address + 1 <= 0xa5b801) + { + igs011_blit_pen_w((ushort)value); + } + else if (address >= 0xa5c000 && address + 1 <= 0xa5c001) + { + igs011_blit_depth_w((ushort)value); + } + } + public static void MWriteLong_vbowl(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Generic.generic_nvram[offset] = (byte)(value >> 24); + Generic.generic_nvram[offset + 1] = (byte)(value >> 16); + Generic.generic_nvram[offset + 2] = (byte)(value >> 8); + Generic.generic_nvram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + priority_ram[offset] = (ushort)(value >> 16); + priority_ram[offset + 1] = (ushort)value; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + igs011_layers_w(offset, (ushort)(value >> 16)); + igs011_layers_w(offset + 1, (ushort)value); + } + else if (address >= 0x400000 && address + 3 <= 0x401fff) + { + int offset = (address - 0x400000) / 2; + igs011_palette(offset, (ushort)(value >> 16)); + igs011_palette(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_nkishusp(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MReadByte_nkishusp(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= prot1_addr + 8 && address <= prot1_addr + 9) + { + if (address % 2 == 0) + { + result = (sbyte)(igs011_prot1_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_prot1_r(); + } + } + else if (address >= 0x023400 && address <= 0x0235ff) + { + result = (sbyte)lhb2_igs011_prot2_r(); + } + else if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Generic.generic_nvram[offset]; + } + else if (address >= 0x200000 && address <= 0x200001) + { + result = (sbyte)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x208002 && address <= 0x208003) + { + if (address % 2 == 1) + { + result = (sbyte)lhb2_igs003_r(); + } + } + else if (address >= 0x20c000 && address <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(priority_ram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)priority_ram[offset]; + } + } + else if (address >= 0x210000 && address <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)paletteram16[offset]; + } + } + else if (address >= 0x214000 && address <= 0x214001) + { + if (address % 2 == 1) + { + result = sbytec; + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)igs011_layers_r1(offset / 2); + } + else if (address % 2 == 1) + { + result = (sbyte)igs011_layers_r2(offset / 2); + } + } + else if (address >= 0xa88000 && address <= 0xa88001) + { + result = (sbyte)igs_3_dips_r(); + } + return result; + } + public static short MReadOpWord_nkishusp(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_nkishusp(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= prot1_addr + 8 && address + 1 <= prot1_addr + 9) + { + result = (short)igs011_prot1_r(); + } + else if (address >= 0x023400 && address + 1 <= 0x0235ff) + { + result = (short)lhb2_igs011_prot2_r(); + } + else if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Generic.generic_nvram[offset] * 0x100 + Generic.generic_nvram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200001) + { + result = (short)OKI6295.okim6295_status_0_lsb_r(); + } + else if (address >= 0x208002 && address + 1 <= 0x208003) + { + result = (short)lhb2_igs003_r(); + } + else if (address >= 0x20c000 && address + 1 <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + result = (short)priority_ram[offset]; + } + else if (address >= 0x210000 && address + 1 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + result = (short)paletteram16[offset]; + } + else if (address >= 0x214000 && address + 1 <= 0x214001) + { + result = (short)((byte)sbytec); + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)igs011_layers_r(offset); + } + else if (address >= 0xa88000 && address + 1 <= 0xa88001) + { + result = (short)igs_3_dips_r(); + } + return result; + } + public static int MReadOpLong_nkishusp(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MReadLong_nkishusp(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(Generic.generic_nvram[offset] * 0x1000000 + Generic.generic_nvram[offset + 1] * 0x10000 + Generic.generic_nvram[offset + 2] * 0x100 + Generic.generic_nvram[offset + 3]); + } + else if (address >= 0x20c000 && address + 3 <= 0x20cfff) + { + int offset = (address - 0x20c000) / 2; + result = (int)(priority_ram[offset] * 0x10000 + priority_ram[offset + 1]); + } + else if (address >= 0x210000 && address + 3 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + result = (int)(paletteram16[offset] * 0x10000 + paletteram16[offset + 1]); + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = igs011_layers_r(offset) * 0x10000 + igs011_layers_r(offset + 1); + } + return result; + } + public static void MWriteByte_nkishusp(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x023000 && address <= 0x0231ff) + { + int offset = (address - 0x023000) / 2; + } + else if (address >= 0x023200 && address <= 0x0233ff) + { + int offset = (address - 0x023200) / 2; + } + else if (address >= 0x023600 && address <= 0x0237ff) + { + int offset = (address - 0x023600) / 2; + } + else if (address >= 0x200000 && address <= 0x200001) + { + int offset = (address - 0x200000) / 2; + } + else if (address >= 0x204000 && address <= 0x204001) + { + int offset = (address - 0x204000) / 2; + } + else if (address >= 0x204002 && address <= 0x204003) + { + int offset = (address - 0x204002) / 2; + } + else if (address >= 0x208000 && address <= 0x208003) + { + int offset = (address - 0x208000) / 2; + } + else if (address >= 0x210000 && address <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + } + else if (address >= 0xa20000 && address <= 0xa20001) + { + int offset = (address - 0xa20000) / 2; + } + else if (address >= 0xa38000 && address <= 0xa38001) + { + int offset = (address - 0xa38000) / 2; + } + else if (address >= 0xa40000 && address <= 0xa40001) + { + int offset = (address - 0xa40000) / 2; + } + else if (address >= 0xa50000 && address <= 0xa50001) + { + int offset = (address - 0xa50000) / 2; + } + else if (address >= 0xa58000 && address <= 0xa58001) + { + int offset = (address - 0xa58000) / 2; + } + else if (address >= 0xa58800 && address <= 0xa58801) + { + int offset = (address - 0xa58800) / 2; + } + else if (address >= 0xa59000 && address <= 0xa59001) + { + int offset = (address - 0xa59000) / 2; + } + else if (address >= 0xa59800 && address <= 0xa59801) + { + int offset = (address - 0xa59800) / 2; + } + else if (address >= 0xa5a000 && address <= 0xa5a001) + { + int offset = (address - 0xa5a000) / 2; + } + else if (address >= 0xa5a800 && address <= 0xa5a801) + { + int offset = (address - 0xa5a800) / 2; + } + else if (address >= 0xa5b000 && address <= 0xa5b001) + { + int offset = (address - 0xa5b000) / 2; + } + else if (address >= 0xa5b800 && address <= 0xa5b801) + { + int offset = (address - 0xa5b800) / 2; + } + else if (address >= 0xa5c000 && address <= 0xa5c001) + { + int offset = (address - 0xa5c000) / 2; + } + } + public static void MWriteWord_nkishusp(int address, short value) + { + address &= 0xffffff; + if (address >= 0x023000 && address + 1 <= 0x0231ff) + { + int offset = (address - 0x023000) / 2; + } + else if (address >= 0x023200 && address + 1 <= 0x0233ff) + { + int offset = (address - 0x023200) / 2; + } + else if (address >= 0x023600 && address + 1 <= 0x0237ff) + { + int offset = (address - 0x023600) / 2; + } + else if (address >= 0x200000 && address + 1 <= 0x200001) + { + int offset = (address - 0x200000) / 2; + } + else if (address >= 0x204000 && address + 1 <= 0x204001) + { + int offset = (address - 0x204000) / 2; + } + else if (address >= 0x204002 && address + 1 <= 0x204003) + { + int offset = (address - 0x204002) / 2; + } + else if (address >= 0x208000 && address + 1 <= 0x208003) + { + int offset = (address - 0x208000) / 2; + } + else if (address >= 0x210000 && address + 1 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + } + else if (address >= 0xa20000 && address + 1 <= 0xa20001) + { + int offset = (address - 0xa20000) / 2; + } + else if (address >= 0xa38000 && address + 1 <= 0xa38001) + { + int offset = (address - 0xa38000) / 2; + } + else if (address >= 0xa40000 && address + 1 <= 0xa40001) + { + int offset = (address - 0xa40000) / 2; + } + else if (address >= 0xa50000 && address + 1 <= 0xa50001) + { + int offset = (address - 0xa50000) / 2; + } + else if (address >= 0xa58000 && address + 1 <= 0xa58001) + { + int offset = (address - 0xa58000) / 2; + } + else if (address >= 0xa58800 && address + 1 <= 0xa58801) + { + int offset = (address - 0xa58800) / 2; + } + else if (address >= 0xa59000 && address + 1 <= 0xa59001) + { + int offset = (address - 0xa59000) / 2; + } + else if (address >= 0xa59800 && address + 1 <= 0xa59801) + { + int offset = (address - 0xa59800) / 2; + } + else if (address >= 0xa5a000 && address + 1 <= 0xa5a001) + { + int offset = (address - 0xa5a000) / 2; + } + else if (address >= 0xa5a800 && address + 1 <= 0xa5a801) + { + int offset = (address - 0xa5a800) / 2; + } + else if (address >= 0xa5b000 && address + 1 <= 0xa5b001) + { + int offset = (address - 0xa5b000) / 2; + } + else if (address >= 0xa5b800 && address + 1 <= 0xa5b801) + { + int offset = (address - 0xa5b800) / 2; + } + else if (address >= 0xa5c000 && address + 1 <= 0xa5c001) + { + int offset = (address - 0xa5c000) / 2; + } + } + public static void MWriteLong_nkishusp(int address, int value) + { + address &= 0xffffff; + if (address >= 0x023000 && address + 3 <= 0x0231ff) + { + int offset = (address - 0x023000) / 2; + } + else if (address >= 0x023200 && address + 3 <= 0x0233ff) + { + int offset = (address - 0x023200) / 2; + } + else if (address >= 0x023600 && address + 3 <= 0x0237ff) + { + int offset = (address - 0x023600) / 2; + } + else if (address >= 0x200000 && address + 3 <= 0x200001) + { + int offset = (address - 0x200000) / 2; + } + else if (address >= 0x204000 && address + 3 <= 0x204001) + { + int offset = (address - 0x204000) / 2; + } + else if (address >= 0x204002 && address + 3 <= 0x204003) + { + int offset = (address - 0x204002) / 2; + } + else if (address >= 0x208000 && address + 3 <= 0x208003) + { + int offset = (address - 0x208000) / 2; + } + else if (address >= 0x210000 && address + 3 <= 0x211fff) + { + int offset = (address - 0x210000) / 2; + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + } + else if (address >= 0xa20000 && address + 3 <= 0xa20001) + { + int offset = (address - 0xa20000) / 2; + } + else if (address >= 0xa38000 && address + 3 <= 0xa38001) + { + int offset = (address - 0xa38000) / 2; + } + else if (address >= 0xa40000 && address + 3 <= 0xa40001) + { + int offset = (address - 0xa40000) / 2; + } + else if (address >= 0xa50000 && address + 3 <= 0xa50001) + { + int offset = (address - 0xa50000) / 2; + } + else if (address >= 0xa58000 && address + 3 <= 0xa58001) + { + int offset = (address - 0xa58000) / 2; + } + else if (address >= 0xa58800 && address + 3 <= 0xa58801) + { + int offset = (address - 0xa58800) / 2; + } + else if (address >= 0xa59000 && address + 3 <= 0xa59001) + { + int offset = (address - 0xa59000) / 2; + } + else if (address >= 0xa59800 && address + 3 <= 0xa59801) + { + int offset = (address - 0xa59800) / 2; + } + else if (address >= 0xa5a000 && address + 3 <= 0xa5a001) + { + int offset = (address - 0xa5a000) / 2; + } + else if (address >= 0xa5a800 && address + 3 <= 0xa5a801) + { + int offset = (address - 0xa5a800) / 2; + } + else if (address >= 0xa5b000 && address + 3 <= 0xa5b001) + { + int offset = (address - 0xa5b000) / 2; + } + else if (address >= 0xa5b800 && address + 3 <= 0xa5b801) + { + int offset = (address - 0xa5b800) / 2; + } + else if (address >= 0xa5c000 && address + 3 <= 0xa5c001) + { + int offset = (address - 0xa5c000) / 2; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory2.cs.meta new file mode 100644 index 00000000..7edca138 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31f4b49825c1e3f41b4dfa2f89c31bc7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/State.cs new file mode 100644 index 00000000..2519ab89 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/State.cs @@ -0,0 +1,147 @@ +using cpu.m68000; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class IGS011 + { + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Generic.generic_nvram, 0, 0x4000); + for (i = 0; i < 0x800; i++) + { + writer.Write(priority_ram[i]); + } + for (i = 0; i < 0x1000; i++) + { + writer.Write(paletteram16[i]); + } + writer.Write(prot1); + writer.Write(prot2); + writer.Write(prot1_swap); + writer.Write(prot1_addr); + for (i = 0; i < 2; i++) + { + writer.Write(igs003_reg[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(vbowl_trackball[i]); + } + writer.Write(priority); + writer.Write(igs_dips_sel); + writer.Write(igs_input_sel); + writer.Write(lhb_irq_enable); + writer.Write(igs012_prot); + writer.Write(igs012_prot_swap); + writer.Write(igs012_prot_mode); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 0x20000; j++) + { + writer.Write(layer[i][j]); + } + } + writer.Write(lhb2_pen_hi); + writer.Write(blitter.x); + writer.Write(blitter.y); + writer.Write(blitter.w); + writer.Write(blitter.h); + writer.Write(blitter.gfx_lo); + writer.Write(blitter.gfx_hi); + writer.Write(blitter.depth); + writer.Write(blitter.pen); + writer.Write(blitter.flags); + MC68000.m1.SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + OKI6295.SaveStateBinary(writer); + YM3812.SaveStateBinary(writer); + writer.Write(Sound.okistream.output_sampindex); + writer.Write(Sound.okistream.output_base_sampindex); + writer.Write(Sound.ym3812stream.output_sampindex); + writer.Write(Sound.ym3812stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Generic.generic_nvram_set = reader.ReadBytes(0x4000); + for (i = 0; i < 0x800; i++) + { + priority_ram[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x1000; i++) + { + paletteram16[i] = reader.ReadUInt16(); + } + prot1 = reader.ReadByte(); + prot2 = reader.ReadByte(); + prot1_swap = reader.ReadByte(); + prot1_addr = reader.ReadUInt32(); + for (i = 0; i < 2; i++) + { + igs003_reg[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + vbowl_trackball[i] = reader.ReadUInt16(); + } + priority = reader.ReadUInt16(); + igs_dips_sel = reader.ReadUInt16(); + igs_input_sel = reader.ReadUInt16(); + lhb_irq_enable = reader.ReadUInt16(); + igs012_prot = reader.ReadByte(); + igs012_prot_swap = reader.ReadByte(); + igs012_prot_mode = reader.ReadBoolean(); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 0x20000; j++) + { + layer[i][j] = reader.ReadByte(); + } + } + lhb2_pen_hi = reader.ReadByte(); + blitter.x = reader.ReadUInt16(); + blitter.y = reader.ReadUInt16(); + blitter.w = reader.ReadUInt16(); + blitter.h = reader.ReadUInt16(); + blitter.gfx_lo = reader.ReadUInt16(); + blitter.gfx_hi = reader.ReadUInt16(); + blitter.depth = reader.ReadUInt16(); + blitter.pen = reader.ReadUInt16(); + blitter.flags = reader.ReadUInt16(); + MC68000.m1.LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + OKI6295.LoadStateBinary(reader); + YM3812.LoadStateBinary(reader); + Sound.okistream.output_sampindex = reader.ReadInt32(); + Sound.okistream.output_base_sampindex = reader.ReadInt32(); + Sound.ym3812stream.output_sampindex = reader.ReadInt32(); + Sound.ym3812stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/State.cs.meta new file mode 100644 index 00000000..73da0fe2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 35f94c65275e845458333730fdec5f30 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Video.cs new file mode 100644 index 00000000..b768687d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Video.cs @@ -0,0 +1,384 @@ +namespace MAME.Core +{ + public unsafe partial class IGS011 + { + private static byte lhb2_pen_hi; + private static byte[][] layer; + public struct blitter_t + { + public ushort x, y, w, h, gfx_lo, gfx_hi, depth, pen, flags; + }; + private static blitter_t blitter; + private static void igs011_priority_w(int offset, byte data) + { + if (offset % 2 == 0) + { + priority = (ushort)((data << 8) | (priority & 0xff)); + } + else if (offset % 2 == 1) + { + priority = (ushort)((priority & 0xff00) | data); + } + } + private static void igs011_priority_w(ushort data) + { + priority = data; + } + public static void video_start_igs011() + { + int i; + layer = new byte[8][]; + for (i = 0; i < 8; i++) + { + layer[i] = new byte[0x20000]; + } + lhb2_pen_hi = 0; + } + public unsafe static void video_update_igs011() + { + int x, y, l, scr_addr, pri_addr; + int pri_ram_offset; + pri_ram_offset = (priority & 7) * 0x100; + for (y = 0; y <= 0xff; y++)//ef + { + for (x = 0; x <= 0x1ff; x++) + { + scr_addr = x + y * 0x200; + pri_addr = 0xff; + for (l = 0; l < 8; l++) + { + if (layer[l][scr_addr] != 0xff) + { + pri_addr &= ~(1 << l); + } + } + l = priority_ram[pri_ram_offset + pri_addr] & 7; + Video.bitmapbase_Ptrs[Video.curbitmap][y * 0x200 + x] = (ushort)(layer[l][scr_addr] | (l << 8)); + } + } + } + public static void video_eof_igs011() + { + + } + private static byte igs011_layers_r1(int offset) + { + int layer0 = ((offset & (0x80000 / 2)) != 0 ? 4 : 0) + ((offset & 1) != 0 ? 0 : 2); + offset >>= 1; + offset &= 0x1ffff; + return (byte)(layer[layer0][offset] << 8); + } + private static byte igs011_layers_r2(int offset) + { + int layer0 = ((offset & (0x80000 / 2)) != 0 ? 4 : 0) + ((offset & 1) != 0 ? 0 : 2); + offset >>= 1; + offset &= 0x1ffff; + return (byte)layer[layer0 + 1][offset]; + } + private static ushort igs011_layers_r(int offset) + { + int layer0 = ((offset & (0x80000 / 2)) != 0 ? 4 : 0) + ((offset & 1) != 0 ? 0 : 2); + offset >>= 1; + offset &= 0x1ffff; + return (ushort)((layer[layer0][offset] << 8) | layer[layer0 + 1][offset]); + } + private static void igs011_layers_w(int offset, byte data) + { + int layer0 = ((offset & 0x80000) != 0 ? 4 : 0) + ((offset & 2) != 0 ? 0 : 2); + offset >>= 2; + offset &= 0x1ffff; + if (offset % 2 == 0) + { + layer[layer0][offset] = data; + } + else if (offset % 2 == 1) + { + layer[layer0 + 1][offset] = data; + } + } + private static void igs011_layers_w(int offset, ushort data) + { + int layer0 = (((offset & (0x80000 / 2)) != 0) ? 4 : 0) + ((offset & 1) != 0 ? 0 : 2); + offset >>= 1; + offset &= 0x1ffff; + layer[layer0][offset] = (byte)(data >> 8); + layer[layer0 + 1][offset] = (byte)data; + } + private static void igs011_palette(int offset, byte data) + { + int rgb; + if (offset % 2 == 0) + { + paletteram16[offset / 2] = (ushort)((data << 8) | (paletteram16[offset / 2] & 0xff)); + } + else if (offset % 2 == 1) + { + paletteram16[offset / 2] = (ushort)((paletteram16[offset / 2] & 0xff00) | data); + } + rgb = (paletteram16[(offset / 2) & 0x7ff] & 0xff) | ((paletteram16[(offset / 2) | 0x800] & 0xff) << 8); + + //Palette.palette_entry_set_color1((offset / 2) & 0x7ff, (uint)((Palette.pal5bit((byte)(rgb >> 0)) << 16) | (Palette.pal5bit((byte)(rgb >> 5)) << 8) | Palette.pal5bit((byte)(rgb >> 10)))); + //通道修改,BGRA->RGBA + Palette.palette_entry_set_color1((offset / 2) & 0x7ff, + (uint)( + (Palette.pal5bit((byte)(rgb >> 10)) << 16) | + (Palette.pal5bit((byte)(rgb >> 5)) << 8) | + Palette.pal5bit((byte)(rgb >> 0)) + ) + ); + } + private static void igs011_palette(int offset, ushort data) + { + int rgb; + paletteram16[offset] = data; + rgb = (paletteram16[offset & 0x7ff] & 0xff) | ((paletteram16[offset | 0x800] & 0xff) << 8); + //Palette.palette_entry_set_color1(offset & 0x7ff, (uint)((Palette.pal5bit((byte)(rgb >> 0)) << 16) | (Palette.pal5bit((byte)(rgb >> 5)) << 8) | Palette.pal5bit((byte)(rgb >> 10)))); + //通道修改,BGRA->RGBA + Palette.palette_entry_set_color1(offset & 0x7ff, + (uint)( + (Palette.pal5bit((byte)(rgb >> 10)) << 16) | + (Palette.pal5bit((byte)(rgb >> 5)) << 8) | + Palette.pal5bit((byte)(rgb >> 0))) + ); + } + private static void igs011_blit_x_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.x = (ushort)((data << 8) | (blitter.x & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.x = (ushort)((blitter.x & 0xff00) | data); + } + } + private static void igs011_blit_x_w(ushort data) + { + blitter.x = data; + } + private static void igs011_blit_y_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.y = (ushort)((data << 8) | (blitter.y & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.y = (ushort)((blitter.y & 0xff00) | data); + } + } + private static void igs011_blit_y_w(ushort data) + { + blitter.y = data; + } + private static void igs011_blit_gfx_lo_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.gfx_lo = (ushort)((data << 8) | (blitter.gfx_lo & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.gfx_lo = (ushort)((blitter.gfx_lo & 0xff00) | data); + } + } + private static void igs011_blit_gfx_lo_w(ushort data) + { + blitter.gfx_lo = data; + } + private static void igs011_blit_gfx_hi_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.gfx_hi = (ushort)((data << 8) | (blitter.gfx_hi & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.gfx_hi = (ushort)((blitter.gfx_hi & 0xff00) | data); + } + } + private static void igs011_blit_gfx_hi_w(ushort data) + { + blitter.gfx_hi = data; + } + private static void igs011_blit_w_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.w = (ushort)((data << 8) | (blitter.w & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.w = (ushort)((blitter.w & 0xff00) | data); + } + } + private static void igs011_blit_w_w(ushort data) + { + blitter.w = data; + } + private static void igs011_blit_h_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.h = (ushort)((data << 8) | (blitter.h & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.h = (ushort)((blitter.h & 0xff00) | data); + } + } + private static void igs011_blit_h_w(ushort data) + { + blitter.h = data; + } + private static void igs011_blit_depth_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.depth = (ushort)((data << 8) | (blitter.depth & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.depth = (ushort)((blitter.depth & 0xff00) | data); + } + } + private static void igs011_blit_depth_w(ushort data) + { + blitter.depth = data; + } + private static void igs011_blit_pen_w(int offset, byte data) + { + if (offset % 2 == 0) + { + blitter.pen = (ushort)((data << 8) | (blitter.pen & 0xff)); + } + else if (offset % 2 == 1) + { + blitter.pen = (ushort)((blitter.pen & 0xff00) | data); + } + } + private static void igs011_blit_pen_w(ushort data) + { + blitter.pen = data; + } + private static void igs011_blit_flags_w(ushort data) + { + int x, xstart, xend, xinc, flipx; + int y, ystart, yend, yinc, flipy; + bool depth4; + int clear, opaque, z; + byte trans_pen, clear_pen, pen_hi, pen = 0; + int gfx_size = gfx1romLength; + int gfx2_size = 0; + if (gfx2rom != null) + { + gfx2_size = gfx2romLength; + } + blitter.flags = data; + opaque = (blitter.flags & 0x0008) == 0 ? 1 : 0; + clear = blitter.flags & 0x0010; + flipx = blitter.flags & 0x0020; + flipy = blitter.flags & 0x0040; + if ((blitter.flags & 0x0400) == 0) + { + return; + } + pen_hi = (byte)((lhb2_pen_hi & 0x07) << 5); + z = blitter.gfx_lo + (blitter.gfx_hi << 16); + depth4 = !((blitter.flags & 0x7) < (4 - (blitter.depth & 0x7))) || ((z & 0x800000) != 0); + z &= 0x7fffff; + if (depth4) + { + z *= 2; + if (gfx2rom != null && (blitter.gfx_hi & 0x80) != 0) + { + trans_pen = 0x1f; + } + else + { + trans_pen = 0x0f; + } + clear_pen = (byte)(blitter.pen | 0xf0); + } + else + { + if (gfx2rom != null) + { + trans_pen = 0x1f; + } + else + { + trans_pen = 0xff; + } + clear_pen = (byte)blitter.pen; + } + xstart = (blitter.x & 0x1ff) - (blitter.x & 0x200); + ystart = (blitter.y & 0x0ff) - (blitter.y & 0x100); + if (flipx != 0) + { + xend = xstart - (blitter.w & 0x1ff) - 1; + xinc = -1; + } + else + { + xend = xstart + (blitter.w & 0x1ff) + 1; + xinc = 1; + } + if (flipy != 0) + { + yend = ystart - (blitter.h & 0x0ff) - 1; + yinc = -1; + } + else + { + yend = ystart + (blitter.h & 0x0ff) + 1; + yinc = 1; + } + for (y = ystart; y != yend; y += yinc) + { + for (x = xstart; x != xend; x += xinc) + { + if (clear == 0) + { + if (depth4) + { + pen = (byte)((gfx1rom[(z / 2) % gfx_size] >> (((z & 1) != 0) ? 4 : 0)) & 0x0f); + } + else + { + pen = gfx1rom[z % gfx_size]; + } + if (gfx2rom != null) + { + pen &= 0x0f; + if ((gfx2rom[(z / 8) % gfx2_size] & (1 << (z & 7))) != 0) + { + pen |= 0x10; + } + } + } + if (x >= 0 && x <= 0x1ff && y >= 0 && y <= 0xef) + { + if (clear != 0) + { + layer[blitter.flags & 0x0007][x + y * 512] = clear_pen; + } + else if (pen != trans_pen) + { + if ((blitter.flags & 0x0007) == 0 && x == 0xa4 && y == 0x41) + { + int i1 = 1; + } + layer[blitter.flags & 0x0007][x + y * 512] = (byte)(pen | pen_hi); + } + else if (opaque != 0) + { + layer[blitter.flags & 0x0007][x + y * 512] = 0xff; + } + } + z++; + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Video.cs.meta new file mode 100644 index 00000000..c5a842b6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/igs011/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ebf0afb3164ba14580206496b16b7aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000.meta new file mode 100644 index 00000000..a6d39c58 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afd4944c198976a42a661f016abbd3a1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Drawgfx.cs new file mode 100644 index 00000000..812dfd65 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Drawgfx.cs @@ -0,0 +1,322 @@ +namespace MAME.Core +{ + public unsafe partial class Konami68000 + { + public static void common_drawgfxzoom_konami68000(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip, int transparent_color, int scalex, int scaley) + { + if ((scalex == 0) || (scaley == 0)) + { + return; + } + if (scalex == 0x10000 && scaley == 0x10000) + { + common_drawgfx_konami68000(bb1, code, color, flipx, flipy, sx, sy, clip, 0); + return; + } + RECT myclip; + myclip.min_x = clip.min_x; + myclip.max_x = clip.max_x; + myclip.min_y = clip.min_y; + myclip.max_y = clip.max_y; + if (myclip.min_x < 0) + myclip.min_x = 0; + if (myclip.max_x >= 0x200) + myclip.max_x = 0x200 - 1; + if (myclip.min_y < 0) + myclip.min_y = 0; + if (myclip.max_y >= 0x100) + myclip.max_y = 0x100 - 1; + int colorbase = 0x10 * (color % 0x80); + int source_baseoffset = (code % sprite_totel_element) * 0x100; + int sprite_screen_height = (scaley * 0x10 + 0x8000) >> 16; + int sprite_screen_width = (scalex * 0x10 + 0x8000) >> 16; + int countx, county, i, j, srcoffset, dstoffset; + if (sprite_screen_width != 0 && sprite_screen_height != 0) + { + int dx = (0x10 << 16) / sprite_screen_width; + int dy = (0x10 << 16) / sprite_screen_height; + int ex = sx + sprite_screen_width; + int ey = sy + sprite_screen_height; + int x_index_base; + int y_index; + if (flipx != 0) + { + x_index_base = (sprite_screen_width - 1) * dx; + dx = -dx; + } + else + { + x_index_base = 0; + } + if (flipy != 0) + { + y_index = (sprite_screen_height - 1) * dy; + dy = -dy; + } + else + { + y_index = 0; + } + if (sx < myclip.min_x) + { + int pixels = myclip.min_x - sx; + sx += pixels; + x_index_base += pixels * dx; + } + if (sy < myclip.min_y) + { + int pixels = myclip.min_y - sy; + sy += pixels; + y_index += pixels * dy; + } + if (ex > myclip.max_x + 1) + { + int pixels = ex - myclip.max_x - 1; + ex -= pixels; + } + if (ey > myclip.max_y + 1) + { + int pixels = ey - myclip.max_y - 1; + ey -= pixels; + } + if (ex > sx) + { + countx = ex - sx; + county = ey - sy; + for (i = 0; i < county; i++) + { + for (j = 0; j < countx; j++) + { + int c; + srcoffset = ((y_index + dy * i) >> 16) * 0x10 + ((x_index_base + dx * j) >> 16); + dstoffset = (sy + i) * 0x200 + sx + j; + c = bb1[source_baseoffset + srcoffset]; + if (c != transparent_color) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(sy + i) * 0x200 + sx + j] = (ushort)(colorbase + c); + } + } + } + } + } + } + public static void common_drawgfxzoom_konami68000(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip, int transparent_color, int scalex, int scaley, uint pri_mask) + { + if ((scalex == 0) || (scaley == 0)) + { + return; + } + if (scalex == 0x10000 && scaley == 0x10000) + { + common_drawgfx_konami68000(bb1, code, color, flipx, flipy, sx, sy, clip, pri_mask); + return; + } + RECT myclip; + myclip.min_x = clip.min_x; + myclip.max_x = clip.max_x; + myclip.min_y = clip.min_y; + myclip.max_y = clip.max_y; + if (myclip.min_x < 0) + myclip.min_x = 0; + if (myclip.max_x >= 0x200) + myclip.max_x = 0x200 - 1; + if (myclip.min_y < 0) + myclip.min_y = 0; + if (myclip.max_y >= 0x100) + myclip.max_y = 0x100 - 1; + int colorbase = 0x10 * (color % 0x80); + int source_baseoffset = (code % sprite_totel_element) * 0x100; + int sprite_screen_height = (scaley * 0x10 + 0x8000) >> 16; + int sprite_screen_width = (scalex * 0x10 + 0x8000) >> 16; + int countx, county, i, j, srcoffset, dstoffset; + if (sprite_screen_width != 0 && sprite_screen_height != 0) + { + int dx = (0x10 << 16) / sprite_screen_width; + int dy = (0x10 << 16) / sprite_screen_height; + int ex = sx + sprite_screen_width; + int ey = sy + sprite_screen_height; + int x_index_base; + int y_index; + if (flipx != 0) + { + x_index_base = (sprite_screen_width - 1) * dx; + dx = -dx; + } + else + { + x_index_base = 0; + } + if (flipy != 0) + { + y_index = (sprite_screen_height - 1) * dy; + dy = -dy; + } + else + { + y_index = 0; + } + if (sx < myclip.min_x) + { + int pixels = myclip.min_x - sx; + sx += pixels; + x_index_base += pixels * dx; + } + if (sy < myclip.min_y) + { + int pixels = myclip.min_y - sy; + sy += pixels; + y_index += pixels * dy; + } + if (ex > myclip.max_x + 1) + { + int pixels = ex - myclip.max_x - 1; + ex -= pixels; + } + if (ey > myclip.max_y + 1) + { + int pixels = ey - myclip.max_y - 1; + ey -= pixels; + } + if (ex > sx) + { + countx = ex - sx; + county = ey - sy; + for (i = 0; i < county; i++) + { + for (j = 0; j < countx; j++) + { + int c; + srcoffset = ((y_index + dy * i) >> 16) * 0x10 + ((x_index_base + dx * j) >> 16); + dstoffset = (sy + i) * 0x200 + sx + j; + c = bb1[source_baseoffset + srcoffset]; + if (c != transparent_color) + { + if (((1 << Tilemap.priority_bitmap[sy + i, sx + j]) & pri_mask) == 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(sy + i) * 0x200 + sx + j] = (ushort)(colorbase + c); + } + Tilemap.priority_bitmap[sy + i, sx + j] = 0x1f; + } + } + } + } + } + } + public static void common_drawgfx_konami68000(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip, uint pri_mask) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 0x10 - 1; + if (code > 0x4000 || color > 0x80) + { + int i1 = 1; + } + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x200) + { + ex = 0x200 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x10 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = color * 0x10; + blockmove_8toN_transpen_pri16_konami68000(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, pri_mask, sx, sy); + } + public static void blockmove_8toN_transpen_pri16_konami68000(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, + int leftskip, int topskip, int flipx, int flipy, + int dstwidth, int dstheight, int colorbase, uint pmask, int sx, int sy) + { + int ydir, xdir, col, i, j, offsetx, offsety; + int srcdata_offset = code * 0x100; + offsetx = sx; + offsety = sy; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0) + { + if (((1 << (Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x1f)) & pmask) == 0) + { + if ((Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x80) != 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = (ushort)(colorbase + col);//palette_shadow_table[paldata[col]]; + } + else + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] = (byte)((Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x7f) | 0x1f); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Drawgfx.cs.meta new file mode 100644 index 00000000..a5fdd933 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90885dc3c2b7b7f45af72a376a3ac62f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Input.cs new file mode 100644 index 00000000..6cfe74d0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Input.cs @@ -0,0 +1,1436 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class Konami68000 + { + public static void loop_inputports_konami68000_common() + { + + } + public static void loop_inputports_konami68000_cuebrick() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x08; + } + else + { + sbyte0 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x40; + } + else + { + sbyte0 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x20; + } + else + { + //sbyte0 |= 0x20; + } + } + public static void loop_inputports_konami68000_tmnt() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + //sbyte1 &= ~0x04; + } + else + { + //sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + //sbyte1 &= ~0x40; + } + else + { + //sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + } + public static void loop_inputports_konami68000_blswhstl() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + //sbyte1 &= ~0x04; + } + else + { + //sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + //sbyte1 &= ~0x40; + } + else + { + //sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x20; + } + else + { + //sbyte0 |= 0x20; + } + } + public static void loop_inputports_konami68000_glfgreat() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + dsw3 &= unchecked((byte)~0x01); + } + else + { + dsw3 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + dsw3 &= unchecked((byte)~0x02); + } + else + { + dsw3 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + sbyte1 &= unchecked((sbyte)~0x80); + } + else + { + sbyte1 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x20; + } + else + { + //sbyte0 |= 0x20; + } + } + public static void loop_inputports_konami68000_qgakumon() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= unchecked((sbyte)~0x80); + } + else + { + sbyte1 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(Key.L)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + }*/ + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(Key.NumPad3)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + }*/ + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + //sbyte0 &= ~0x40; + } + else + { + //sbyte0 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x20; + } + else + { + //sbyte0 |= 0x20; + } + } + public static void loop_inputports_konami68000_ssriders() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= unchecked((sbyte)~0x80); + } + else + { + sbyte1 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + //sbyte1 &= ~0x04; + } + else + { + //sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + //sbyte1 &= ~0x40; + } + else + { + //sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + } + public static void loop_inputports_konami68000_thndrx2() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= unchecked((sbyte)~0x80); + } + else + { + sbyte1 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (((byte)sbyte1 & 0x03) == 0) + { + sbyte1 |= 0x03; + } + if (((byte)sbyte1 & 0x0c) == 0) + { + sbyte1 |= 0x0c; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + //sbyte1 &= ~0x04; + } + else + { + //sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (((byte)sbyte2 & 0x03) == 0) + { + sbyte2 |= 0x03; + } + if (((byte)sbyte2 & 0x0c) == 0) + { + sbyte2 |= 0x0c; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + //sbyte1 &= ~0x40; + } + else + { + //sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x20; + } + else + { + //sbyte0 |= 0x20; + } + } + public static void loop_inputports_konami68000_prmrsocr() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + bytee &= unchecked((byte)~0x04); + } + else + { + bytee |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= unchecked((sbyte)~0x80); + } + else + { + sbyte1 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + //sbyte1 &= ~0x04; + } + else + { + //sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + //sbyte1 &= ~0x40; + } + else + { + //sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + //sbyte0 &= ~0x20; + } + else + { + //sbyte0 |= 0x20; + } + } + public static void record_port() + { + if (sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old || sbyte3 != sbyte3_old || sbyte4 != sbyte4_old) + { + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + sbyte3_old = sbyte3; + sbyte4_old = sbyte4; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbyte3); + Mame.bwRecord.Write(sbyte4); + } + } + public static void replay_port() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbyte3_old = Mame.brRecord.ReadSByte(); + sbyte4_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + sbyte3 = sbyte3_old; + sbyte4 = sbyte4_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + public static void record_port_prmrsocr() + { + if (sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old || sbyte3 != sbyte3_old || sbyte4 != sbyte4_old || bytee != bytee_old) + { + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + sbyte3_old = sbyte3; + sbyte4_old = sbyte4; + bytee_old = bytee; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbyte3); + Mame.bwRecord.Write(sbyte4); + Mame.bwRecord.Write(bytee); + } + } + public static void replay_port_prmrsocr() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbyte3_old = Mame.brRecord.ReadSByte(); + sbyte4_old = Mame.brRecord.ReadSByte(); + bytee_old = Mame.brRecord.ReadByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + sbyte3 = sbyte3_old; + sbyte4 = sbyte4_old; + bytee = bytee_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Input.cs.meta new file mode 100644 index 00000000..124fc209 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d8b97e67ee60cf046bba3265cb6e77dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konami68000.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konami68000.cs new file mode 100644 index 00000000..57c6596a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konami68000.cs @@ -0,0 +1,1451 @@ +using cpu.m68000; +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Konami68000 + { + //public static byte[] /*gfx1rom,*/ /*gfx2rom, *//*gfx12rom,*/ gfx22rom, titlerom, user1rom, zoomrom; + public static byte dsw1, dsw2, dsw3, bytee; + //public static byte[] mainram2; + //public static short[] sampledata; + //public static ushort[] cuebrick_nvram, tmnt2_1c0800; + private static int init_eeprom_count; + private static int toggle, sprite_totel_element; + private static int tmnt_soundlatch, cuebrick_snd_irqlatch, cuebrick_nvram_bank; + public static int basebanksnd; + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + #region //指针化 gfx12rom + static byte[] gfx12rom_src; + static GCHandle gfx12rom_handle; + public static byte* gfx12rom; + public static int gfx12romLength; + public static bool gfx12rom_IsNull => gfx12rom == null; + public static byte[] gfx12rom_set + { + set + { + gfx12rom_handle.ReleaseGCHandle(); + gfx12rom_src = value; + gfx12romLength = value.Length; + gfx12rom_src.GetObjectPtr(ref gfx12rom_handle, ref gfx12rom); + } + } + #endregion + + #region //指针化 gfx22rom + static byte[] gfx22rom_src; + static GCHandle gfx22rom_handle; + public static byte* gfx22rom; + public static int gfx22romLength; + public static bool gfx22rom_IsNull => gfx22rom == null; + public static byte[] gfx22rom_set + { + set + { + gfx22rom_handle.ReleaseGCHandle(); + gfx22rom_src = value; + gfx22romLength = value.Length; + gfx22rom_src.GetObjectPtr(ref gfx22rom_handle, ref gfx22rom); + } + } + #endregion + + #region //指针化 titlerom + static byte[] titlerom_src; + static GCHandle titlerom_handle; + public static byte* titlerom; + public static int titleromLength; + public static bool titlerom_IsNull => titlerom == null; + public static byte[] titlerom_set + { + set + { + titlerom_handle.ReleaseGCHandle(); + if (value == null) + return; + titlerom_src = value; + titleromLength = value.Length; + titlerom_src.GetObjectPtr(ref titlerom_handle, ref titlerom); + } + } + #endregion + + #region //指针化 user1rom + static byte[] user1rom_src; + static GCHandle user1rom_handle; + public static byte* user1rom; + public static int user1romLength; + public static bool user1rom_IsNull => user1rom == null; + public static byte[] user1rom_set + { + set + { + user1rom_handle.ReleaseGCHandle(); + if (value == null) + return; + user1rom_src = value; + user1romLength = value.Length; + user1rom_src.GetObjectPtr(ref user1rom_handle, ref user1rom); + } + } + #endregion + + #region //指针化 zoomrom + static byte[] zoomrom_src; + static GCHandle zoomrom_handle; + public static byte* zoomrom; + public static int zoomromLength; + public static bool zoomrom_IsNull => zoomrom == null; + public static byte[] zoomrom_set + { + set + { + zoomrom_handle.ReleaseGCHandle(); + if (value == null) + return; + zoomrom_src = value; + zoomromLength = value.Length; + zoomrom_src.GetObjectPtr(ref zoomrom_handle, ref zoomrom); + } + } + #endregion + + + #region //指针化 mainram2 + static byte[] mainram2_src; + static GCHandle mainram2_handle; + public static byte* mainram2; + public static int mainram2Length; + public static bool mainram2_IsNull => mainram2 == null; + public static byte[] mainram2_set + { + set + { + mainram2_handle.ReleaseGCHandle(); + mainram2_src = value; + mainram2Length = value.Length; + mainram2_src.GetObjectPtr(ref mainram2_handle, ref mainram2); + } + } + #endregion + + + #region //指针化 sampledata + static short[] sampledata_src; + static GCHandle sampledata_handle; + public static short* sampledata; + public static int sampledataLength; + public static bool sampledata_IsNull => sampledata == null; + public static short[] sampledata_set + { + set + { + sampledata_handle.ReleaseGCHandle(); + sampledata_src = value; + sampledataLength = value.Length; + sampledata_src.GetObjectPtr(ref sampledata_handle, ref sampledata); + } + } + #endregion + + #region //指针化 cuebrick_nvram + static ushort[] cuebrick_nvram_src; + static GCHandle cuebrick_nvram_handle; + public static ushort* cuebrick_nvram; + public static int cuebrick_nvramLength; + public static bool cuebrick_nvram_IsNull => cuebrick_nvram == null; + public static ushort[] cuebrick_nvram_set + { + set + { + cuebrick_nvram_handle.ReleaseGCHandle(); + cuebrick_nvram_src = value; + cuebrick_nvramLength = value.Length; + cuebrick_nvram_src.GetObjectPtr(ref cuebrick_nvram_handle, ref cuebrick_nvram); + } + } + #endregion + + #region //指针化 tmnt2_1c0800 + static ushort[] tmnt2_1c0800_src; + static GCHandle tmnt2_1c0800_handle; + public static ushort* tmnt2_1c0800; + public static int tmnt2_1c0800Length; + public static bool tmnt2_1c0800_IsNull => tmnt2_1c0800 == null; + public static ushort[] tmnt2_1c0800_set + { + set + { + tmnt2_1c0800_handle.ReleaseGCHandle(); + if (value == null) + return; + tmnt2_1c0800_src = value; + tmnt2_1c0800Length = value.Length; + tmnt2_1c0800_src.GetObjectPtr(ref tmnt2_1c0800_handle, ref tmnt2_1c0800); + } + } + #endregion + + + public static void Konami68000Init() + { + int i, n1, n2; + Generic.paletteram16_set = new ushort[0x800]; + Generic.spriteram16_set = new ushort[0x2000]; + init_eeprom_count = 10; + toggle = 0; + Memory.Set_mainram(new byte[0x4000]); + Memory.Set_audioram(new byte[0x2000]);//0x800 prmrsocr_0x2000 + mainram2_set = new byte[0x4000];//0x4000 tmnt2_ssriders_0x80 + layer_colorbase = new int[3]; + cuebrick_nvram_set = new ushort[0x400 * 0x20]; + tmnt2_1c0800_set = new ushort[0x10]; + K053245_memory_region = new byte[2][]; + K053244_rombank = new int[2]; + K053245_ramsize = new int[2]; + K053245_dx = new int[2]; + K053245_dy = new int[2]; + K053245_ram = new byte[2][]; + K053245_buffer = new ushort[2][]; + K053244_regs = new byte[2][]; + K052109_charrombank = new byte[4]; + K052109_charrombank_2 = new byte[4]; + K053251_ram = new byte[0x10]; + K053251_palette_index = new int[5]; + K052109_dx = new int[3]; + K052109_dy = new int[3]; + for (i = 0; i < 2; i++) + { + K053245_ram[i] = new byte[0]; + K053245_buffer[i] = new ushort[0]; + K053244_regs[i] = new byte[0x10]; + } + K053251_tilemaps = new Tmap[5]; + K053936_offset = new int[2][]; + for (i = 0; i < 2; i++) + { + K053936_offset[i] = new int[2]; + } + K053936_wraparound = new int[2]; + K053936_0_ctrl = new ushort[0x10]; + K053936_0_linectrl = new ushort[0x800]; + K054000_ram = new byte[0x20]; + layerpri = new int[3]; + sorted_layer = new int[3]; + Machine.bRom = true; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + n1 = gfx1romLength; + gfx12rom_set = new byte[n1 * 2]; + for (i = 0; i < n1; i++) + { + gfx12rom[i * 2] = (byte)(gfx1rom[i] >> 4); + gfx12rom[i * 2 + 1] = (byte)(gfx1rom[i] & 0x0f); + } + gfx2rom_set = Machine.GetRom("gfx2.rom"); + n2 = gfx2romLength; + gfx22rom_set = new byte[n2 * 2]; + for (i = 0; i < n2; i++) + { + gfx22rom[i * 2] = (byte)(gfx2rom[i] >> 4); + gfx22rom[i * 2 + 1] = (byte)(gfx2rom[i] & 0x0f); + } + sprite_totel_element = gfx22romLength / 0x100; + switch (Machine.sName) + { + case "cuebrick": + K052109_memory_region = Machine.GetRom("k052109.rom"); + K051960_memory_region = Machine.GetRom("k051960.rom"); + if (Memory.mainrom_IsNull || gfx1rom == null || gfx2rom == null || K052109_memory_region == null || K051960_memory_region == null) + { + Machine.bRom = false; + } + break; + case "mia": + case "mia2": + K052109_memory_region = Machine.GetRom("k052109.rom"); + K051960_memory_region = Machine.GetRom("k051960.rom"); + K007232.k007232rom = Machine.GetRom("k007232.rom"); + if (Memory.mainrom_IsNull || gfx1rom == null || gfx2rom == null || K052109_memory_region == null || K051960_memory_region == null || Memory.audiorom_IsNull || K007232.k007232rom == null) + { + Machine.bRom = false; + } + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + K052109_memory_region = Machine.GetRom("k052109.rom"); + K051960_memory_region = Machine.GetRom("k051960.rom"); + K007232.k007232rom = Machine.GetRom("k007232.rom"); + Upd7759.updrom = Machine.GetRom("upd.rom"); + titlerom_set = Machine.GetRom("title.rom"); + if (Memory.mainrom_IsNull || gfx1rom == null || gfx2rom == null || K052109_memory_region == null || K051960_memory_region == null || Memory.audiorom_IsNull || K007232.k007232rom == null || Upd7759.updrom == null || titlerom == null) + { + Machine.bRom = false; + } + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + K052109_memory_region = Machine.GetRom("k052109.rom"); + K051960_memory_region = Machine.GetRom("k051960.rom"); + K053260.k053260rom = Machine.GetRom("k053260.rom"); + if (Memory.mainrom_IsNull || gfx1rom == null || gfx2rom == null || K052109_memory_region == null || K051960_memory_region == null || Memory.audiorom_IsNull || K053260.k053260rom == null) + { + Machine.bRom = false; + } + break; + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + case "blswhstl": + case "blswhstla": + case "detatwin": + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + K052109_memory_region = Machine.GetRom("k052109.rom"); + K053245_memory_region[0] = Machine.GetRom("k053245.rom"); + K053260.k053260rom = Machine.GetRom("k053260.rom"); + if (Memory.mainrom_IsNull || gfx1rom == null || gfx2rom == null || K052109_memory_region == null || K053245_memory_region[0] == null || Memory.audiorom_IsNull || K053260.k053260rom == null) + { + Machine.bRom = false; + } + break; + case "glfgreat": + case "glfgreatj": + K052109_memory_region = Machine.GetRom("k052109.rom"); + K053245_memory_region[0] = Machine.GetRom("k053245.rom"); + zoomrom_set = Machine.GetRom("zoom.rom"); + user1rom_set = Machine.GetRom("user1.rom"); + K053260.k053260rom = Machine.GetRom("k053260.rom"); + if (Memory.mainrom_IsNull || gfx1rom == null || gfx2rom == null || K052109_memory_region == null || K053245_memory_region[0] == null || zoomrom == null || user1rom == null || Memory.audiorom_IsNull || K053260.k053260rom == null) + { + Machine.bRom = false; + } + break; + case "prmrsocr": + case "prmrsocrj": + K052109_memory_region = Machine.GetRom("k052109.rom"); + K053245_memory_region[0] = Machine.GetRom("k053245.rom"); + zoomrom_set = Machine.GetRom("zoom.rom"); + user1rom_set = Machine.GetRom("user1.rom"); + K054539.k054539rom = Machine.GetRom("k054539.rom"); + if (Memory.mainrom_IsNull || gfx1rom == null || gfx2rom == null || K052109_memory_region == null || K053245_memory_region[0] == null || zoomrom == null || user1rom == null || Memory.audiorom_IsNull || K054539.k054539rom == null) + { + Machine.bRom = false; + } + break; + } + if (Machine.bRom) + { + switch (Machine.sName) + { + case "cuebrick": + dsw1 = 0x56; + dsw2 = 0xff; + dsw3 = 0x0f; + K052109_callback = cuebrick_tile_callback; + K051960_callback = mia_sprite_callback; + break; + case "mia": + case "mia2": + dsw1 = 0xff; + dsw2 = 0x56; + dsw3 = 0x0f; + K052109_callback = mia_tile_callback; + K051960_callback = mia_sprite_callback; + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + dsw1 = 0x0f; + dsw2 = 0x5f; + dsw3 = 0xff; + K052109_callback = tmnt_tile_callback; + K051960_callback = tmnt_sprite_callback; + break; + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + dsw1 = 0xff; + dsw2 = 0x5f; + dsw3 = 0xff; + K052109_callback = tmnt_tile_callback; + K051960_callback = tmnt_sprite_callback; + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + dsw1 = 0xff; + dsw2 = 0x7f; + dsw3 = 0xff; + K052109_callback = tmnt_tile_callback; + K051960_callback = punkshot_sprite_callback; + break; + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + dsw1 = 0x5e; + dsw2 = 0xff; + dsw3 = 0xfd; + K052109_callback = tmnt_tile_callback; + K053245_callback = lgtnfght_sprite_callback; + break; + case "blswhstl": + case "blswhstla": + case "detatwin": + bytee = 0xfe; + K052109_callback = blswhstl_tile_callback; + K053245_callback = blswhstl_sprite_callback; + break; + case "glfgreat": + case "glfgreatj": + dsw1 = 0xff; + dsw2 = 0x59; + dsw3 = 0xf7; + K052109_callback = tmnt_tile_callback; + K053245_callback = lgtnfght_sprite_callback; + break; + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + K052109_callback = tmnt_tile_callback; + K053245_callback = lgtnfght_sprite_callback; + break; + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + bytee = 0xfe; + K052109_callback = tmnt_tile_callback; + K051960_callback = thndrx2_sprite_callback; + break; + case "prmrsocr": + case "prmrsocrj": + K052109_callback = tmnt_tile_callback; + K053245_callback = prmrsocr_sprite_callback; + break; + } + } + } + public static void cuebrick_irq_handler(int irq) + { + cuebrick_snd_irqlatch = irq; + } + public static void konami68000_ym2151_irq_handler(int irq) + { + + } + public static ushort K052109_word_noA12_r(int offset) + { + int offset1 = ((offset & 0x3000) >> 1) | (offset & 0x07ff); + return K052109_word_r(offset1); + } + public static void K052109_word_noA12_w(int offset, ushort data) + { + int offset1; + offset1 = ((offset & 0x3000) >> 1) | (offset & 0x07ff); + K052109_word_w(offset1, data); + } + public static void K052109_word_noA12_w1(int offset, byte data) + { + int offset1; + offset1 = ((offset & 0x3000) >> 1) | (offset & 0x07ff); + K052109_w(offset1, data); + } + public static void K052109_word_noA12_w2(int offset, byte data) + { + int offset1; + offset1 = ((offset & 0x3000) >> 1) | (offset & 0x07ff); + K052109_w(offset1 + 0x2000, data); + } + public static void punkshot_K052109_word_w(int offset, ushort data) + { + //if (ACCESSING_BITS_8_15) + K052109_w(offset, (byte)((data >> 8) & 0xff)); + //else if (ACCESSING_BITS_0_7) + K052109_w(offset + 0x2000, (byte)(data & 0xff)); + } + public static void punkshot_K052109_word_w1(int offset, byte data) + { + K052109_w(offset, data); + } + public static void punkshot_K052109_word_w2(int offset, byte data) + { + K052109_w(offset + 0x2000, data); + } + public static void punkshot_K052109_word_noA12_w(int offset, ushort data) + { + offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); + punkshot_K052109_word_w(offset, data); + } + public static void punkshot_K052109_word_noA12_w1(int offset, byte data) + { + offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); + punkshot_K052109_word_w1(offset, data); + } + public static void punkshot_K052109_word_noA12_w2(int offset, byte data) + { + offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); + punkshot_K052109_word_w2(offset, data); + } + public static ushort K053245_scattered_word_r(int offset) + { + ushort result; + if ((offset & 0x0031) != 0) + { + result = Generic.spriteram16[offset]; + } + else + { + offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3); + result = K053245_word_r(offset); + } + return result; + } + + + public static void K053245_scattered_word_w(int offset, ushort data) + { + Generic.spriteram16[offset] = data; + if ((offset & 0x0031) == 0) + { + offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3); + K053245_word_w(offset, data); + } + } + public static void K053245_scattered_word_w1(int offset, byte data) + { + Generic.spriteram16[offset] = (ushort)((data << 8) | (Generic.spriteram16[offset] & 0xff)); + if ((offset & 0x0031) == 0) + { + offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3); + //K053245_word_w(offset, data); + K053245_ram[0][offset * 2] = data; + } + } + public static void K053245_scattered_word_w2(int offset, byte data) + { + Generic.spriteram16[offset] = (ushort)((Generic.spriteram16[offset] & 0xff00) | data); + if ((offset & 0x0031) == 0) + { + offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3); + //K053245_word_w(offset, data); + K053245_ram[0][offset * 2 + 1] = data; + } + } + + public static ushort K053244_word_noA1_r(int offset) + { + offset &= ~1; + return (ushort)(K053244_r(offset + 1) | (K053244_r(offset) << 8)); + } + public static void K053244_word_noA1_w(int offset, ushort data) + { + offset &= ~1; + //if (ACCESSING_BITS_8_15) + K053244_w(offset, (byte)((data >> 8) & 0xff)); + //if (ACCESSING_BITS_0_7) + K053244_w(offset + 1, (byte)(data & 0xff)); + } + public static void K053244_word_noA1_w1(int offset, byte data) + { + offset &= ~1; + K053244_w(offset, (byte)(data & 0xff)); + } + public static void K053244_word_noA1_w2(int offset, byte data) + { + offset &= ~1; + K053244_w(offset + 1, (byte)(data & 0xff)); + } + public static void cuebrick_interrupt() + { + switch (Cpuexec.iloops) + { + case 0: + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + break; + default: + if (cuebrick_snd_irqlatch != 0) + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + break; + } + } + public static void punkshot_interrupt() + { + if (K052109_is_IRQ_enabled() != 0) + { + Generic.irq4_line_hold(0); + } + } + public static void lgtnfght_interrupt() + { + if (K052109_is_IRQ_enabled() != 0) + { + Generic.irq5_line_hold(0); + } + } + public static void tmnt_sound_command_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + Sound.soundlatch_w((ushort)(data & 0xff)); + } + public static void tmnt_sound_command_w2(byte data) + { + //if (ACCESSING_BITS_0_7) + Sound.soundlatch_w((ushort)(data & 0xff)); + } + public static ushort punkshot_sound_r(int offset) + { + return K053260.k053260_0_r(2 + offset); + } + public static ushort blswhstl_sound_r(int offset) + { + return K053260.k053260_0_r(2 + offset); + } + public static ushort glfgreat_sound_r(int offset) + { + return (ushort)(K053260.k053260_0_r(2 + offset) << 8); + } + public static byte glfgreat_sound_r1(int offset) + { + return K053260.k053260_0_r(2 + offset); + } + public static void glfgreat_sound_w(int offset, ushort data) + { + //if (ACCESSING_BITS_8_15) + K053260.k053260_0_w(offset, (byte)((data >> 8) & 0xff)); + if (offset != 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + } + public static void glfgreat_sound_w1(int offset, byte data) + { + K053260.k053260_0_w(offset, data); + if (offset != 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + } + public static void glfgreat_sound_w2(int offset, byte data) + { + if (offset != 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + } + public static ushort prmrsocr_sound_r() + { + return Sound.soundlatch3_r(); + } + public static void prmrsocr_sound_cmd_w(int offset, ushort data) + { + //if (ACCESSING_BITS_0_7) + { + data &= 0xff; + if (offset == 0) + { + Sound.soundlatch_w(data); + } + else + { + Sound.soundlatch2_w(data); + } + } + } + public static void prmrsocr_sound_cmd_w2(int offset, byte data) + { + data &= 0xff; + if (offset == 0) + { + Sound.soundlatch_w(data); + } + else + { + Sound.soundlatch2_w(data); + } + } + public static void prmrsocr_sound_irq_w() + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + public static void prmrsocr_audio_bankswitch_w(byte data) + { + basebanksnd = 0x10000 + (data & 7) * 0x4000; + } + public static ushort tmnt2_sound_r(int offset) + { + return K053260.k053260_0_r(2 + offset); + } + public static byte tmnt_sres_r() + { + return (byte)tmnt_soundlatch; + } + public static void tmnt_sres_w(byte data) + { + Upd7759.upd7759_reset_w(0, (byte)(data & 2)); + if ((data & 0x04) != 0) + { + if (Sample.sample_playing(0) == 0) + { + Sample.sample_start_raw(0, sampledata, 0x40000, 20000, 0); + } + } + else + { + Sample.sample_stop(0); + } + tmnt_soundlatch = data; + } + public static void tmnt_decode_sample() + { + int i; + sampledata_set = new short[0x40000]; + for (i = 0; i < 0x40000; i++) + { + int val = titlerom[2 * i] + titlerom[2 * i + 1] * 256; + int expo = val >> 13; + val = (val >> 3) & (0x3ff); + val -= 0x200; + val <<= (expo - 3); + sampledata[i] = (short)val; + } + } + public static void nmi_callback() + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.ASSERT_LINE); + } + public static void sound_arm_nmi_w() + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.CLEAR_LINE); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Konami68000_nmi_callback, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)50e12), Attotime.ATTOTIME_NEVER); + } + public static ushort punkshot_kludge_r() + { + return 0; + } + public static byte punkshot_kludge_r1() + { + return 0; + } + public static ushort ssriders_protection_r() + { + int data = (ushort)MC68000.m1.ReadWord(0x105a0a); + int cmd = (ushort)MC68000.m1.ReadWord(0x1058fc); + ushort result; + switch (cmd) + { + case 0x100b: + result = 0x0064; + break; + case 0x6003: + result = (ushort)(data & 0x000f); + break; + case 0x6004: + result = (ushort)(data & 0x001f); + break; + case 0x6000: + result = (ushort)(data & 0x0001); + break; + case 0x0000: + result = (ushort)(data & 0x00ff); + break; + case 0x6007: + result = (ushort)(data & 0x00ff); + break; + case 0x8abc: + data = -(ushort)MC68000.m1.ReadWord(0x105818); + data = ((data / 8 - 4) & 0x1f) * 0x40; + data += (((ushort)MC68000.m1.ReadWord(0x105cb0) + 256 * K052109_r(0x1a01) + K052109_r(0x1a00) - 6) / 8 + 12) & 0x3f; + result = (ushort)data; + break; + default: + result = 0xffff; + break; + } + return result; + } + public static void ssriders_protection_w(int offset) + { + if (offset == 1) + { + int logical_pri, hardware_pri; + hardware_pri = 1; + for (logical_pri = 1; logical_pri < 0x100; logical_pri <<= 1) + { + int i; + + for (i = 0; i < 128; i++) + { + if (((ushort)MC68000.m1.ReadWord(0x180006 + 128 * i) >> 8) == logical_pri) + { + K053245_word_w2(8 * i, (ushort)hardware_pri); + hardware_pri++; + } + } + } + } + } + public static byte getbytee() + { + byte result; + if (Video.video_screen_get_vblank()) + { + result = 0xfe; + } + else + { + result = 0xf6; + } + return result; + } + public static ushort blswhstl_coin_r() + { + int res; + res = sbyte0; + if (init_eeprom_count != 0) + { + init_eeprom_count--; + res &= 0xf7; + } + toggle ^= 0x40; + return (ushort)(res ^ toggle); + } + public static ushort blswhstl_eeprom_r() + { + int res; + res = Eeprom.eeprom_read_bit() | bytee; + return (ushort)res; + } + + public static ushort ssriders_eeprom_r() + { + int res; + res = (Eeprom.eeprom_read_bit() | getbytee()); + if (init_eeprom_count != 0) + { + init_eeprom_count--; + res &= 0x7f; + } + toggle ^= 0x04; + return (ushort)(res ^ toggle); + } + public static void blswhstl_eeprom_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + Eeprom.eeprom_write_bit(data & 0x01); + Eeprom.eeprom_set_cs_line((data & 0x02) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x04) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void blswhstl_eeprom_w2(byte data) + { + Eeprom.eeprom_write_bit(data & 0x01); + Eeprom.eeprom_set_cs_line((data & 0x02) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x04) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void ssriders_eeprom_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + Eeprom.eeprom_write_bit(data & 0x01); + Eeprom.eeprom_set_cs_line((data & 0x02) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x04) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + dim_c = data & 0x18; + K053244_bankselect(0, ((data & 0x20) >> 5) << 2); + } + } + public static void ssriders_eeprom_w2(byte data) + { + //if (ACCESSING_BITS_0_7) + { + Eeprom.eeprom_write_bit(data & 0x01); + Eeprom.eeprom_set_cs_line((data & 0x02) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x04) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + dim_c = data & 0x18; + K053244_bankselect(0, ((data & 0x20) >> 5) << 2); + } + } + public static ushort thndrx2_in0_r() + { + ushort res; + res = (ushort)((((byte)sbyte0) << 8) | (byte)sbyte1); + if (init_eeprom_count != 0) + { + init_eeprom_count--; + res &= 0xf7ff; + } + return res; + } + public static ushort thndrx2_eeprom_r() + { + int res; + res = (Eeprom.eeprom_read_bit() << 8) | (ushort)((bytee << 8) | (byte)sbyte2); + toggle ^= 0x0800; + return (ushort)(res ^ toggle); + } + public static void thndrx2_eeprom_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + Eeprom.eeprom_write_bit(data & 0x01); + Eeprom.eeprom_set_cs_line((data & 0x02) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x04) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + if (last == 0 && (data & 0x20) != 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + //cpunum_set_input_line_and_vector(machine, 1, 0, LineState.HOLD_LINE, 0xff); + } + last = data & 0x20; + K052109_set_RMRD_line((data & 0x40) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void thndrx2_eeprom_w2(byte data) + { + Eeprom.eeprom_write_bit(data & 0x01); + Eeprom.eeprom_set_cs_line((data & 0x02) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x04) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + if (last == 0 && (data & 0x20) != 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + last = data & 0x20; + K052109_set_RMRD_line((data & 0x40) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static ushort prmrsocr_IN0_r() + { + ushort res; + res = (ushort)((sbyte0 << 8) | (byte)sbyte1); + if (init_eeprom_count != 0) + { + init_eeprom_count--; + res &= 0xfdff; + } + return res; + } + public static ushort prmrsocr_eeprom_r() + { + return (ushort)((Eeprom.eeprom_read_bit() << 8) | ((ushort)(bytee << 8) | (byte)sbyte2)); + } + public static void prmrsocr_eeprom_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + prmrsocr_122000_w(data); + } + //if (ACCESSING_BITS_8_15) + { + Eeprom.eeprom_write_bit(data & 0x0100); + Eeprom.eeprom_set_cs_line((data & 0x0200) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x0400) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void prmrsocr_eeprom_w1(byte data) + { + Eeprom.eeprom_write_bit((data & 0x01) << 8); + Eeprom.eeprom_set_cs_line((data & 0x02) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Eeprom.eeprom_set_clock_line((data & 0x04) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void prmrsocr_eeprom_w2(byte data) + { + prmrsocr_122000_w2(data); + } + public static ushort cuebrick_snd_r() + { + return (ushort)(YM2151.ym2151_status_port_0_r() << 8); + } + public static byte cuebrick_snd_r1() + { + return YM2151.ym2151_status_port_0_r(); + } + public static void cuebrick_snd_w(int offset, ushort data) + { + if (offset != 0) + { + YM2151.ym2151_data_port_0_w((byte)(data >> 8)); + } + else + { + YM2151.ym2151_register_port_0_w((byte)(data >> 8)); + } + } + public static void cuebrick_snd_w1(int offset, byte data) + { + if (offset != 0) + { + YM2151.ym2151_data_port_0_w(data); + } + else + { + YM2151.ym2151_register_port_0_w(data); + } + } + public static void cuebrick_snd_w2(int offset, byte data) + { + if (offset != 0) + { + YM2151.ym2151_data_port_0_w(0); + } + else + { + YM2151.ym2151_register_port_0_w(0); + } + } + public static ushort cuebrick_nv_r(int offset) + { + return cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)]; + } + public static byte cuebrick_nv_r1(int offset) + { + return (byte)(cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)] >> 8); + } + public static byte cuebrick_nv_r2(int offset) + { + return (byte)cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)]; + } + public static void cuebrick_nv_w(int offset, ushort data) + { + cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)] = data; + } + public static void cuebrick_nv_w1(int offset, byte data) + { + cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)] = (ushort)((data << 8) | (cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)] & 0xff)); + } + public static void cuebrick_nv_w2(int offset, byte data) + { + cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)] = (ushort)((cuebrick_nvram[offset + (cuebrick_nvram_bank * 0x400 / 2)] & 0xff00) | data); + } + + public static void cuebrick_nvbank_w(ushort data) + { + cuebrick_nvram_bank = (data >> 8); + } + public static void cuebrick_nvbank_w1(byte data) + { + cuebrick_nvram_bank = data; + } + public static void cuebrick_nvbank_w2(byte data) + { + cuebrick_nvram_bank = 0; + } + + public static void ssriders_soundkludge_w() + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + public unsafe static byte tmnt2_get_byte(int addr) + { + byte result = 0; + if (addr <= 0x07ffff) + { + result = Memory.mainrom[addr]; + } + else if (addr >= 0x104000 && addr <= 0x107fff) + { + int offset = addr - 0x104000; + result = Memory.mainram[offset]; + } + else if (addr >= 0x180000 && addr <= 0x183fff) + { + int offset = (addr - 0x180000) / 2; + if (addr % 2 == 0) + { + result = (byte)(Generic.spriteram16[offset] >> 8); + } + else + { + result = (byte)Generic.spriteram16[offset]; + } + } + return result; + } + public unsafe static ushort tmnt2_get_word(int addr) + { + ushort result = 0; + addr *= 2; + if (addr <= 0x07ffff) + { + result = (ushort)(Memory.mainrom[addr] * 0x100 + Memory.mainrom[addr + 1]); + } + else if (addr >= 0x104000 && addr <= 0x107fff) + { + int offset = addr - 0x104000; + result = (ushort)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (addr >= 0x180000 && addr <= 0x183fff) + { + int offset = (addr - 0x180000) / 2; + result = Generic.spriteram16[offset]; + } + return result; + } + public unsafe static void tmnt2_put_word(int addr, ushort data) + { + addr *= 2; + if (addr >= 0x180000 && addr <= 0x183fff) + { + int offset = (addr - 0x180000) / 2; + Generic.spriteram16[offset] = data; + if ((offset & 0x0031) == 0) + { + int offset2; + offset2 = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3); + K053245_word_w(offset2, data); + if (K053245_ram[0][2] == 0x11 && K053245_ram[0][3] == 0x80) + { + int i1 = 1; + } + } + } + else if (addr >= 0x104000 && addr <= 0x107fff) + { + int offset = (addr - 0x104000) / 2; + Memory.mainram[offset] = (byte)(data >> 8); + Memory.mainram[offset + 1] = (byte)data; + } + } + public static void tmnt2_1c0800_w(int offset, ushort data) + { + int src_addr, dst_addr, mod_addr, attr1, code, attr2, cbase, cmod, color; + int xoffs, yoffs, xmod, ymod, zmod, xzoom, yzoom, i; + ushort[] src, mod; + src = new ushort[4]; + mod = new ushort[24]; + byte keepaspect, xlock, ylock, zlock; + tmnt2_1c0800[offset] = data; + if (offset != 0x18 / 2)// || !ACCESSING_BITS_8_15) + { + return; + } + if ((tmnt2_1c0800[8] & 0xff00) != 0x8200) + { + return; + } + src_addr = (tmnt2_1c0800[0] | (tmnt2_1c0800[1] & 0xff) << 16) >> 1; + dst_addr = (tmnt2_1c0800[2] | (tmnt2_1c0800[3] & 0xff) << 16) >> 1; + mod_addr = (tmnt2_1c0800[4] | (tmnt2_1c0800[5] & 0xff) << 16) >> 1; + zlock = (byte)(((tmnt2_1c0800[8] & 0xff) == 0x0001) ? 1 : 0); + for (i = 0; i < 4; i++) + { + src[i] = tmnt2_get_word(src_addr + i); + } + for (i = 0; i < 24; i++) + { + mod[i] = tmnt2_get_word(mod_addr + i); + } + code = src[0]; + i = src[1]; + attr1 = i >> 2 & 0x3f00; + attr2 = i & 0x380; + cbase = i & 0x01f; + cmod = mod[0x2a / 2] >> 8; + color = (cbase != 0x0f && cmod <= 0x1f && zlock == 0) ? cmod : cbase; + xoffs = (short)src[2]; + yoffs = (short)src[3]; + i = mod[0]; + attr2 |= i & 0x0060; + keepaspect = (byte)(((i & 0x0014) == 0x0014) ? 1 : 0); + if ((i & 0x8000) != 0) + { + attr1 |= 0x8000; + } + if (keepaspect != 0) + { + attr1 |= 0x4000; + } + if ((i & 0x4000) != 0) + { + attr1 ^= 0x1000; xoffs = -xoffs; + } + xmod = (short)mod[6]; + ymod = (short)mod[7]; + zmod = (short)mod[8]; + xzoom = mod[0x1c / 2]; + yzoom = (keepaspect != 0) ? xzoom : mod[0x1e / 2]; + ylock = xlock = (byte)(((i & 0x0020) != 0 && (xzoom == 0 || xzoom == 0x100)) ? 1 : 0); + if (xlock == 0) + { + i = xzoom - 0x4f00; + if (i > 0) + { + i >>= 8; + xoffs += (int)(Math.Pow(i, 1.891292) * xoffs / 599.250121); + } + else if (i < 0) + { + i = (i >> 3) + (i >> 4) + (i >> 5) + (i >> 6) + xzoom; + xoffs = (i > 0) ? (xoffs * i / 0x4f00) : 0; + } + } + if (ylock == 0) + { + i = yzoom - 0x4f00; + if (i > 0) + { + i >>= 8; + yoffs += (int)(Math.Pow(i, /*1.898461*/1.891292) * yoffs / 599.250121); + } + else if (i < 0) + { + i = (i >> 3) + (i >> 4) + (i >> 5) + (i >> 6) + yzoom; + yoffs = (i > 0) ? (yoffs * i / 0x4f00) : 0; + } + } + if (zlock == 0) + { + yoffs += zmod; + } + xoffs += xmod; + yoffs += ymod; + tmnt2_put_word(dst_addr + 0, (ushort)attr1); + tmnt2_put_word(dst_addr + 2, (ushort)code); + tmnt2_put_word(dst_addr + 4, (ushort)yoffs); + tmnt2_put_word(dst_addr + 6, (ushort)xoffs); + tmnt2_put_word(dst_addr + 12, (ushort)(attr2 | color)); + } + public static void tmnt2_1c0800_w1(int offset, byte data) + { + int src_addr, dst_addr, mod_addr, attr1, code, attr2, cbase, cmod, color; + int xoffs, yoffs, xmod, ymod, zmod, xzoom, yzoom, i; + ushort[] src, mod; + src = new ushort[4]; + mod = new ushort[24]; + byte keepaspect, xlock, ylock, zlock; + tmnt2_1c0800[offset] = (ushort)((data << 8) | (tmnt2_1c0800[offset] & 0xff)); + if (offset != 0x18 / 2) + { + return; + } + if ((tmnt2_1c0800[8] & 0xff00) != 0x8200) + { + return; + } + src_addr = (tmnt2_1c0800[0] | (tmnt2_1c0800[1] & 0xff) << 16) >> 1; + dst_addr = (tmnt2_1c0800[2] | (tmnt2_1c0800[3] & 0xff) << 16) >> 1; + mod_addr = (tmnt2_1c0800[4] | (tmnt2_1c0800[5] & 0xff) << 16) >> 1; + zlock = (byte)(((tmnt2_1c0800[8] & 0xff) == 0x0001) ? 1 : 0); + for (i = 0; i < 4; i++) + { + src[i] = tmnt2_get_word(src_addr + i); + } + for (i = 0; i < 24; i++) + { + mod[i] = tmnt2_get_word(mod_addr + i); + } + code = src[0]; + i = src[1]; + attr1 = i >> 2 & 0x3f00; + attr2 = i & 0x380; + cbase = i & 0x01f; + cmod = mod[0x2a / 2] >> 8; + color = (cbase != 0x0f && cmod <= 0x1f && zlock == 0) ? cmod : cbase; + xoffs = (short)src[2]; + yoffs = (short)src[3]; + i = mod[0]; + attr2 |= i & 0x0060; + keepaspect = (byte)(((i & 0x0014) == 0x0014) ? 1 : 0); + if ((i & 0x8000) != 0) + { + attr1 |= 0x8000; + } + if (keepaspect != 0) + { + attr1 |= 0x4000; + } + if ((i & 0x4000) != 0) + { + attr1 ^= 0x1000; xoffs = -xoffs; + } + xmod = (short)mod[6]; + ymod = (short)mod[7]; + zmod = (short)mod[8]; + xzoom = mod[0x1c / 2]; + yzoom = (keepaspect != 0) ? xzoom : mod[0x1e / 2]; + ylock = xlock = (byte)(((i & 0x0020) != 0 && (xzoom == 0 || xzoom == 0x100)) ? 1 : 0); + if (xlock == 0) + { + i = xzoom - 0x4f00; + if (i > 0) + { + i >>= 8; + xoffs += (int)(Math.Pow(i, 1.891292) * xoffs / 599.250121); + } + else if (i < 0) + { + i = (i >> 3) + (i >> 4) + (i >> 5) + (i >> 6) + xzoom; + xoffs = (i > 0) ? (xoffs * i / 0x4f00) : 0; + } + } + if (ylock == 0) + { + i = yzoom - 0x4f00; + if (i > 0) + { + i >>= 8; + yoffs += (int)(Math.Pow(i, /*1.898461*/1.891292) * yoffs / 599.250121); + } + else if (i < 0) + { + i = (i >> 3) + (i >> 4) + (i >> 5) + (i >> 6) + yzoom; + yoffs = (i > 0) ? (yoffs * i / 0x4f00) : 0; + } + } + if (zlock == 0) + { + yoffs += zmod; + } + xoffs += xmod; + yoffs += ymod; + tmnt2_put_word(dst_addr + 0, (ushort)attr1); + tmnt2_put_word(dst_addr + 2, (ushort)code); + tmnt2_put_word(dst_addr + 4, (ushort)yoffs); + tmnt2_put_word(dst_addr + 6, (ushort)xoffs); + tmnt2_put_word(dst_addr + 12, (ushort)(attr2 | color)); + } + public static void tmnt2_1c0800_w2(int offset, byte data) + { + tmnt2_1c0800[offset] = (ushort)((tmnt2_1c0800[offset] & 0xff00) | data); + } + public static byte k054539_0_ctrl_r(int offset) + { + return K054539.k054539_0_r(0x200 + offset); + } + public static void k054539_0_ctrl_w(int offset, byte data) + { + K054539.k054539_0_w(0x200 + offset, data); + } + public static void volume_callback(int v) + { + K007232.k007232_set_volume(0, 0, (v >> 4) * 0x11, 0); + K007232.k007232_set_volume(0, 1, 0, (v & 0x0f) * 0x11); + } + public static void sound_nmi() + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + public static void machine_reset_konami68000() + { + switch (Machine.sName) + { + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + Upd7759.upd7759_0_start_w(0); + Upd7759.upd7759_0_reset_w(1); + break; + case "prmrsocr": + case "prmrsocrj": + basebanksnd = 0; + break; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konami68000.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konami68000.cs.meta new file mode 100644 index 00000000..7196b6e5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konami68000.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7bdc20cde583d8541940a0ddfe87d984 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konamiic.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konamiic.cs new file mode 100644 index 00000000..945d3368 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konamiic.cs @@ -0,0 +1,1466 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Konami68000 + { + private static byte[] K052109_memory_region; + public static int K052109_videoram_F_offset, K052109_videoram2_F_offset, K052109_colorram_F_offset, K052109_videoram_A_offset, K052109_videoram2_A_offset, K052109_colorram_A_offset, K052109_videoram_B_offset, K052109_videoram2_B_offset, K052109_colorram_B_offset; + public static byte[] K052109_ram, K052109_charrombank, K052109_charrombank_2; + public static LineState K052109_RMRD_line; + public static byte K052109_romsubbank, K052109_scrollctrl, K052109_irq_enabled, has_extra_video_ram; + public static int[] K052109_dx, K052109_dy; + public static int K052109_tileflip_enable; + + public static byte[] K051960_memory_region; + public static int K051960_romoffset, K051960_spriteflip, K051960_readroms; + public static byte[] K051960_spriterombank, K051960_ram; + public static int K051960_dx, K051960_dy; + public static int K051960_irq_enabled, K051960_nmi_enabled; + + private static byte[][] K053245_memory_region; + private static int K05324x_z_rejection; + private static int[] K053244_rombank, K053245_ramsize, K053245_dx, K053245_dy; + public static ushort[][] K053245_buffer; + public static byte[][] K053245_ram, K053244_regs; + public static byte[] K054000_ram; + + public static ushort[] K053936_0_ctrl, K053936_0_linectrl; + public static ushort[] K053936_1_ctrl, K053936_1_linectrl; + public static int[][] K053936_offset; + public static int[] K053936_wraparound; + + public static byte[] K053251_ram; + public static int[] K053251_palette_index; + public static int K053251_tilemaps_set; + + public static int counter; + public delegate void K052109_delegate(int tmap, int bank, int code, int color, int flags, int priority, out int code2, out int color2, out int flags2); + public static K052109_delegate K052109_callback; + public delegate void K051960_delegate(int code, int color, int priority, int shadow, out int code2, out int color2, out int priority2); + public static K051960_delegate K051960_callback; + public delegate void K053245_delegate(int code, int color, out int code2, out int color2, out int priority_mask); + public static K053245_delegate K053245_callback; + public static void K052109_vh_start() + { + int i, j; + K052109_RMRD_line = LineState.CLEAR_LINE; + K052109_irq_enabled = 0; + has_extra_video_ram = 0; + K052109_tilemap = new Tmap[3]; + for (i = 0; i < 3; i++) + { + K052109_tilemap[i] = new Tmap(); + K052109_tilemap[i].tilewidth = 8; + K052109_tilemap[i].tileheight = 8; + K052109_tilemap[i].cols = 0x40; + K052109_tilemap[i].rows = 0x20; + K052109_tilemap[i].width = K052109_tilemap[i].cols * K052109_tilemap[i].tilewidth; + K052109_tilemap[i].height = K052109_tilemap[i].rows * K052109_tilemap[i].tileheight; + K052109_tilemap[i].enable = true; + K052109_tilemap[i].all_tiles_dirty = true; + } + K052109_ram = new byte[0x6000]; + K052109_colorram_F_offset = 0x0000; + K052109_colorram_A_offset = 0x0800; + K052109_colorram_B_offset = 0x1000; + K052109_videoram_F_offset = 0x2000; + K052109_videoram_A_offset = 0x2800; + K052109_videoram_B_offset = 0x3000; + K052109_videoram2_F_offset = 0x4000; + K052109_videoram2_A_offset = 0x4800; + K052109_videoram2_B_offset = 0x5000; + //tilemap_set_transparent_pen(K052109_tilemap[0],0); + //tilemap_set_transparent_pen(K052109_tilemap[1],0); + //tilemap_set_transparent_pen(K052109_tilemap[2],0); + K052109_tilemap[0].scrollrows = 1; + K052109_tilemap[0].scrollcols = 1; + K052109_tilemap[1].scrollrows = 256; + K052109_tilemap[2].scrollrows = 256; + K052109_tilemap[1].scrollcols = 512; + K052109_tilemap[2].scrollcols = 512; + for (i = 0; i < 3; i++) + { + K052109_tilemap[i].rowscroll = new int[K052109_tilemap[i].scrollrows]; + K052109_tilemap[i].colscroll = new int[K052109_tilemap[1].scrollcols]; + K052109_tilemap[i].tilemap_draw_instance3 = K052109_tilemap[i].tilemap_draw_instanceKonami68000; + K052109_tilemap[i].pixmap = new ushort[0x100 * 0x200]; + K052109_tilemap[i].flagsmap = new byte[0x100, 0x200]; + K052109_tilemap[i].tileflags = new byte[0x20, 0x40]; + K052109_tilemap[i].pen_data_set = new byte[0x40]; + K052109_tilemap[i].pen_to_flags = new byte[1, 16]; + K052109_tilemap[i].pen_to_flags[0, 0] = 0; + for (j = 1; j < 16; j++) + { + K052109_tilemap[i].pen_to_flags[0, j] = 0x10; + } + K052109_tilemap[i].total_elements = gfx12romLength / 0x40; + } + K052109_tilemap[0].tile_update3 = K052109_tilemap[0].tile_updateKonami68000_0; + K052109_tilemap[1].tile_update3 = K052109_tilemap[1].tile_updateKonami68000_1; + K052109_tilemap[2].tile_update3 = K052109_tilemap[2].tile_updateKonami68000_2; + for (i = 0; i < 3; i++) + { + K052109_dx[i] = K052109_dy[i] = 0; + } + } + public static byte K052109_r(int offset) + { + if (K052109_RMRD_line == LineState.CLEAR_LINE) + { + return K052109_ram[offset]; + } + else + { + int code = (offset & 0x1fff) >> 5; + int color = K052109_romsubbank; + int code2, color2, flags2; + int flags = 0; + int priority = 0; + int bank = K052109_charrombank[(color & 0x0c) >> 2] >> 2; + int addr; + bank |= (K052109_charrombank_2[(color & 0x0c) >> 2] >> 2); + if (has_extra_video_ram != 0) + { + code |= color << 8; + } + else + { + K052109_callback(0, bank, code, color, flags, priority, out code2, out color2, out flags2); + code = code2; + color = color2; + } + addr = (code << 5) + (offset & 0x1f); + addr &= K052109_memory_region.Length - 1; + return K052109_memory_region[addr]; + } + } + public static void K052109_w(int offset, byte data) + { + int row, col; + if (offset == 0x90d) + { + int i1 = 1; + } + if (offset == 0x290d) + { + int i1 = 1; + } + if ((offset & 0x1fff) < 0x1800) + { + if (offset >= 0x4000) + { + has_extra_video_ram = 1; + } + K052109_ram[offset] = data; + row = (offset & 0x7ff) / 0x40; + col = (offset & 0x7ff) % 0x40; + K052109_tilemap[(offset & 0x1800) >> 11].tilemap_mark_tile_dirty(row, col); + //tilemap_mark_tile_dirty(K052109_tilemap[(offset & 0x1800) >> 11], offset & 0x7ff); + } + else + { + K052109_ram[offset] = data; + if (offset >= 0x180c && offset < 0x1834) + { + + } + else if (offset >= 0x1a00 && offset < 0x1c00) + { + + } + else if (offset == 0x1c80) + { + if (K052109_scrollctrl != data) + { + K052109_scrollctrl = data; + } + } + else if (offset == 0x1d00) + { + K052109_irq_enabled = (byte)(data & 0x04); + } + else if (offset == 0x1d80) + { + int dirty = 0; + if (K052109_charrombank[0] != (data & 0x0f)) dirty |= 1; + if (K052109_charrombank[1] != ((data >> 4) & 0x0f)) dirty |= 2; + if (dirty != 0) + { + int i; + K052109_charrombank[0] = (byte)(data & 0x0f); + K052109_charrombank[1] = (byte)((data >> 4) & 0x0f); + for (i = 0; i < 0x1800; i++) + { + int bank = (K052109_ram[i] & 0x0c) >> 2; + if ((bank == 0 && ((dirty & 1) != 0) || (bank == 1 && ((dirty & 2) != 0)))) + { + row = (i & 0x7ff) / 0x40; + col = (i & 0x7ff) % 0x40; + K052109_tilemap[(i & 0x1800) >> 11].tilemap_mark_tile_dirty(row, col); + //tilemap_mark_tile_dirty(K052109_tilemap[(i & 0x1800) >> 11], i & 0x7ff); + } + } + } + } + else if (offset == 0x1e00 || offset == 0x3e00) + { + K052109_romsubbank = data; + } + else if (offset == 0x1e80) + { + //tilemap_set_flip(K052109_tilemap[0], (data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + //tilemap_set_flip(K052109_tilemap[1], (data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + //tilemap_set_flip(K052109_tilemap[2], (data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + if (K052109_tileflip_enable != ((data & 0x06) >> 1)) + { + K052109_tileflip_enable = ((data & 0x06) >> 1); + K052109_tilemap[0].all_tiles_dirty = true; + K052109_tilemap[1].all_tiles_dirty = true; + K052109_tilemap[2].all_tiles_dirty = true; + } + } + else if (offset == 0x1f00) + { + int dirty = 0; + if (K052109_charrombank[2] != (data & 0x0f)) dirty |= 1; + if (K052109_charrombank[3] != ((data >> 4) & 0x0f)) dirty |= 2; + if (dirty != 0) + { + int i; + K052109_charrombank[2] = (byte)(data & 0x0f); + K052109_charrombank[3] = (byte)((data >> 4) & 0x0f); + for (i = 0; i < 0x1800; i++) + { + int bank = (K052109_ram[i] & 0x0c) >> 2; + if ((bank == 2 && ((dirty & 1) != 0)) || (bank == 3 && ((dirty & 2) != 0))) + { + row = (i & 0x7ff) / 0x40; + col = (i & 0x7ff) % 0x40; + K052109_tilemap[(i & 0x1800) >> 11].tilemap_mark_tile_dirty(row, col); + //tilemap_mark_tile_dirty(K052109_tilemap[(i & 0x1800) >> 11], i & 0x7ff); + } + } + } + } + else if (offset >= 0x380c && offset < 0x3834) + { + + } + else if (offset >= 0x3a00 && offset < 0x3c00) + { + + } + else if (offset == 0x3d80) + { + K052109_charrombank_2[0] = (byte)(data & 0x0f); + K052109_charrombank_2[1] = (byte)((data >> 4) & 0x0f); + } + else if (offset == 0x3f00) + { + K052109_charrombank_2[2] = (byte)(data & 0x0f); + K052109_charrombank_2[3] = (byte)((data >> 4) & 0x0f); + } + } + } + public static ushort K052109_word_r(int offset) + { + return (ushort)(K052109_r(offset + 0x2000) | (K052109_r(offset) << 8)); + } + public static void K052109_word_w(int offset, ushort data) + { + K052109_w(offset, (byte)((data >> 8) & 0xff)); + K052109_w(offset + 0x2000, (byte)(data & 0xff)); + } + public static void K052109_word_w1(int offset, byte data) + { + K052109_w(offset, data); + } + public static void K052109_word_w2(int offset, byte data) + { + K052109_w(offset + 0x2000, data); + } + public static void K052109_set_RMRD_line(LineState state) + { + K052109_RMRD_line = state; + } + public static int K052109_get_RMRD_line() + { + return (int)K052109_RMRD_line; + } + public static void K052109_tilemap_update() + { + if ((K052109_scrollctrl & 0x03) == 0x02) + { + int xscroll, yscroll, offs; + int scrollram_offset = 0x1a00; + K052109_tilemap[1].tilemap_set_scroll_rows(256); + K052109_tilemap[1].tilemap_set_scroll_cols(1); + yscroll = K052109_ram[0x180c]; + K052109_tilemap[1].tilemap_set_scrolly(0, yscroll + K052109_dy[1]); + for (offs = 0; offs < 256; offs++) + { + xscroll = K052109_ram[scrollram_offset + 2 * (offs & 0xfff8) + 0] + 256 * K052109_ram[scrollram_offset + 2 * (offs & 0xfff8) + 1]; + xscroll -= 6; + K052109_tilemap[1].tilemap_set_scrollx((offs + yscroll) & 0xff, xscroll + K052109_dx[1]); + } + } + else if ((K052109_scrollctrl & 0x03) == 0x03) + { + int xscroll, yscroll, offs; + int scrollram_offset = 0x1a00; + K052109_tilemap[1].tilemap_set_scroll_rows(256); + K052109_tilemap[1].tilemap_set_scroll_cols(1); + yscroll = K052109_ram[0x180c]; + K052109_tilemap[1].tilemap_set_scrolly(0, yscroll + K052109_dy[1]); + for (offs = 0; offs < 256; offs++) + { + xscroll = K052109_ram[scrollram_offset + 2 * offs + 0] + 256 * K052109_ram[scrollram_offset + 2 * offs + 1]; + xscroll -= 6; + K052109_tilemap[1].tilemap_set_scrollx((offs + yscroll) & 0xff, xscroll + K052109_dx[1]); + } + } + else if ((K052109_scrollctrl & 0x04) == 0x04) + { + int xscroll, yscroll, offs; + int scrollram_offset = 0x1800; + K052109_tilemap[1].tilemap_set_scroll_rows(1); + K052109_tilemap[1].tilemap_set_scroll_cols(512); + xscroll = K052109_ram[0x1a00] + 256 * K052109_ram[0x1a01]; + xscroll -= 6; + K052109_tilemap[1].tilemap_set_scrollx(0, xscroll + K052109_dx[1]); + for (offs = 0; offs < 512; offs++) + { + yscroll = K052109_ram[scrollram_offset + offs / 8]; + K052109_tilemap[1].tilemap_set_scrolly((offs + xscroll) & 0x1ff, yscroll + K052109_dy[1]); + } + } + else + { + int xscroll, yscroll; + int scrollram_offset = 0x1a00; + K052109_tilemap[1].tilemap_set_scroll_rows(1); + K052109_tilemap[1].tilemap_set_scroll_cols(1); + xscroll = K052109_ram[scrollram_offset + 0] + 256 * K052109_ram[scrollram_offset + 1]; + xscroll -= 6; + yscroll = K052109_ram[0x180c]; + K052109_tilemap[1].tilemap_set_scrollx(0, xscroll + K052109_dx[1]); + K052109_tilemap[1].tilemap_set_scrolly(0, yscroll + K052109_dy[1]); + } + if ((K052109_scrollctrl & 0x18) == 0x10) + { + int xscroll, yscroll, offs; + int scrollram_offset = 0x3a00; + K052109_tilemap[2].tilemap_set_scroll_rows(256); + K052109_tilemap[2].tilemap_set_scroll_cols(1); + yscroll = K052109_ram[0x380c]; + K052109_tilemap[2].tilemap_set_scrolly(0, yscroll + K052109_dy[2]); + for (offs = 0; offs < 256; offs++) + { + xscroll = K052109_ram[scrollram_offset + 2 * (offs & 0xfff8) + 0] + 256 * K052109_ram[scrollram_offset + 2 * (offs & 0xfff8) + 1]; + xscroll -= 6; + K052109_tilemap[2].tilemap_set_scrollx((offs + yscroll) & 0xff, xscroll + K052109_dx[2]); + } + } + else if ((K052109_scrollctrl & 0x18) == 0x18) + { + int xscroll, yscroll, offs; + int scrollram_offset = 0x3a00; + K052109_tilemap[2].tilemap_set_scroll_rows(256); + K052109_tilemap[2].tilemap_set_scroll_cols(1); + yscroll = K052109_ram[0x380c]; + K052109_tilemap[2].tilemap_set_scrolly(0, yscroll + K052109_dy[2]); + for (offs = 0; offs < 256; offs++) + { + xscroll = K052109_ram[scrollram_offset + 2 * offs + 0] + 256 * K052109_ram[scrollram_offset + 2 * offs + 1]; + xscroll -= 6; + K052109_tilemap[2].tilemap_set_scrollx((offs + yscroll) & 0xff, xscroll + K052109_dx[2]); + } + } + else if ((K052109_scrollctrl & 0x20) == 0x20) + { + int xscroll, yscroll, offs; + int scrollram_offset = 0x3800; + K052109_tilemap[2].tilemap_set_scroll_rows(1); + K052109_tilemap[2].tilemap_set_scroll_cols(512); + xscroll = K052109_ram[0x3a00] + 256 * K052109_ram[0x3a01]; + xscroll -= 6; + K052109_tilemap[2].tilemap_set_scrollx(0, xscroll + K052109_dx[2]); + for (offs = 0; offs < 512; offs++) + { + yscroll = K052109_ram[scrollram_offset + offs / 8]; + K052109_tilemap[2].tilemap_set_scrolly((offs + xscroll) & 0x1ff, yscroll + K052109_dy[2]); + } + } + else + { + int xscroll, yscroll; + int scrollram_offset = 0x3a00; + K052109_tilemap[2].tilemap_set_scroll_rows(1); + K052109_tilemap[2].tilemap_set_scroll_cols(1); + xscroll = K052109_ram[scrollram_offset + 0] + 256 * K052109_ram[scrollram_offset + 1]; + xscroll -= 6; + yscroll = K052109_ram[0x380c]; + K052109_tilemap[2].tilemap_set_scrollx(0, xscroll + K052109_dx[2]); + K052109_tilemap[2].tilemap_set_scrolly(0, yscroll + K052109_dy[2]); + } + } + public static int K052109_is_IRQ_enabled() + { + return K052109_irq_enabled; + } + public static void SaveStateBinary_K052109(BinaryWriter writer) + { + int i; + writer.Write(K052109_ram, 0, 0x6000); + writer.Write((int)K052109_RMRD_line); + writer.Write(K052109_romsubbank); + writer.Write(K052109_scrollctrl); + writer.Write(K052109_irq_enabled); + writer.Write(K052109_charrombank, 0, 4); + writer.Write(K052109_charrombank_2, 0, 4); + for (i = 0; i < 3; i++) + { + writer.Write(K052109_dx[i]); + } + for (i = 0; i < 3; i++) + { + writer.Write(K052109_dy[i]); + } + writer.Write(has_extra_video_ram); + writer.Write(K052109_tileflip_enable); + } + public static void LoadStateBinary_K052109(BinaryReader reader) + { + int i; + K052109_ram = reader.ReadBytes(0x6000); + K052109_RMRD_line = (LineState)reader.ReadInt32(); + K052109_romsubbank = reader.ReadByte(); + K052109_scrollctrl = reader.ReadByte(); + K052109_irq_enabled = reader.ReadByte(); + K052109_charrombank = reader.ReadBytes(4); + K052109_charrombank_2 = reader.ReadBytes(4); + for (i = 0; i < 3; i++) + { + K052109_dx[i] = reader.ReadInt32(); + } + for (i = 0; i < 3; i++) + { + K052109_dy[i] = reader.ReadInt32(); + } + has_extra_video_ram = reader.ReadByte(); + K052109_tileflip_enable = reader.ReadInt32(); + } + public static void LoadStateBinary_K052109_2(BinaryReader reader) + { + int i; + reader.ReadBytes(0x6000); + reader.ReadInt32(); + reader.ReadByte(); + reader.ReadByte(); + reader.ReadByte(); + reader.ReadBytes(4); + reader.ReadBytes(4); + for (i = 0; i < 3; i++) + { + reader.ReadInt32(); + } + for (i = 0; i < 3; i++) + { + reader.ReadInt32(); + } + reader.ReadByte(); + reader.ReadInt32(); + } + public static void K051960_vh_start() + { + K051960_dx = K051960_dy = 0; + K051960_ram = new byte[0x400]; + K051960_spriterombank = new byte[3]; + } + public static byte K051960_fetchromdata(int byte1) + { + int code, color, pri, shadow, off1, addr, code2, color2, pri2; + addr = K051960_romoffset + (K051960_spriterombank[0] << 8) + + ((K051960_spriterombank[1] & 0x03) << 16); + code = (addr & 0x3ffe0) >> 5; + off1 = addr & 0x1f; + color = ((K051960_spriterombank[1] & 0xfc) >> 2) + ((K051960_spriterombank[2] & 0x03) << 6); + pri = 0; + shadow = color & 0x80; + K051960_callback(code, color, pri, shadow, out code2, out color2, out pri2); + addr = (code2 << 7) | (off1 << 2) | byte1; + addr &= K051960_memory_region.Length - 1; + return K051960_memory_region[addr]; + } + public static byte K051960_r(int offset) + { + if (K051960_readroms != 0) + { + K051960_romoffset = (offset & 0x3fc) >> 2; + return K051960_fetchromdata(offset & 3); + } + else + { + return K051960_ram[offset]; + } + } + public static void K051960_w(int offset, byte data) + { + K051960_ram[offset] = data; + } + public static byte K051937_r(int offset) + { + if (K051960_readroms != 0 && offset >= 4 && offset < 8) + { + return K051960_fetchromdata(offset & 3); + } + else + { + if (offset == 0) + { + return (byte)((counter++) & 1); + } + return 0; + } + } + public static void K051937_w(int offset, byte data) + { + if (offset == 0) + { + K051960_irq_enabled = (data & 0x01); + K051960_nmi_enabled = (data & 0x04); + K051960_spriteflip = data & 0x08; + K051960_readroms = data & 0x20; + } + else if (offset == 1) + { + + } + else if (offset >= 2 && offset < 5) + { + K051960_spriterombank[offset - 2] = data; + } + else + { + + } + } + public static void K051960_sprites_draw(RECT cliprect, int min_priority, int max_priority) + { + int ox, oy, code, color, pri, shadow, size, w, h, x, y, flipx, flipy, zoomx, zoomy, code2, color2, pri2; + int offs, pri_code; + int[] sortedlist = new int[128]; + int[] xoffset = new int[] { 0, 1, 4, 5, 16, 17, 20, 21 }; + int[] yoffset = new int[] { 0, 2, 8, 10, 32, 34, 40, 42 }; + int[] width = new int[] { 1, 2, 1, 2, 4, 2, 4, 8 }; + int[] height = new int[] { 1, 1, 2, 2, 2, 4, 4, 8 }; + for (offs = 0; offs < 128; offs++) + { + sortedlist[offs] = -1; + } + for (offs = 0; offs < 0x400; offs += 8) + { + if ((K051960_ram[offs] & 0x80) != 0) + { + if (max_priority == -1) + { + sortedlist[(K051960_ram[offs] & 0x7f) ^ 0x7f] = offs; + } + else + { + sortedlist[K051960_ram[offs] & 0x7f] = offs; + } + } + } + for (pri_code = 0; pri_code < 128; pri_code++) + { + offs = sortedlist[pri_code]; + if (offs == -1) + { + continue; + } + code = K051960_ram[offs + 2] + ((K051960_ram[offs + 1] & 0x1f) << 8); + color = K051960_ram[offs + 3] & 0xff; + pri = 0; + shadow = color & 0x80; + K051960_callback(code, color, pri, shadow, out code2, out color2, out pri2); + code = code2; + color = color2; + pri = pri2; + if (max_priority != -1) + { + if (pri < min_priority || pri > max_priority) + { + continue; + } + } + size = (K051960_ram[offs + 1] & 0xe0) >> 5; + w = width[size]; + h = height[size]; + if (w >= 2) code &= ~0x01; + if (h >= 2) code &= ~0x02; + if (w >= 4) code &= ~0x04; + if (h >= 4) code &= ~0x08; + if (w >= 8) code &= ~0x10; + if (h >= 8) code &= ~0x20; + ox = (256 * K051960_ram[offs + 6] + K051960_ram[offs + 7]) & 0x01ff; + oy = 256 - ((256 * K051960_ram[offs + 4] + K051960_ram[offs + 5]) & 0x01ff); + ox += K051960_dx; + oy += K051960_dy; + flipx = K051960_ram[offs + 6] & 0x02; + flipy = K051960_ram[offs + 4] & 0x02; + zoomx = (K051960_ram[offs + 6] & 0xfc) >> 2; + zoomy = (K051960_ram[offs + 4] & 0xfc) >> 2; + zoomx = 0x10000 / 128 * (128 - zoomx); + zoomy = 0x10000 / 128 * (128 - zoomy); + if (K051960_spriteflip != 0) + { + ox = 512 - (zoomx * w >> 12) - ox; + oy = 256 - (zoomy * h >> 12) - oy; + flipx = (flipx == 0) ? 1 : 0; + flipy = (flipy == 0) ? 1 : 0; + } + if (zoomx == 0x10000 && zoomy == 0x10000) + { + int sx, sy; + for (y = 0; y < h; y++) + { + sy = oy + 16 * y; + for (x = 0; x < w; x++) + { + int c = code; + sx = ox + 16 * x; + if (flipx != 0) + { + c += xoffset[(w - 1 - x)]; + } + else + { + c += xoffset[x]; + } + if (flipy != 0) + { + c += yoffset[(h - 1 - y)]; + } + else + { + c += yoffset[y]; + } + if (max_priority == -1) + { + common_drawgfx_konami68000(gfx22rom, c, color, flipx, flipy, sx & 0x1ff, sy, cliprect, (uint)(pri | (1 << 31))); + /*pdrawgfx(bitmap, K051960_gfx, + c, + color, + flipx, flipy, + sx & 0x1ff, sy, + cliprect, shadow ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN, 0, pri);*/ + } + else + { + common_drawgfx_konami68000(gfx22rom, c, color, flipx, flipy, sx & 0x1ff, sy, cliprect, 0); + /*drawgfx(bitmap, K051960_gfx, + c, + color, + flipx, flipy, + sx & 0x1ff, sy, + cliprect, shadow ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN, 0);*/ + } + } + } + } + else + { + int sx, sy, zw, zh; + for (y = 0; y < h; y++) + { + sy = oy + ((zoomy * y + (1 << 11)) >> 12); + zh = (oy + ((zoomy * (y + 1) + (1 << 11)) >> 12)) - sy; + for (x = 0; x < w; x++) + { + int c = code; + sx = ox + ((zoomx * x + (1 << 11)) >> 12); + zw = (ox + ((zoomx * (x + 1) + (1 << 11)) >> 12)) - sx; + if (flipx != 0) + { + c += xoffset[(w - 1 - x)]; + } + else c += xoffset[x]; + if (flipy != 0) + { + c += yoffset[(h - 1 - y)]; + } + else + { + c += yoffset[y]; + } + if (max_priority == -1) + { + common_drawgfxzoom_konami68000(gfx22rom, c, color, flipx, flipy, sx & 0x1ff, sy, cliprect, 0, (zw << 16) / 16, (zh << 16) / 16, (uint)(pri | (1 << 31))); + /*pdrawgfxzoom(bitmap, K051960_gfx, + c, + color, + flipx, flipy, + sx & 0x1ff, sy, + cliprect, shadow ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN, 0, + (zw << 16) / 16, (zh << 16) / 16, pri);*/ + } + else + { + common_drawgfxzoom_konami68000(gfx22rom, c, color, flipx, flipy, sx & 0x1ff, sy, cliprect, 0, (zw << 16) / 16, (zh << 16) / 16); + /*drawgfxzoom(bitmap, K051960_gfx, + c, + color, + flipx, flipy, + sx & 0x1ff, sy, + cliprect, shadow ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN, 0, + (zw << 16) / 16, (zh << 16) / 16);*/ + } + } + } + } + } + } + public static void SaveStateBinary_K051960(BinaryWriter writer) + { + writer.Write(K051960_romoffset); + writer.Write(K051960_spriteflip); + writer.Write(K051960_readroms); + writer.Write(K051960_spriterombank, 0, 3); + writer.Write(K051960_ram, 0, 0x400); + writer.Write(K051960_dx); + writer.Write(K051960_dy); + writer.Write(K051960_irq_enabled); + writer.Write(K051960_nmi_enabled); + } + public static void LoadStateBinary_K051960(BinaryReader reader) + { + K051960_romoffset = reader.ReadInt32(); + K051960_spriteflip = reader.ReadInt32(); + K051960_readroms = reader.ReadInt32(); + K051960_spriterombank = reader.ReadBytes(3); + K051960_ram = reader.ReadBytes(0x400); + K051960_dx = reader.ReadInt32(); + K051960_dy = reader.ReadInt32(); + K051960_irq_enabled = reader.ReadInt32(); + K051960_nmi_enabled = reader.ReadInt32(); + } + public static void LoadStateBinary_K051960_2(BinaryReader reader) + { + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadBytes(3); + reader.ReadBytes(0x400); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + } + public static void K05324x_set_z_rejection(int zcode) + { + K05324x_z_rejection = zcode; + } + public static void K053245_vh_start() + { + int i; + Drawgfx.gfx_drawmode_table[0] = 0; + for (i = 1; i < 15; i++) + { + Drawgfx.gfx_drawmode_table[i] = 1; + } + Drawgfx.gfx_drawmode_table[15] = 2; + K05324x_z_rejection = -1; + K053244_rombank[0] = 0; + K053245_ramsize[0] = 0x800; + K053245_ram[0] = new byte[K053245_ramsize[0]]; + K053245_dx[0] = K053245_dy[0] = 0; + K053245_buffer[0] = new ushort[K053245_ramsize[0] / 2]; + for (i = 0; i < K053245_ramsize[0]; i++) + { + K053245_ram[0][i] = 0; + } + for (i = 0; i < K053245_ramsize[0] / 2; i++) + { + K053245_buffer[0][i] = 0; + } + } + public static ushort K053245_word_r(int offset) + { + return (ushort)(K053245_ram[0][offset * 2] * 0x100 + K053245_ram[0][offset * 2 + 1]); + } + public static void K053245_word_w(int offset, ushort data) + { + K053245_ram[0][offset * 2] = (byte)(data >> 8); + K053245_ram[0][offset * 2 + 1] = (byte)data; + } + public static void K053245_word_w2(int offset, ushort data) + { + K053245_ram[0][offset * 2 + 1] = (byte)data; + } + public static void K053245_clear_buffer(int chip) + { + int i, e; + for (e = K053245_ramsize[chip] / 2, i = 0; i < e; i += 8) + { + K053245_buffer[chip][i] = 0; + } + } + public static void K053245_update_buffer(int chip) + { + int i; + for (i = 0; i < K053245_ramsize[chip] / 2; i++) + { + K053245_buffer[chip][i] = (ushort)(K053245_ram[chip][i * 2] * 0x100 + K053245_ram[chip][i * 2 + 1]); + } + } + public static byte K053244_chip_r(int chip, int offset) + { + if ((K053244_regs[chip][5] & 0x10) != 0 && offset >= 0x0c && offset < 0x10) + { + int addr; + addr = (K053244_rombank[chip] << 19) | ((K053244_regs[chip][11] & 0x7) << 18) | (K053244_regs[chip][8] << 10) | (K053244_regs[chip][9] << 2) | ((offset & 3) ^ 1); + addr &= K053245_memory_region[chip].Length - 1; + return K053245_memory_region[chip][addr]; + } + else if (offset == 0x06) + { + K053245_update_buffer(chip); + return 0; + } + else + { + return 0; + } + } + public static byte K053244_r(int offset) + { + return K053244_chip_r(0, offset); + } + public static void K053244_chip_w(int chip, int offset, byte data) + { + K053244_regs[chip][offset] = data; + switch (offset) + { + case 0x05: + { + break; + } + case 0x06: + K053245_update_buffer(chip); + break; + } + } + public static void K053244_w(int offset, byte data) + { + K053244_chip_w(0, offset, data); + } + public static ushort K053244_lsb_r(int offset) + { + return (ushort)K053244_r(offset); + } + public static void K053244_lsb_w(int offset, ushort data) + { + //if (ACCESSING_BITS_0_7) + K053244_w(offset, (byte)(data & 0xff)); + } + public static void K053244_lsb_w2(int offset, byte data) + { + K053244_w(offset, data); + } + public static void K053244_bankselect(int chip, int bank) + { + K053244_rombank[chip] = bank; + } + public static void K053245_sprites_draw(RECT cliprect) + { + int offs, pri_code, i; + int[] sortedlist = new int[128]; + int flipscreenX, flipscreenY, spriteoffsX, spriteoffsY; + flipscreenX = K053244_regs[0][5] & 0x01; + flipscreenY = K053244_regs[0][5] & 0x02; + spriteoffsX = (K053244_regs[0][0] << 8) | K053244_regs[0][1]; + spriteoffsY = (K053244_regs[0][2] << 8) | K053244_regs[0][3]; + for (offs = 0; offs < 128; offs++) + { + sortedlist[offs] = -1; + } + i = K053245_ramsize[0] / 2; + for (offs = 0; offs < i; offs += 8) + { + pri_code = K053245_buffer[0][offs]; + if ((pri_code & 0x8000) != 0) + { + pri_code &= 0x007f; + if (offs != 0 && pri_code == K05324x_z_rejection) + { + continue; + } + if (sortedlist[pri_code] == -1) + { + sortedlist[pri_code] = offs; + } + } + } + for (pri_code = 127; pri_code >= 0; pri_code--) + { + int ox, oy, color, color2, code, code2, size, w, h, x, y, flipx, flipy, mirrorx, mirrory, shadow, zoomx, zoomy, pri, pri2; + offs = sortedlist[pri_code]; + if (offs == -1) + { + continue; + } + code = K053245_buffer[0][offs + 1]; + code = ((code & 0xffe1) + ((code & 0x0010) >> 2) + ((code & 0x0008) << 1) + ((code & 0x0004) >> 1) + ((code & 0x0002) << 2)); + color = K053245_buffer[0][offs + 6] & 0x00ff; + pri = 0; + K053245_callback(code, color, out code2, out color2, out pri2); + size = (K053245_buffer[0][offs] & 0x0f00) >> 8; + w = 1 << (size & 0x03); + h = 1 << ((size >> 2) & 0x03); + zoomy = K053245_buffer[0][offs + 4]; + if (zoomy > 0x2000) + { + continue; + } + if (zoomy != 0) + { + zoomy = (0x400000 + zoomy / 2) / zoomy; + } + else + { + zoomy = 2 * 0x400000; + } + if ((K053245_buffer[0][offs] & 0x4000) == 0) + { + zoomx = K053245_buffer[0][offs + 5]; + if (zoomx > 0x2000) + { + continue; + } + if (zoomx != 0) + { + zoomx = (0x400000 + zoomx / 2) / zoomx; + } + else + { + zoomx = 2 * 0x400000; + } + } + else + { + zoomx = zoomy; + } + ox = K053245_buffer[0][offs + 3] + spriteoffsX; + oy = K053245_buffer[0][offs + 2]; + ox += K053245_dx[0]; + oy += K053245_dy[0]; + flipx = K053245_buffer[0][offs] & 0x1000; + flipy = K053245_buffer[0][offs] & 0x2000; + mirrorx = K053245_buffer[0][offs + 6] & 0x0100; + if (mirrorx != 0) + { + flipx = 0; + } + mirrory = K053245_buffer[0][offs + 6] & 0x0200; + shadow = K053245_buffer[0][offs + 6] & 0x0080; + if (flipscreenX != 0) + { + ox = 512 - ox; + if (mirrorx == 0) + { + flipx = (flipx == 0) ? 1 : 0; + } + } + if (flipscreenY != 0) + { + oy = -oy; + if (mirrory == 0) + { + flipy = (flipy == 0) ? 1 : 0; + } + } + ox = (ox + 0x5d) & 0x3ff; + if (ox >= 768) + { + ox -= 1024; + } + oy = (-(oy + spriteoffsY + 0x07)) & 0x3ff; + if (oy >= 640) + { + oy -= 1024; + } + ox -= (zoomx * w) >> 13; + oy -= (zoomy * h) >> 13; + for (y = 0; y < h; y++) + { + int sx, sy, zw, zh; + sy = oy + ((zoomy * y + (1 << 11)) >> 12); + zh = (oy + ((zoomy * (y + 1) + (1 << 11)) >> 12)) - sy; + for (x = 0; x < w; x++) + { + int c, fx, fy; + sx = ox + ((zoomx * x + (1 << 11)) >> 12); + zw = (ox + ((zoomx * (x + 1) + (1 << 11)) >> 12)) - sx; + c = code2; + if (mirrorx != 0) + { + if ((flipx == 0) ^ (2 * x < w)) + { + c += (w - x - 1); + fx = 1; + } + else + { + c += x; + fx = 0; + } + } + else + { + if (flipx != 0) + { + c += w - 1 - x; + } + else + { + c += x; + } + fx = flipx; + } + if (mirrory != 0) + { + if ((flipy == 0) ^ (2 * y >= h)) + { + c += 8 * (h - y - 1); + fy = 1; + } + else + { + c += 8 * y; + fy = 0; + } + } + else + { + if (flipy != 0) + { + c += 8 * (h - 1 - y); + } + else + { + c += 8 * y; + } + fy = flipy; + } + c = (c & 0x3f) | (code2 & ~0x3f); + if (zoomx == 0x10000 && zoomy == 0x10000) + { + common_drawgfx_konami68000(gfx22rom, c, color2, fx, fy, sx, sy, cliprect, (uint)(pri2 | (1 << 31))); + /*pdrawgfx(bitmap, K053245_gfx[chip], + c, + color2, + fx, fy, + sx, sy, + cliprect, shadow ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN, 0, pri);*/ + } + else + { + common_drawgfxzoom_konami68000(gfx22rom, c, color2, fx, fy, sx, sy, cliprect, 0, (zw << 16) / 16, (zh << 16) / 16, (uint)(pri2 | 1 << 31)); + /*pdrawgfxzoom(bitmap, K053245_gfx[chip], + c, + color2, + fx, fy, + sx, sy, + cliprect, shadow ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN, 0, + (zw << 16) / 16, (zh << 16) / 16, pri);*/ + } + } + } + } + } + public static void SaveStateBinary_K053245(BinaryWriter writer) + { + int i; + writer.Write(K05324x_z_rejection); + writer.Write(K053245_ram[0], 0, 0x800); + for (i = 0; i < 0x400; i++) + { + writer.Write(K053245_buffer[0][i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(K053244_rombank[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(K053245_dx[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(K053245_dy[i]); + } + writer.Write(K053244_regs[0], 0, 0x10); + writer.Write(K054000_ram, 0, 0x20); + } + public static void LoadStateBinary_K053245(BinaryReader reader) + { + int i; + K05324x_z_rejection = reader.ReadInt32(); + K053245_ram[0] = reader.ReadBytes(0x800); + for (i = 0; i < 0x400; i++) + { + K053245_buffer[0][i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + K053244_rombank[i] = reader.ReadInt32(); + } + for (i = 0; i < 2; i++) + { + K053245_dx[i] = reader.ReadInt32(); + } + for (i = 0; i < 2; i++) + { + K053245_dy[i] = reader.ReadInt32(); + } + K053244_regs[0] = reader.ReadBytes(0x10); + K054000_ram = reader.ReadBytes(0x20); + } + public static void K053936_zoom_draw(int chip, ushort[] ctrl, ushort[] linectrl, RECT cliprect, Tmap tmap, int flags, uint priority) + { + if ((ctrl[0x07] & 0x0040) != 0) + { + uint startx, starty; + int incxx, incxy; + RECT my_clip; + int y, maxy; + if (((ctrl[0x07] & 0x0002) != 0) && (ctrl[0x09] != 0)) + { + my_clip.min_x = ctrl[0x08] + K053936_offset[chip][0] + 2; + my_clip.max_x = ctrl[0x09] + K053936_offset[chip][0] + 2 - 1; + if (my_clip.min_x < cliprect.min_x) + { + my_clip.min_x = cliprect.min_x; + } + if (my_clip.max_x > cliprect.max_x) + { + my_clip.max_x = cliprect.max_x; + } + y = ctrl[0x0a] + K053936_offset[chip][1] - 2; + if (y < cliprect.min_y) + { + y = cliprect.min_y; + } + maxy = ctrl[0x0b] + K053936_offset[chip][1] - 2 - 1; + if (maxy > cliprect.max_y) + { + maxy = cliprect.max_y; + } + } + else + { + my_clip.min_x = cliprect.min_x; + my_clip.max_x = cliprect.max_x; + y = cliprect.min_y; + maxy = cliprect.max_y; + } + while (y <= maxy) + { + //UINT16 *lineaddr = linectrl + 4*((y - K053936_offset[chip][1]) & 0x1ff); + int lineaddr_offset = 4 * ((y - K053936_offset[chip][1]) & 0x1ff); + my_clip.min_y = my_clip.max_y = y; + startx = (uint)(256 * (short)(linectrl[lineaddr_offset] + ctrl[0x00])); + starty = (uint)(256 * (short)(linectrl[lineaddr_offset + 1] + ctrl[0x01])); + incxx = (short)(linectrl[lineaddr_offset + 2]); + incxy = (short)(linectrl[lineaddr_offset + 3]); + + if ((ctrl[0x06] & 0x8000) != 0) + { + incxx *= 256; + } + if ((ctrl[0x06] & 0x0080) != 0) + { + incxy *= 256; + } + startx -= (uint)(K053936_offset[chip][0] * incxx); + starty -= (uint)(K053936_offset[chip][0] * incxy); + //tilemap_draw_roz(bitmap,&my_clip,tmap,startx << 5,starty << 5,incxx << 5,incxy << 5,0,0,K053936_wraparound[chip],flags,priority); + y++; + } + } + else + { + uint startx, starty; + int incxx, incxy, incyx, incyy; + startx = (uint)(256 * (short)(ctrl[0x00])); + starty = (uint)(256 * (short)(ctrl[0x01])); + incyx = (short)(ctrl[0x02]); + incyy = (short)(ctrl[0x03]); + incxx = (short)(ctrl[0x04]); + incxy = (short)(ctrl[0x05]); + if ((ctrl[0x06] & 0x4000) != 0) + { + incyx *= 256; incyy *= 256; + } + if ((ctrl[0x06] & 0x0040) != 0) + { + incxx *= 256; incxy *= 256; + } + startx -= (uint)(K053936_offset[chip][1] * incyx); + starty -= (uint)(K053936_offset[chip][1] * incyy); + startx -= (uint)(K053936_offset[chip][0] * incxx); + starty -= (uint)(K053936_offset[chip][0] * incxy); + //tilemap_draw_roz(bitmap,cliprect,tmap,startx << 5,starty << 5,incxx << 5,incxy << 5,incyx << 5,incyy << 5,K053936_wraparound[chip],flags,priority); + } + } + public static void K053936_0_zoom_draw(RECT cliprect, Tmap tmap, int flags, uint priority) + { + K053936_zoom_draw(0, K053936_0_ctrl, K053936_0_linectrl, cliprect, tmap, flags, priority); + } + public static void K053936_wraparound_enable(int chip, int status) + { + K053936_wraparound[chip] = status; + } + public static void K053936_set_offset(int chip, int xoffs, int yoffs) + { + K053936_offset[chip][0] = xoffs; + K053936_offset[chip][1] = yoffs; + } + public static void SaveStateBinary_K053936(BinaryWriter writer) + { + int i, j; + for (i = 0; i < 0x10; i++) + { + writer.Write(K053936_0_ctrl[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(K053936_0_linectrl[i]); + } + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + writer.Write(K053936_offset[i][j]); + } + } + for (i = 0; i < 2; i++) + { + writer.Write(K053936_wraparound[i]); + } + } + public static void LoadStateBinary_K053936(BinaryReader reader) + { + int i, j; + for (i = 0; i < 0x10; i++) + { + K053936_0_ctrl[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + K053936_0_linectrl[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + K053936_offset[i][j] = reader.ReadInt32(); + } + } + for (i = 0; i < 2; i++) + { + K053936_wraparound[i] = reader.ReadInt32(); + } + } + public static void K053251_vh_start() + { + K053251_set_tilemaps(null, null, null, null, null); + } + public static void K053251_set_tilemaps(Tmap ci0, Tmap ci1, Tmap ci2, Tmap ci3, Tmap ci4) + { + K053251_tilemaps[0] = ci0; + K053251_tilemaps[1] = ci1; + K053251_tilemaps[2] = ci2; + K053251_tilemaps[3] = ci3; + K053251_tilemaps[4] = ci4; + if (ci0 == null && ci1 == null && ci2 == null && ci3 == null && ci4 == null) + { + K053251_tilemaps_set = 0; + } + else + { + K053251_tilemaps_set = 1; + } + } + public static void K053251_w(int offset, byte data) + { + int i, newind; + data &= 0x3f; + if (K053251_ram[offset] != data) + { + K053251_ram[offset] = data; + if (offset == 9) + { + for (i = 0; i < 3; i++) + { + newind = 32 * ((data >> 2 * i) & 0x03); + if (K053251_palette_index[i] != newind) + { + K053251_palette_index[i] = newind; + if (K053251_tilemaps[i] != null) + { + K053251_tilemaps[i].all_tiles_dirty = true; + } + } + } + if (K053251_tilemaps_set == 0) + { + for (i = 0; i < 3; i++) + { + K052109_tilemap[i].all_tiles_dirty = true; + } + } + } + else if (offset == 10) + { + for (i = 0; i < 2; i++) + { + newind = 16 * ((data >> 3 * i) & 0x07); + if (K053251_palette_index[3 + i] != newind) + { + K053251_palette_index[3 + i] = newind; + if (K053251_tilemaps[3 + i] != null) + { + K053251_tilemaps[3 + i].all_tiles_dirty = true; + } + } + } + if (K053251_tilemaps_set == 0) + { + for (i = 0; i < 3; i++) + { + K052109_tilemap[i].all_tiles_dirty = true; + } + } + } + } + } + public static void K053251_lsb_w(int offset, ushort data) + { + //if (ACCESSING_BITS_0_7) + K053251_w(offset, (byte)(data & 0xff)); + } + public static void K053251_lsb_w2(int offset, byte data) + { + K053251_w(offset, data); + } + public static void K053251_msb_w(int offset, ushort data) + { + //if (ACCESSING_BITS_8_15) + K053251_w(offset, (byte)((data >> 8) & 0xff)); + } + public static void K053251_msb_w1(int offset, byte data) + { + K053251_w(offset, data); + } + public static int K053251_get_priority(int ci) + { + return K053251_ram[ci]; + } + public static int K053251_get_palette_index(int ci) + { + return K053251_palette_index[ci]; + } + public static void SaveStateBinary_K053251(BinaryWriter writer) + { + int i; + writer.Write(K053251_ram); + for (i = 0; i < 5; i++) + { + writer.Write(K053251_palette_index[i]); + } + writer.Write(K053251_tilemaps_set); + } + public static void LoadStateBinary_K053251(BinaryReader reader) + { + int i; + K053251_ram = reader.ReadBytes(0x10); + for (i = 0; i < 5; i++) + { + K053251_palette_index[i] = reader.ReadInt32(); + } + K053251_tilemaps_set = reader.ReadInt32(); + } + public static void LoadStateBinary_K053251_2(BinaryReader reader) + { + int i; + reader.ReadBytes(0x10); + for (i = 0; i < 5; i++) + { + reader.ReadInt32(); + } + reader.ReadInt32(); + } + public static void K054000_w(int offset, byte data) + { + K054000_ram[offset] = data; + } + public static byte K054000_r(int offset) + { + int Acx, Acy, Aax, Aay; + int Bcx, Bcy, Bax, Bay; + if (offset != 0x18) + { + return 0; + } + Acx = (K054000_ram[0x01] << 16) | (K054000_ram[0x02] << 8) | K054000_ram[0x03]; + Acy = (K054000_ram[0x09] << 16) | (K054000_ram[0x0a] << 8) | K054000_ram[0x0b]; + if (K054000_ram[0x04] == 0xff) + { + Acx += 3; + } + if (K054000_ram[0x0c] == 0xff) + { + Acy += 3; + } + Aax = K054000_ram[0x06] + 1; + Aay = K054000_ram[0x07] + 1; + Bcx = (K054000_ram[0x15] << 16) | (K054000_ram[0x16] << 8) | K054000_ram[0x17]; + Bcy = (K054000_ram[0x11] << 16) | (K054000_ram[0x12] << 8) | K054000_ram[0x13]; + Bax = K054000_ram[0x0e] + 1; + Bay = K054000_ram[0x0f] + 1; + if (Acx + Aax < Bcx - Bax) + { + return 1; + } + if (Bcx + Bax < Acx - Aax) + { + return 1; + } + if (Acy + Aay < Bcy - Bay) + { + return 1; + } + if (Bcy + Bay < Acy - Aay) + { + return 1; + } + return 0; + } + public static ushort K054000_lsb_r(int offset) + { + return K054000_r(offset); + } + public static void K054000_lsb_w(int offset, ushort data) + { + //if (ACCESSING_BITS_0_7) + K054000_w(offset, (byte)(data & 0xff)); + } + public static void K054000_lsb_w2(int offset, byte data) + { + K054000_w(offset, data); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konamiic.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konamiic.cs.meta new file mode 100644 index 00000000..7d97c9f0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Konamiic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 741dfbb389fd9314aade3a9798857dc0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory.cs new file mode 100644 index 00000000..6df0efb3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory.cs @@ -0,0 +1,3553 @@ +using cpu.z80; + +namespace MAME.Core +{ + public unsafe partial class Konami68000 + { + public static sbyte sbyte0, sbyte1, sbyte2, sbyte3, sbyte4; + public static sbyte sbyte0_old, sbyte1_old, sbyte2_old, sbyte3_old, sbyte4_old; + public static byte bytee_old; + public static sbyte MReadOpByte_cuebrick(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x01ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address <= 0x043fff) + { + int offset = address - 0x040000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + result = (sbyte)mainram2[offset]; + } + return result; + } + public static sbyte MReadByte_cuebrick(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x01ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address <= 0x043fff) + { + int offset = address - 0x040000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + result = (sbyte)mainram2[offset]; + } + else if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte0; + } + } + else if (address >= 0x0a0002 && address <= 0x0a0003) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x0a0004 && address <= 0x0a0005) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte2; + } + } + else if (address >= 0x0a0010 && address <= 0x0a0011) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0x0a0012 && address <= 0x0a0013) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw2; + } + } + else if (address >= 0x0a0018 && address <= 0x0a0019) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw3; + } + } + else if (address >= 0x0b0000 && address <= 0x0b03ff) + { + int offset = (address - 0x0b0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)cuebrick_nv_r1(offset); + } + else + { + result = (sbyte)cuebrick_nv_r2(offset); + } + } + else if (address >= 0x0c0000 && address <= 0x0c0003) + { + if (address % 2 == 0) + { + result = (sbyte)cuebrick_snd_r1(); + } + else + { + result = (sbyte)0; + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + else if (address >= 0x140000 && address <= 0x140007) + { + int offset = address - 0x140000; + result = (sbyte)K051937_r(offset); + } + else if (address >= 0x140400 && address <= 0x1407ff) + { + int offset = address - 0x140400; + result = (sbyte)K051960_r(offset); + } + return result; + } + public static short MReadOpWord_cuebrick(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x01ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 1 <= 0x043fff) + { + int offset = address - 0x040000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + result = (short)(mainram2[offset] * 0x100 + mainram2[offset + 1]); + } + return result; + } + public static short MReadWord_cuebrick(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x01ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 1 <= 0x043fff) + { + int offset = address - 0x040000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + result = (short)(mainram2[offset] * 0x100 + mainram2[offset + 1]); + } + else if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + result = (short)sbyte0; + } + else if (address >= 0x0a0002 && address + 1 <= 0x0a0003) + { + result = (short)sbyte1; + } + else if (address >= 0x0a0004 && address + 1 <= 0x0a0005) + { + result = (short)sbyte2; + } + else if (address >= 0x0a0010 && address + 1 <= 0x0a0011) + { + result = (short)dsw1; + } + else if (address >= 0x0a0012 && address + 1 <= 0x0a0013) + { + result = (short)dsw2; + } + else if (address >= 0x0a0018 && address + 1 <= 0x0a0019) + { + result = (short)dsw3; + } + else if (address >= 0x0b0000 && address + 1 <= 0x0b03ff) + { + int offset = (address - 0x0b0000) / 2; + result = (short)cuebrick_nv_r(offset); + } + else if (address >= 0x0c0000 && address + 1 <= 0x0c0003) + { + result = (short)cuebrick_snd_r(); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + else if (address >= 0x140000 && address + 1 <= 0x140007) + { + int offset = address - 0x140000; + result = (short)(K051937_r(offset) * 0x100 + K051937_r(offset + 1)); + } + else if (address >= 0x140400 && address + 1 <= 0x1407ff) + { + int offset = address - 0x140400; + result = (short)(K051960_r(offset) * 0x100 + K051960_r(offset + 1)); + } + return result; + } + public static int MReadOpLong_cuebrick(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x01ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 3 <= 0x043fff) + { + int offset = address - 0x040000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + result = (int)(mainram2[offset] * 0x1000000 + mainram2[offset + 1] * 0x10000 + mainram2[offset + 2] * 0x100 + mainram2[offset + 3]); + } + return result; + } + public static int MReadLong_cuebrick(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x01ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 3 <= 0x043fff) + { + int offset = address - 0x040000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + result = (int)(mainram2[offset] * 0x1000000 + mainram2[offset + 1] * 0x10000 + mainram2[offset + 2] * 0x100 + mainram2[offset + 3]); + } + else if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x0b0000 && address + 3 <= 0x0b03ff) + { + int offset = (address - 0x0b0000) / 2; + result = (int)(cuebrick_nv_r(offset) * 0x10000 + cuebrick_nv_r(offset + 1)); + } + else if (address >= 0x0c0000 && address + 3 <= 0x0c0003) + { + result = (int)0;//cuebrick_snd_r(); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + else if (address >= 0x140000 && address + 3 <= 0x140007) + { + int offset = address - 0x140000; + result = (short)(K051937_r(offset) * 0x1000000 + K051937_r(offset + 1) * 0x10000 + K051937_r(offset + 2) * 0x100 + K051937_r(offset + 3)); + } + else if (address >= 0x140400 && address + 3 <= 0x1407ff) + { + int offset = address - 0x140400; + result = (short)(K051960_r(offset) * 0x1000000 + K051960_r(offset + 1) * 0x10000 + K051960_r(offset + 2) * 0x100 + K051960_r(offset + 3)); + } + return result; + } + public static void MWriteByte_cuebrick(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x040000 && address <= 0x043fff) + { + int offset = address - 0x040000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + mainram2[offset] = (byte)value; + } + else if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + tmnt_paletteram_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + tmnt_paletteram_word_w2(offset, (byte)value); + } + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + tmnt_0a0000_w2((byte)value); + } + } + else if (address >= 0x0a0008 && address <= 0x0a0009) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + tmnt_sound_command_w2((byte)value); + } + } + else if (address >= 0x0a0010 && address <= 0x0a0011) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x0b0000 && address <= 0x0b03ff) + { + int offset = (address - 0x0b0000) / 2; + if (address % 2 == 0) + { + cuebrick_nv_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + cuebrick_nv_w2(offset, (byte)value); + } + } + else if (address >= 0x0b0400 && address <= 0x0b0401) + { + int offset = (address - 0x0b0400) / 2; + if (address % 2 == 0) + { + cuebrick_nvbank_w1((byte)value); + } + else if (address % 2 == 1) + { + cuebrick_nvbank_w2((byte)value); + } + } + else if (address >= 0x0c0000 && address <= 0x0c0003) + { + int offset = (address - 0x0c0000) / 2; + if (address % 2 == 0) + { + cuebrick_snd_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + cuebrick_snd_w2(offset, (byte)value); + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_noA12_w2(offset, (byte)value); + } + } + else if (address >= 0x140000 && address <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)value); + } + else if (address >= 0x140400 && address <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)value); + } + } + public static void MWriteWord_cuebrick(int address, short value) + { + address &= 0xffffff; + if (address >= 0x040000 && address + 1 <= 0x043fff) + { + int offset = address - 0x040000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + tmnt_paletteram_word_w(offset, (ushort)value); + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + tmnt_0a0000_w((ushort)value); + } + else if (address >= 0x0a0008 && address + 1 <= 0x0a0009) + { + tmnt_sound_command_w((ushort)value); + } + else if (address >= 0x0a0010 && address + 1 <= 0x0a0011) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x0b0000 && address + 1 <= 0x0b03ff) + { + int offset = (address - 0x0b0000) / 2; + cuebrick_nv_w(offset, (ushort)value); + } + else if (address >= 0x0b0400 && address + 1 <= 0x0b0401) + { + int offset = (address - 0x0b0400) / 2; + cuebrick_nvbank_w((ushort)value); + } + else if (address >= 0x0c0000 && address + 1 <= 0x0c0003) + { + int offset = (address - 0x0c0000) / 2; + cuebrick_snd_w(offset, (ushort)value); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)value); + } + else if (address >= 0x140000 && address + 1 <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)(value >> 8)); + K051937_w(offset + 1, (byte)value); + } + else if (address >= 0x140400 && address + 1 <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)(value >> 8)); + K051960_w(offset + 1, (byte)value); + } + } + public static void MWriteLong_cuebrick(int address, int value) + { + address &= 0xffffff; + if (address >= 0x040000 && address + 3 <= 0x043fff) + { + int offset = address - 0x040000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + tmnt_paletteram_word_w(offset, (ushort)(value >> 16)); + tmnt_paletteram_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x0b0000 && address + 3 <= 0x0b03ff) + { + int offset = (address - 0x0b0000) / 2; + cuebrick_nv_w(offset, (ushort)(value >> 16)); + cuebrick_nv_w(offset + 1, (ushort)value); + } + else if (address >= 0x0c0000 && address + 3 <= 0x0c0003) + { + int offset = (address - 0x0c0000) / 2; + cuebrick_snd_w(offset, (ushort)(value >> 16)); + cuebrick_snd_w(offset + 1, (ushort)value); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)(value >> 16)); + K052109_word_noA12_w(offset + 1, (ushort)value); + } + else if (address >= 0x140000 && address + 3 <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)(value >> 24)); + K051937_w(offset + 1, (byte)(value >> 16)); + K051937_w(offset + 2, (byte)(value >> 8)); + K051937_w(offset + 3, (byte)value); + } + else if (address >= 0x140400 && address + 3 <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)(value >> 24)); + K051960_w(offset + 1, (byte)(value >> 16)); + K051960_w(offset + 2, (byte)(value >> 8)); + K051960_w(offset + 3, (byte)value); + } + } + public static sbyte MReadOpByte_mia(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address <= 0x043fff) + { + int offset = address - 0x040000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + result = (sbyte)mainram2[offset]; + } + return result; + } + public static sbyte MReadByte_mia(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address <= 0x043fff) + { + int offset = address - 0x040000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + result = (sbyte)mainram2[offset]; + } + else if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte0; + } + } + else if (address >= 0x0a0002 && address <= 0x0a0003) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x0a0004 && address <= 0x0a0005) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte2; + } + } + else if (address >= 0x0a0010 && address <= 0x0a0011) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0x0a0012 && address <= 0x0a0013) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw2; + } + } + else if (address >= 0x0a0018 && address <= 0x0a0019) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw3; + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + else if (address >= 0x140000 && address <= 0x140007) + { + int offset = address - 0x140000; + result = (sbyte)K051937_r(offset); + } + else if (address >= 0x140400 && address <= 0x1407ff) + { + int offset = address - 0x140400; + result = (sbyte)K051960_r(offset); + } + return result; + } + public static short MReadOpWord_mia(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 1 <= 0x043fff) + { + int offset = address - 0x040000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + result = (short)(mainram2[offset] * 0x100 + mainram2[offset + 1]); + } + return result; + } + public static short MReadWord_mia(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 1 <= 0x043fff) + { + int offset = address - 0x040000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + result = (short)(mainram2[offset] * 0x100 + mainram2[offset + 1]); + } + else if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + result = (short)sbyte0; + } + else if (address >= 0x0a0002 && address + 1 <= 0x0a0003) + { + result = (short)sbyte1; + } + else if (address >= 0x0a0004 && address + 1 <= 0x0a0005) + { + result = (short)sbyte2; + } + else if (address >= 0x0a0010 && address + 1 <= 0x0a0011) + { + result = (short)dsw1; + } + else if (address >= 0x0a0012 && address + 1 <= 0x0a0013) + { + result = (short)dsw2; + } + else if (address >= 0x0a0018 && address + 1 <= 0x0a0019) + { + result = (short)dsw3; + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + else if (address >= 0x140000 && address + 1 <= 0x140007) + { + int offset = address - 0x140000; + result = (short)(K051937_r(offset) * 0x100 + K051937_r(offset + 1)); + } + else if (address >= 0x140400 && address + 1 <= 0x1407ff) + { + int offset = address - 0x140400; + result = (short)(K051960_r(offset) * 0x100 + K051960_r(offset + 1)); + } + return result; + } + public static int MReadOpLong_mia(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 3 <= 0x043fff) + { + int offset = address - 0x040000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + result = (int)(mainram2[offset] * 0x1000000 + mainram2[offset + 1] * 0x10000 + mainram2[offset + 2] * 0x100 + mainram2[offset + 3]); + } + return result; + } + public static int MReadLong_mia(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x040000 && address + 3 <= 0x043fff) + { + int offset = address - 0x040000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + result = (int)(mainram2[offset] * 0x1000000 + mainram2[offset + 1] * 0x10000 + mainram2[offset + 2] * 0x100 + mainram2[offset + 3]); + } + else if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + else if (address >= 0x140000 && address + 3 <= 0x140007) + { + int offset = address - 0x140000; + result = (short)(K051937_r(offset) * 0x1000000 + K051937_r(offset + 1) * 0x10000 + K051937_r(offset + 2) * 0x100 + K051937_r(offset + 3)); + } + else if (address >= 0x140400 && address + 3 <= 0x1407ff) + { + int offset = address - 0x140400; + result = (short)(K051960_r(offset) * 0x1000000 + K051960_r(offset + 1) * 0x10000 + K051960_r(offset + 2) * 0x100 + K051960_r(offset + 3)); + } + return result; + } + public static void MWriteByte_mia(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x040000 && address <= 0x043fff) + { + int offset = address - 0x040000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + mainram2[offset] = (byte)value; + } + else if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + tmnt_paletteram_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + tmnt_paletteram_word_w2(offset, (byte)value); + } + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + tmnt_0a0000_w2((byte)value); + } + } + else if (address >= 0x0a0008 && address <= 0x0a0009) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + tmnt_sound_command_w2((byte)value); + } + } + else if (address >= 0x0a0010 && address <= 0x0a0011) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_noA12_w2(offset, (byte)value); + } + } + else if (address >= 0x140000 && address <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)value); + } + else if (address >= 0x140400 && address <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)value); + } + } + public static void MWriteWord_mia(int address, short value) + { + address &= 0xffffff; + if (address >= 0x040000 && address + 1 <= 0x043fff) + { + int offset = address - 0x040000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + tmnt_paletteram_word_w(offset, (ushort)value); + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + tmnt_0a0000_w((ushort)value); + } + else if (address >= 0x0a0008 && address + 1 <= 0x0a0009) + { + tmnt_sound_command_w((ushort)value); + } + else if (address >= 0x0a0010 && address + 1 <= 0x0a0011) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)value); + } + else if (address >= 0x140000 && address + 1 <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)(value >> 8)); + K051937_w(offset + 1, (byte)value); + } + else if (address >= 0x140400 && address + 1 <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)(value >> 8)); + K051960_w(offset + 1, (byte)value); + } + } + public static void MWriteLong_mia(int address, int value) + { + address &= 0xffffff; + if (address >= 0x040000 && address + 3 <= 0x043fff) + { + int offset = address - 0x040000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + tmnt_paletteram_word_w(offset, (ushort)(value >> 16)); + tmnt_paletteram_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)(value >> 16)); + K052109_word_noA12_w(offset + 1, (ushort)value); + } + else if (address >= 0x140000 && address + 3 <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)(value >> 24)); + K051937_w(offset + 1, (byte)(value >> 16)); + K051937_w(offset + 2, (byte)(value >> 8)); + K051937_w(offset + 3, (byte)value); + } + else if (address >= 0x140400 && address + 3 <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)(value >> 24)); + K051960_w(offset + 1, (byte)(value >> 16)); + K051960_w(offset + 2, (byte)(value >> 8)); + K051960_w(offset + 3, (byte)value); + } + } + public static sbyte MReadOpByte_tmnt(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x05ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_tmnt(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x05ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte0; + } + } + else if (address >= 0x0a0002 && address <= 0x0a0003) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x0a0004 && address <= 0x0a0005) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte2; + } + } + else if (address >= 0x0a0006 && address <= 0x0a0007) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte3; + } + } + else if (address >= 0x0a0010 && address <= 0x0a0011) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0x0a0012 && address <= 0x0a0013) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw2; + } + } + else if (address >= 0x0a0014 && address <= 0x0a0015) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte4; + } + } + else if (address >= 0x0a0018 && address <= 0x0a0019) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw3; + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + else if (address >= 0x140000 && address <= 0x140007) + { + int offset = address - 0x140000; + result = (sbyte)K051937_r(offset); + } + else if (address >= 0x140400 && address <= 0x1407ff) + { + int offset = address - 0x140400; + result = (sbyte)K051960_r(offset); + } + return result; + } + public static short MReadOpWord_tmnt(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x05ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_tmnt(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x05ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + result = (short)sbyte0; + } + else if (address >= 0x0a0002 && address + 1 <= 0x0a0003) + { + result = (short)sbyte1; + } + else if (address >= 0x0a0004 && address + 1 <= 0x0a0005) + { + result = (short)sbyte2; + } + else if (address >= 0x0a0006 && address + 1 <= 0x0a0007) + { + result = (short)sbyte3; + } + else if (address >= 0x0a0010 && address + 1 <= 0x0a0011) + { + result = (short)dsw1; + } + else if (address >= 0x0a0012 && address + 1 <= 0x0a0013) + { + result = (short)dsw2; + } + else if (address >= 0x0a0014 && address + 1 <= 0x0a0015) + { + result = (short)sbyte4; + } + else if (address >= 0x0a0018 && address + 1 <= 0x0a0019) + { + result = (short)dsw3; + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + else if (address >= 0x140000 && address + 1 <= 0x140007) + { + int offset = address - 0x140000; + result = (short)(K051937_r(offset) * 0x100 + K051937_r(offset + 1)); + } + else if (address >= 0x140400 && address + 1 <= 0x1407ff) + { + int offset = address - 0x140400; + result = (short)(K051960_r(offset) * 0x100 + K051960_r(offset + 1)); + } + return result; + } + public static int MReadOpLong_tmnt(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x05ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_tmnt(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x05ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + else if (address >= 0x140000 && address + 3 <= 0x140007) + { + int offset = address - 0x140000; + result = (int)(K051937_r(offset) * 0x1000000 + K051937_r(offset + 1) * 0x10000 + K051937_r(offset + 2) * 0x100 + K051937_r(offset + 3)); + } + else if (address >= 0x140400 && address + 3 <= 0x1407ff) + { + int offset = address - 0x140400; + result = (int)(K051960_r(offset) * 0x1000000 + K051960_r(offset + 1) * 0x10000 + K051960_r(offset + 2) * 0x100 + K051960_r(offset + 3)); + } + return result; + } + public static void MWriteByte_tmnt(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x060000 && address <= 0x063fff) + { + int offset = address - 0x060000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + tmnt_paletteram_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + tmnt_paletteram_word_w2(offset, (byte)value); + } + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + tmnt_0a0000_w2((byte)value); + } + } + else if (address >= 0x0a0008 && address <= 0x0a0009) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + tmnt_sound_command_w2((byte)value); + } + } + else if (address >= 0x0a0010 && address <= 0x0a0011) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x0c0000 && address <= 0x0c0001) + { + tmnt_priority_w2((byte)value); + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_noA12_w2(offset, (byte)value); + } + } + else if (address >= 0x140000 && address <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)value); + } + else if (address >= 0x140400 && address <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)value); + } + } + public static void MWriteWord_tmnt(int address, short value) + { + address &= 0xffffff; + if (address >= 0x060000 && address + 1 <= 0x063fff) + { + int offset = address - 0x060000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + tmnt_paletteram_word_w(offset, (ushort)value); + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + tmnt_0a0000_w((ushort)value); + } + else if (address >= 0x0a0008 && address + 1 <= 0x0a0009) + { + tmnt_sound_command_w((ushort)value); + } + else if (address >= 0x0a0010 && address + 1 <= 0x0a0011) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x0c0000 && address + 1 <= 0x0c0001) + { + tmnt_priority_w((ushort)value); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)value); + } + else if (address >= 0x140000 && address + 1 <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)(value >> 8)); + K051937_w(offset + 1, (byte)value); + } + else if (address >= 0x140400 && address + 1 <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)(value >> 8)); + K051960_w(offset + 1, (byte)value); + } + } + public static void MWriteLong_tmnt(int address, int value) + { + address &= 0xffffff; + if (address >= 0x060000 && address + 3 <= 0x063fff) + { + int offset = address - 0x060000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + tmnt_paletteram_word_w(offset, (ushort)(value >> 16)); + tmnt_paletteram_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)(value >> 16)); + K052109_word_noA12_w(offset + 1, (ushort)value); + } + else if (address >= 0x140000 && address + 3 <= 0x140007) + { + int offset = address - 0x140000; + K051937_w(offset, (byte)(value >> 24)); + K051937_w(offset + 1, (byte)(value >> 16)); + K051937_w(offset + 2, (byte)(value >> 8)); + K051937_w(offset + 3, (byte)value); + } + else if (address >= 0x140400 && address + 3 <= 0x1407ff) + { + int offset = address - 0x140400; + K051960_w(offset, (byte)(value >> 24)); + K051960_w(offset + 1, (byte)(value >> 16)); + K051960_w(offset + 2, (byte)(value >> 8)); + K051960_w(offset + 3, (byte)value); + } + } + public static sbyte MReadOpByte_punkshot(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address <= 0x083fff) + { + int offset = address - 0x080000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_punkshot(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address <= 0x083fff) + { + int offset = address - 0x080000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x090000 && address <= 0x090fff) + { + int offset = (address - 0x090000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + result = (sbyte)dsw2; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0x0a0002 && address <= 0x0a0003) + { + if (address % 2 == 0) + { + result = (sbyte)dsw3; + } + else if (address % 2 == 1) + { + result = (sbyte)sbyte0; + } + } + else if (address >= 0x0a0004 && address <= 0x0a0005) + { + if (address % 2 == 0) + { + result = sbyte4; + } + else if (address % 2 == 1) + { + result = sbyte3; + } + } + else if (address >= 0x0a0006 && address <= 0x0a0007) + { + if (address % 2 == 0) + { + result = sbyte2; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x0a0040 && address <= 0x0a0043) + { + int offset = (address - 0x0a0040) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else if (address % 2 == 1) + { + result = (sbyte)punkshot_sound_r(offset); + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + else if (address >= 0x110000 && address <= 0x110007) + { + int offset = address - 0x110000; + result = (sbyte)K051937_r(offset); + } + else if (address >= 0x110400 && address <= 0x1107ff) + { + int offset = address - 0x110400; + result = (sbyte)K051960_r(offset); + } + else if (address >= 0xfffffc && address <= 0xffffff) + { + result = (sbyte)punkshot_kludge_r1(); + } + return result; + } + public static short MReadOpWord_punkshot(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address + 1 <= 0x083fff) + { + int offset = address - 0x080000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_punkshot(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address + 1 <= 0x083fff) + { + int offset = address - 0x080000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x090000 && address + 1 <= 0x090fff) + { + int offset = (address - 0x090000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + result = (short)((dsw2 << 8) | dsw1); + } + else if (address >= 0x0a0002 && address + 1 <= 0x0a0003) + { + result = (short)((dsw3 << 8) | (byte)sbyte0); + } + else if (address >= 0x0a0004 && address + 1 <= 0x0a0005) + { + result = (short)(((byte)sbyte4 << 8) | (byte)sbyte3); + } + else if (address >= 0x0a0006 && address + 1 <= 0x0a0007) + { + result = (short)(((byte)sbyte2 << 8) | (byte)sbyte1); + } + else if (address >= 0x0a0040 && address + 1 <= 0x0a0043) + { + int offset = (address - 0x0a0040) / 2; + result = (short)punkshot_sound_r(offset); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + else if (address >= 0x110000 && address + 1 <= 0x110007) + { + int offset = address - 0x110000; + result = (short)(K051937_r(offset) * 0x100 + K051937_r(offset + 1)); + } + else if (address >= 0x110400 && address + 1 <= 0x1107ff) + { + int offset = address - 0x110400; + result = (short)(K051960_r(offset) * 0x100 + K051960_r(offset + 1)); + } + else if (address >= 0xfffffc && address + 1 <= 0xffffff) + { + result = (short)punkshot_kludge_r(); + } + return result; + } + public static int MReadOpLong_punkshot(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address + 3 <= 0x083fff) + { + int offset = address - 0x080000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_punkshot(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address + 3 <= 0x083fff) + { + int offset = address - 0x080000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x090000 && address + 3 <= 0x090fff) + { + int offset = (address - 0x090000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x0a0040 && address + 3 <= 0x0a0043) + { + int offset = (address - 0x0a0040) / 2; + result = (int)(punkshot_sound_r(offset) * 0x10000 + punkshot_sound_r(offset + 1)); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + else if (address >= 0x110000 && address + 3 <= 0x110007) + { + int offset = address - 0x110000; + result = (int)(K051937_r(offset) * 0x1000000 + K051937_r(offset + 1) * 0x10000 + K051937_r(offset + 2) * 0x100 + K051937_r(offset + 3)); + } + else if (address >= 0x110400 && address + 3 <= 0x1107ff) + { + int offset = address - 0x110400; + result = (int)(K051960_r(offset) * 0x1000000 + K051960_r(offset + 1) * 0x10000 + K051960_r(offset + 2) * 0x100 + K051960_r(offset + 3)); + } + else if (address >= 0xfffffc && address + 3 <= 0xffffff) + { + result = (int)punkshot_kludge_r(); + } + return result; + } + public static void MWriteByte_punkshot(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x080000 && address <= 0x083fff) + { + int offset = address - 0x080000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x090000 && address <= 0x090fff) + { + int offset = (address - 0x090000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x0a0020 && address <= 0x0a0021) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + punkshot_0a0020_w2((byte)value); + } + } + else if (address >= 0x0a0040 && address <= 0x0a0041) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053260.k053260_0_lsb_w2(0, (byte)value); + } + } + else if (address >= 0x0a0060 && address <= 0x0a007f) + { + int offset = (address - 0x0a0060) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053251_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x0a0080 && address <= 0x0a0081) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + punkshot_K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + punkshot_K052109_word_noA12_w2(offset, (byte)value); + } + } + else if (address >= 0x110000 && address <= 0x110007) + { + int offset = address - 0x110000; + K051937_w(offset, (byte)value); + } + else if (address >= 0x110400 && address <= 0x1107ff) + { + int offset = address - 0x110400; + K051960_w(offset, (byte)value); + } + } + public static void MWriteWord_punkshot(int address, short value) + { + address &= 0xffffff; + if (address >= 0x080000 && address + 1 <= 0x083fff) + { + int offset = address - 0x080000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x090000 && address + 1 <= 0x090fff) + { + int offset = (address - 0x090000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x0a0020 && address + 1 <= 0x0a0021) + { + punkshot_0a0020_w((ushort)value); + } + else if (address >= 0x0a0040 && address + 1 <= 0x0a0041) + { + K053260.k053260_0_lsb_w(0, (ushort)value); + } + else if (address >= 0x0a0060 && address + 1 <= 0x0a007f) + { + int offset = (address - 0x0a0060) / 2; + K053251_lsb_w(offset, (ushort)value); + } + else if (address >= 0x0a0080 && address + 1 <= 0x0a0081) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + punkshot_K052109_word_noA12_w(offset, (ushort)value); + } + else if (address >= 0x110000 && address + 1 <= 0x110007) + { + int offset = address - 0x110000; + K051937_w(offset, (byte)(value >> 8)); + K051937_w(offset + 1, (byte)value); + } + else if (address >= 0x110400 && address + 1 <= 0x1107ff) + { + int offset = address - 0x110400; + K051960_w(offset, (byte)(value >> 8)); + K051960_w(offset + 1, (byte)value); + } + } + public static void MWriteLong_punkshot(int address, int value) + { + address &= 0xffffff; + if (address >= 0x080000 && address + 3 <= 0x083fff) + { + int offset = address - 0x080000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x090000 && address + 3 <= 0x090fff) + { + int offset = (address - 0x090000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x0a0060 && address + 3 <= 0x0a007f) + { + int offset = (address - 0x0a0060) / 2; + K053251_lsb_w(offset, (ushort)(value >> 16)); + K053251_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + punkshot_K052109_word_noA12_w(offset, (ushort)(value >> 16)); + punkshot_K052109_word_noA12_w(offset + 1, (ushort)value); + } + else if (address >= 0x110000 && address + 3 <= 0x110007) + { + int offset = address - 0x110000; + K051937_w(offset, (byte)(value >> 24)); + K051937_w(offset + 1, (byte)(value >> 16)); + K051937_w(offset + 2, (byte)(value >> 8)); + K051937_w(offset + 3, (byte)value); + } + else if (address >= 0x110400 && address + 3 <= 0x1107ff) + { + int offset = address - 0x110400; + K051960_w(offset, (byte)(value >> 24)); + K051960_w(offset + 1, (byte)(value >> 16)); + K051960_w(offset + 2, (byte)(value >> 8)); + K051960_w(offset + 3, (byte)value); + } + } + public static sbyte MReadOpByte_lgtnfght(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x090000 && address <= 0x093fff) + { + int offset = address - 0x090000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_lgtnfght(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x090000 && address <= 0x093fff) + { + int offset = address - 0x090000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x0a0000 && address <= 0x0a0001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte0; + } + } + else if (address >= 0x0a0002 && address <= 0x0a0003) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x0a0004 && address <= 0x0a0005) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte2; + } + } + else if (address >= 0x0a0006 && address <= 0x0a0007) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0x0a0008 && address <= 0x0a0009) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw2; + } + } + else if (address >= 0x0a0010 && address <= 0x0a0011) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw3; + } + } + else if (address >= 0x0a0020 && address <= 0x0a0023) + { + int offset = (address - 0x0a0020) / 2; + if (address % 2 == 0) + { + result = (sbyte)(punkshot_sound_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)punkshot_sound_r(offset); + } + } + else if (address >= 0x0b0000 && address <= 0x0b3fff) + { + int offset = (address - 0x0b0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053245_scattered_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053245_scattered_word_r(offset); + } + } + else if (address >= 0x0c0000 && address <= 0x0c001f) + { + int offset = (address - 0x0c0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053244_word_noA1_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053244_word_noA1_r(offset); + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + return result; + } + public static short MReadOpWord_lgtnfght(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x090000 && address + 1 <= 0x093fff) + { + int offset = address - 0x090000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_lgtnfght(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x090000 && address + 1 <= 0x093fff) + { + int offset = address - 0x090000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) + { + int offset = (address - 0x0a0000) / 2; + result = (short)sbyte0; + } + else if (address >= 0x0a0002 && address + 1 <= 0x0a0003) + { + int offset = (address - 0x0a0002) / 2; + result = (short)sbyte1; + } + else if (address >= 0x0a0004 && address + 1 <= 0x0a0005) + { + int offset = (address - 0x0a0004) / 2; + result = (short)sbyte2; + } + else if (address >= 0x0a0006 && address + 1 <= 0x0a0007) + { + int offset = (address - 0x0a0006) / 2; + result = (short)dsw1; + } + else if (address >= 0x0a0008 && address + 1 <= 0x0a0009) + { + int offset = (address - 0x0a0008) / 2; + result = (short)dsw2; + } + else if (address >= 0x0a0010 && address + 1 <= 0x0a0011) + { + int offset = (address - 0x0a0010) / 2; + result = (short)dsw3; + } + else if (address >= 0x0a0020 && address + 1 <= 0x0a0023) + { + int offset = (address - 0x0a0020) / 2; + result = (short)punkshot_sound_r(offset); + } + else if (address >= 0x0b0000 && address + 1 <= 0x0b3fff) + { + int offset = (address - 0x0b0000) / 2; + result = (short)K053245_scattered_word_r(offset); + } + else if (address >= 0x0c0000 && address + 1 <= 0x0c001f) + { + int offset = (address - 0x0c0000) / 2; + result = (short)K053244_word_noA1_r(offset); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + return result; + } + public static int MReadOpLong_lgtnfght(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x090000 && address + 3 <= 0x093fff) + { + int offset = address - 0x090000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_lgtnfght(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x090000 && address + 3 <= 0x093fff) + { + int offset = address - 0x090000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x0a0020 && address + 3 <= 0x0a0023) + { + int offset = (address - 0x0a0020) / 2; + result = (int)(punkshot_sound_r(offset) * 0x10000 + punkshot_sound_r(offset + 1)); + } + else if (address >= 0x0b0000 && address + 3 <= 0x0b3fff) + { + int offset = (address - 0x0b0000) / 2; + result = (int)(K053245_scattered_word_r(offset) * 0x10000 + K053245_scattered_word_r(offset + 1)); + } + else if (address >= 0x0c0000 && address + 3 <= 0x0c001f) + { + int offset = (address - 0x0c0000) / 2; + result = (int)(K053244_word_noA1_r(offset) * 0x10000 + K053244_word_noA1_r(offset + 1)); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + return result; + } + public static void MWriteByte_lgtnfght(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x080000 && address <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x090000 && address <= 0x093fff) + { + int offset = address - 0x090000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x0a0018 && address <= 0x0a0019) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + lgtnfght_0a0018_w2((byte)value); + } + } + else if (address >= 0x0a0020 && address <= 0x0a0021) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053260.k053260_0_lsb_w2(0, (byte)value); + } + } + else if (address >= 0x0a0028 && address <= 0x0a0029) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x0b0000 && address <= 0x0b3fff) + { + int offset = (address - 0x0b0000) / 2; + if (address % 2 == 0) + { + K053245_scattered_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053245_scattered_word_w2(offset, (byte)value); + } + } + else if (address >= 0x0c0000 && address <= 0x0c001f) + { + int offset = (address - 0x0c0000) / 2; + if (address % 2 == 0) + { + K053244_word_noA1_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053244_word_noA1_w2(offset, (byte)value); + } + } + else if (address >= 0x0e0000 && address <= 0x0e001f) + { + int offset = (address - 0x0e0000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053251_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + if (address % 2 == 0) + { + K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_noA12_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_lgtnfght(int address, short value) + { + address &= 0xffffff; + if (address >= 0x080000 && address + 1 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x090000 && address + 1 <= 0x093fff) + { + int offset = address - 0x090000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x0a0018 && address + 1 <= 0x0a0019) + { + lgtnfght_0a0018_w((ushort)value); + } + else if (address >= 0x0a0020 && address + 1 <= 0x0a0021) + { + K053260.k053260_0_lsb_w(0, (ushort)value); + } + else if (address >= 0x0a0028 && address + 1 <= 0x0a0029) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x0b0000 && address + 1 <= 0x0b3fff) + { + int offset = (address - 0x0b0000) / 2; + K053245_scattered_word_w(offset, (ushort)value); + } + else if (address >= 0x0c0000 && address + 1 <= 0x0c001f) + { + int offset = (address - 0x0c0000) / 2; + K053244_word_noA1_w(offset, (ushort)value); + } + else if (address >= 0x0e0000 && address + 1 <= 0x0e001f) + { + int offset = (address - 0x0e0000) / 2; + K053251_lsb_w(offset, (ushort)value); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)value); + } + } + public static void MWriteLong_lgtnfght(int address, int value) + { + address &= 0xffffff; + if (address >= 0x080000 && address + 3 <= 0x080fff) + { + int offset = (address - 0x080000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x090000 && address + 3 <= 0x093fff) + { + int offset = address - 0x090000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x0b0000 && address + 3 <= 0x0b3fff) + { + int offset = (address - 0x0b0000) / 2; + K053245_scattered_word_w(offset, (ushort)(value >> 16)); + K053245_scattered_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x0c0000 && address + 3 <= 0x0c001f) + { + int offset = (address - 0x0c0000) / 2; + K053244_word_noA1_w(offset, (ushort)(value >> 16)); + K053244_word_noA1_w(offset + 1, (ushort)value); + } + else if (address >= 0x0e0000 && address + 3 <= 0x0e001f) + { + int offset = (address - 0x0e0000) / 2; + K053251_lsb_w(offset, (ushort)(value >> 16)); + K053251_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x100000) / 2; + K052109_word_noA12_w(offset, (ushort)(value >> 16)); + K052109_word_noA12_w(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_ssriders(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x0bffff) + { + result = (sbyte)Memory.mainrom[address]; + } + else if (address >= 0x104000 && address <= 0x107fff) + { + result = (sbyte)Memory.mainram[address - 0x104000]; + } + return result; + } + public static sbyte MReadByte_ssriders(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x0bffff) + { + result = (sbyte)Memory.mainrom[address]; + } + else if (address >= 0x104000 && address <= 0x107fff) + { + result = (sbyte)Memory.mainram[address - 0x104000]; + } + else if (address >= 0x140000 && address <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x180000 && address <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053245_scattered_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053245_scattered_word_r(offset); + } + } + else if (address >= 0x1c0000 && address <= 0x1c0001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x1c0002 && address <= 0x1c0003) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte2; + } + } + else if (address >= 0x1c0004 && address <= 0x1c0005) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte3; + } + } + else if (address >= 0x1c0006 && address <= 0x1c0007) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte4; + } + } + else if (address >= 0x1c0100 && address <= 0x1c0101) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte0; + } + } + else if (address >= 0x1c0102 && address <= 0x1c0103) + { + if (address % 2 == 0) + { + result = (sbyte)(ssriders_eeprom_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)ssriders_eeprom_r(); + } + } + else if (address >= 0x1c0400 && address <= 0x1c0401) + { + result = (sbyte)Generic.watchdog_reset16_r(); + } + else if (address >= 0x1c0500 && address <= 0x1c057f) + { + result = (sbyte)mainram2[address - 0x1c0500]; + } + else if (address >= 0x1c0800 && address <= 0x1c0801) + { + if (address % 2 == 0) + { + result = (sbyte)(ssriders_protection_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)ssriders_protection_r(); + } + } + else if (address >= 0x5a0000 && address <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053244_word_noA1_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053244_word_noA1_r(offset); + } + } + else if (address >= 0x5c0600 && address <= 0x5c0603) + { + int offset = (address - 0x5c0600) / 2; + if (address % 2 == 0) + { + result = (sbyte)(punkshot_sound_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)punkshot_sound_r(offset); + } + } + else if (address >= 0x600000 && address <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_r(offset); + } + } + return result; + } + public static short MReadOpWord_ssriders(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x0bffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + result = (short)(Memory.mainram[address - 0x104000] * 0x100 + Memory.mainram[address - 0x104000 + 1]); + } + return result; + } + public static short MReadWord_ssriders(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x0bffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + result = (short)(Memory.mainram[address - 0x104000] * 0x100 + Memory.mainram[address - 0x104000 + 1]); + } + else if (address >= 0x140000 && address + 1 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x180000 && address + 1 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + result = (short)K053245_scattered_word_r(offset); + } + else if (address >= 0x1c0000 && address + 1 <= 0x1c0001) + { + result = (short)sbyte1; + } + else if (address >= 0x1c0002 && address + 1 <= 0x1c0003) + { + result = (short)sbyte2; + } + else if (address >= 0x1c0004 && address + 1 <= 0x1c0005) + { + result = (short)sbyte3; + } + else if (address >= 0x1c0006 && address + 1 <= 0x1c0007) + { + result = (short)sbyte4; + } + else if (address >= 0x1c0100 && address + 1 <= 0x1c0101) + { + result = (short)sbyte0; + } + else if (address >= 0x1c0102 && address + 1 <= 0x1c0103) + { + result = (short)ssriders_eeprom_r(); + } + else if (address >= 0x1c0400 && address + 1 <= 0x1c0401) + { + result = (short)Generic.watchdog_reset16_r(); ; + } + else if (address >= 0x1c0500 && address + 1 <= 0x1c057f) + { + result = (short)(mainram2[address - 0x1c0500] * 0x100 + mainram2[address - 0x1c0500 + 1]); + } + else if (address >= 0x1c0800 && address + 1 <= 0x1c0801) + { + result = (short)ssriders_protection_r(); + } + else if (address >= 0x5a0000 && address + 1 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + result = (short)K053244_word_noA1_r(offset); + } + else if (address >= 0x5c0600 && address + 1 <= 0x5c0603) + { + int offset = (address - 0x5c0600) / 2; + result = (short)punkshot_sound_r(offset); + } + else if (address >= 0x600000 && address + 1 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + result = (short)K052109_word_r(offset); + } + return result; + } + public static int MReadOpLong_ssriders(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x0bffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + result = (int)(Memory.mainram[address - 0x104000] * 0x1000000 + Memory.mainram[address - 0x104000 + 1] * 0x10000 + Memory.mainram[address - 0x104000 + 2] * 0x100 + Memory.mainram[address - 0x104000 + 3]); + } + return result; + } + public static int MReadLong_ssriders(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x0bffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + result = (int)(Memory.mainram[address - 0x104000] * 0x1000000 + Memory.mainram[address - 0x104000 + 1] * 0x10000 + Memory.mainram[address - 0x104000 + 2] * 0x100 + Memory.mainram[address - 0x104000 + 3]); + } + else if (address >= 0x140000 && address + 3 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x180000 && address + 3 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + result = (int)(K053245_scattered_word_r(offset) * 0x10000 + K053245_scattered_word_r(offset + 1)); + } + else if (address >= 0x1c0500 && address + 3 <= 0x1c057f) + { + result = (int)(mainram2[address - 0x1c0500] * 0x1000000 + mainram2[address - 0x1c0500 + 1] * 0x10000 + mainram2[address - 0x1c0500 + 2] * 0x100 + mainram2[address - 0x1c0500 + 3]); + } + else if (address >= 0x5a0000 && address + 3 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + result = (int)(K053244_word_noA1_r(offset) * 0x10000 + K053244_word_noA1_r(offset)); + } + else if (address >= 0x5c0600 && address + 3 <= 0x5c0603) + { + int offset = (address - 0x5c0600) / 2; + result = (int)(punkshot_sound_r(offset) * 0x10000 + punkshot_sound_r(offset + 1)); + } + else if (address >= 0x600000 && address + 3 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + result = (int)(K052109_word_r(offset) * 0x10000 + K052109_word_r(offset + 1)); + } + return result; + } + public static void MWriteByte_ssriders(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x104000 && address <= 0x107fff) + { + int offset = address - 0x104000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x140000 && address <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x180000 && address <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + if (address % 2 == 0) + { + K053245_scattered_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053245_scattered_word_w2(offset, (byte)value); + } + } + else if (address >= 0x1c0200 && address <= 0x1c0201) + { + int offset = (address - 0x1c0200) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + ssriders_eeprom_w2((byte)value); + } + } + else if (address >= 0x1c0300 && address <= 0x1c0301) + { + int offset = (address - 0x1c0300) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + ssriders_1c0300_w2(offset, (byte)value); + } + } + else if (address >= 0x1c0400 && address <= 0x1c0401) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x1c0500 && address <= 0x1c057f) + { + int offset = address - 0x1c0500; + mainram2[offset] = (byte)value; + } + else if (address >= 0x1c0800 && address <= 0x1c0803) + { + int offset = (address - 0x1c0800) / 2; + ssriders_protection_w(offset); + } + else if (address >= 0x5a0000 && address <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + if (address % 2 == 0) + { + K053244_word_noA1_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053244_word_noA1_w2(offset, (byte)value); + } + } + else if (address >= 0x5c0600 && address <= 0x5c0601) + { + int offset = (address - 0x5c0600) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053260.k053260_0_lsb_w(offset, (byte)value); + } + } + else if (address >= 0x5c0604 && address <= 0x5c0605) + { + ssriders_soundkludge_w(); + } + else if (address >= 0x5c0700 && address <= 0x5c071f) + { + int offset = (address - 0x5c0700) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053251_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x600000 && address <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + K052109_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_ssriders(int address, short value) + { + address &= 0xffffff; + if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = address - 0x104000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x140000 && address + 1 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x180000 && address + 1 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + K053245_scattered_word_w(offset, (ushort)value); + } + else if (address >= 0x1c0200 && address + 1 <= 0x1c0201) + { + int offset = (address - 0x1c0200) / 2; + ssriders_eeprom_w((ushort)value); + } + else if (address >= 0x1c0300 && address + 1 <= 0x1c0301) + { + int offset = (address - 0x1c0300) / 2; + ssriders_1c0300_w(offset, (ushort)value); + } + else if (address >= 0x1c0400 && address + 1 <= 0x1c0401) + { + int offset = (address - 0x1c0400) / 2; + Generic.watchdog_reset16_w(); + } + else if (address >= 0x1c0500 && address + 1 <= 0x1c057f) + { + int offset = address - 0x1c0500; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0x1c0800 && address + 1 <= 0x1c0803) + { + int offset = (address - 0x1c0800) / 2; + ssriders_protection_w(offset); + } + else if (address >= 0x5a0000 && address + 1 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + K053244_word_noA1_w(offset, (ushort)value); + } + else if (address >= 0x5c0600 && address + 1 <= 0x5c0601) + { + int offset = (address - 0x5c0600) / 2; + K053260.k053260_0_lsb_w(offset, (ushort)value); + } + else if (address >= 0x5c0604 && address + 1 <= 0x5c0605) + { + ssriders_soundkludge_w(); + } + else if (address >= 0x5c0700 && address + 1 <= 0x5c071f) + { + int offset = (address - 0x5c0700) / 2; + K053251_lsb_w(offset, (ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + K052109_word_w(offset, (ushort)value); + } + } + public static void MWriteLong_ssriders(int address, int value) + { + address &= 0xffffff; + if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = address - 0x104000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x140000 && address + 3 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x180000 && address + 3 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + K053245_scattered_word_w(offset, (ushort)(value >> 16)); + K053245_scattered_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x1c0500 && address + 3 <= 0x1c057f) + { + int offset = address - 0x1c0500; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0x1c0800 && address + 3 <= 0x1c0803) + { + int offset = (address - 0x1c0800) / 2; + //ssriders_protection_w(offset); + ssriders_protection_w(offset + 1); + } + else if (address >= 0x5a0000 && address + 3 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + K053260.k053260_0_lsb_w(offset, (ushort)(value >> 16)); + K053260.k053260_0_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x5c0700 && address + 3 <= 0x5c071f) + { + int offset = (address - 0x5c0700) / 2; + K053251_lsb_w(offset, (ushort)(value >> 16)); + K053251_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x600000 && address + 3 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + K052109_word_w(offset, (ushort)(value >> 16)); + K052109_word_w(offset + 1, (ushort)value); + } + } + public static byte ZReadOp_mia(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_mia(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else if (address == 0xa000) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address >= 0xb000 && address <= 0xb00d) + { + int offset = address - 0xb000; + result = K007232.k007232_read_port_0_r(offset); + } + else if (address == 0xc001) + { + result = YM2151.ym2151_status_port_0_r(); + } + return result; + } + public static void ZWriteMemory_mia(ushort address, byte value) + { + if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + Memory.audioram[offset] = value; + } + else if (address >= 0xb000 && address <= 0xb00d) + { + int offset = address - 0xb000; + K007232.k007232_write_port_0_w(offset, value); + } + else if (address == 0xc000) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xc001) + { + YM2151.ym2151_data_port_0_w(value); + } + } + public static byte ZReadOp_tmnt(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_tmnt(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else if (address == 0x9000) + { + result = tmnt_sres_r(); + } + else if (address == 0xa000) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address >= 0xb000 && address <= 0xb00d) + { + int offset = address - 0xb000; + result = K007232.k007232_read_port_0_r(offset); + } + else if (address == 0xc001) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address == 0xf000) + { + result = Upd7759.upd7759_0_busy_r(); + } + return result; + } + public static void ZWriteMemory_tmnt(ushort address, byte value) + { + if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + Memory.audioram[offset] = value; + } + else if (address == 0x9000) + { + tmnt_sres_w(value); + } + else if (address >= 0xb000 && address <= 0xb00d) + { + int offset = address - 0xb000; + K007232.k007232_write_port_0_w(offset, value); + } + else if (address == 0xc000) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xc001) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address == 0xd000) + { + Upd7759.upd7759_0_port_w(value); + } + else if (address == 0xe000) + { + Upd7759.upd7759_0_start_w(value); + } + } + public static byte ZReadOp_punkshot(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_punkshot(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else if (address == 0xf801) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0xfc00 && address <= 0xfc2f) + { + int offset = address - 0xfc00; + result = K053260.k053260_0_r(offset); + } + return result; + } + public static void ZWriteMemory_punkshot(ushort address, byte value) + { + if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + Memory.audioram[offset] = value; + } + else if (address == 0xf800) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xf801) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address == 0xfa00) + { + sound_arm_nmi_w(); + } + else if (address >= 0xfc00 && address <= 0xfc2f) + { + int offset = address - 0xfc00; + K053260.k053260_0_w(offset, value); + } + } + public static byte ZReadOp_lgtnfght(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_lgtnfght(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else if (address == 0xa001) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0xc000 && address <= 0xc02f) + { + int offset = address - 0xc000; + result = K053260.k053260_0_r(offset); + } + return result; + } + public static void ZWriteMemory_lgtnfght(ushort address, byte value) + { + if (address >= 0x8000 && address <= 0x87ff) + { + int offset = address - 0x8000; + Memory.audioram[offset] = value; + } + else if (address == 0xa000) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xa001) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address >= 0xc000 && address <= 0xc02f) + { + int offset = address - 0xc000; + K053260.k053260_0_w(offset, value); + } + } + public static byte ZReadOp_ssriders(ushort address) + { + byte result = 0; + if (address <= 0xefff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_ssriders(ushort address) + { + byte result = 0; + if (address <= 0xefff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else if (address == 0xf801) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0xfa00 && address <= 0xfa2f) + { + int offset = address - 0xfa00; + result = K053260.k053260_0_r(offset); + } + return result; + } + public static void ZWriteMemory_ssriders(ushort address, byte value) + { + if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + Memory.audioram[offset] = value; + } + else if (address == 0xf800) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xf801) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address >= 0xfa00 && address <= 0xfa2f) + { + int offset = address - 0xfa00; + K053260.k053260_0_w(offset, value); + } + else if (address == 0xfc00) + { + sound_arm_nmi_w(); + } + } + public static byte ZReadHardware(ushort address) + { + return 0; + } + public static void ZWriteHardware(ushort address, byte value) + { + + } + public static int ZIRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[0].cpunum, 0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory.cs.meta new file mode 100644 index 00000000..8ff66f6d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89a0c10bac3218145bf01f385f005549 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory2.cs new file mode 100644 index 00000000..aefc71af --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory2.cs @@ -0,0 +1,3098 @@ +namespace MAME.Core +{ + public unsafe partial class Konami68000 + { + public static sbyte MReadOpByte_blswhstl(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x204000 && address <= 0x207fff) + { + int offset = address - 0x204000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_blswhstl(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x180000 && address <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_r(offset); + } + } + else if (address >= 0x204000 && address <= 0x207fff) + { + int offset = address - 0x204000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x300000 && address <= 0x303fff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053245_scattered_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053245_scattered_word_r(offset); + } + } + else if (address >= 0x400000 && address <= 0x400fff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x500000 && address <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else if (address % 2 == 1) + { + result = (sbyte)K054000_lsb_r(offset); + } + } + else if (address >= 0x680000 && address <= 0x68001f) + { + int offset = (address - 0x680000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053244_word_noA1_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053244_word_noA1_r(offset); + } + } + else if (address >= 0x700000 && address <= 0x700001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x700002 && address <= 0x700003) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte2; + } + } + else if (address >= 0x700004 && address <= 0x700005) + { + int offset = (address - 0x700004) / 2; + if (address % 2 == 0) + { + result = (sbyte)(blswhstl_coin_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)blswhstl_coin_r(); + } + } + else if (address >= 0x700006 && address <= 0x700007) + { + int offset = (address - 0x700006) / 2; + if (address % 2 == 0) + { + result = (sbyte)(blswhstl_eeprom_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)blswhstl_eeprom_r(); + } + } + else if (address >= 0x780600 && address <= 0x780603) + { + int offset = (address - 0x780600) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else if (address % 2 == 1) + { + result = (sbyte)blswhstl_sound_r(offset); + } + } + return result; + } + public static short MReadOpWord_blswhstl(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x204000 && address + 1 <= 0x207fff) + { + int offset = address - 0x204000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_blswhstl(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x180000 && address + 1 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + result = (short)K052109_word_r(offset); + } + else if (address >= 0x204000 && address + 1 <= 0x207fff) + { + int offset = address - 0x204000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x300000 && address + 1 <= 0x303fff) + { + int offset = (address - 0x300000) / 2; + result = (short)K053245_scattered_word_r(offset); + } + else if (address >= 0x400000 && address + 1 <= 0x400fff) + { + int offset = (address - 0x400000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x500000 && address + 1 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + result = (short)K054000_lsb_r(offset); + } + else if (address >= 0x680000 && address + 1 <= 0x68001f) + { + int offset = (address - 0x680000) / 2; + result = (short)K053244_word_noA1_r(offset); + } + else if (address >= 0x700000 && address + 1 <= 0x700001) + { + int offset = (address - 0x700000) / 2; + result = (short)((byte)sbyte1); + } + else if (address >= 0x700002 && address + 1 <= 0x700003) + { + int offset = (address - 0x700002) / 2; + result = (short)((byte)sbyte2); + } + else if (address >= 0x700004 && address + 1 <= 0x700005) + { + int offset = (address - 0x700004) / 2; + result = (short)blswhstl_coin_r(); + } + else if (address >= 0x700006 && address + 1 <= 0x700007) + { + int offset = (address - 0x700006) / 2; + result = (short)blswhstl_eeprom_r(); + } + else if (address >= 0x780600 && address + 1 <= 0x780603) + { + int offset = (address - 0x780600) / 2; + result = (short)blswhstl_sound_r(offset); + } + return result; + } + public static int MReadOpLong_blswhstl(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x204000 && address + 3 <= 0x207fff) + { + int offset = address - 0x204000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_blswhstl(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x180000 && address + 3 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + result = (int)(K052109_word_r(offset) * 0x10000 + K052109_word_r(offset + 1)); + } + else if (address >= 0x204000 && address + 3 <= 0x207fff) + { + int offset = address - 0x204000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x300000 && address + 3 <= 0x303fff) + { + int offset = (address - 0x300000) / 2; + result = (int)(K053245_scattered_word_r(offset) * 0x10000 + K053245_scattered_word_r(offset + 1)); + } + else if (address >= 0x400000 && address + 3 <= 0x400fff) + { + int offset = (address - 0x400000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); ; + } + else if (address >= 0x500000 && address + 3 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + result = (int)(K054000_lsb_r(offset) * 0x10000 + K054000_lsb_r(offset + 1)); + } + else if (address >= 0x680000 && address + 3 <= 0x68001f) + { + int offset = (address - 0x680000) / 2; + result = (int)(K053244_word_noA1_r(offset) * 0x10000 + K053244_word_noA1_r(offset + 1)); + } + else if (address >= 0x780600 && address + 3 <= 0x780603) + { + int offset = (address - 0x780600) / 2; + result = (int)0; + } + else if (address >= 0x780600 && address + 3 <= 0x780601) + { + int offset = (address - 0x780600) / 2; + result = (int)(blswhstl_sound_r(offset) * 0x10000 + blswhstl_sound_r(offset + 1)); + } + return result; + } + public static void MWriteByte_blswhstl(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x180000 && address <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + if (address % 2 == 0) + { + K052109_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_w2(offset, (byte)value); + } + } + else if (address >= 0x204000 && address <= 0x207fff) + { + int offset = address - 0x204000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x300000 && address <= 0x303fff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + K053245_scattered_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053245_scattered_word_w2(offset, (byte)value); + } + } + else if (address >= 0x400000 && address <= 0x400fff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x500000 && address <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K054000_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x680000 && address <= 0x68001f) + { + int offset = (address - 0x680000) / 2; + if (address % 2 == 0) + { + K053244_word_noA1_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053244_word_noA1_w2(offset, (byte)value); + } + } + else if (address >= 0x700200 && address <= 0x700201) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + blswhstl_eeprom_w2((byte)value); + } + } + else if (address >= 0x700300 && address <= 0x700301) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + blswhstl_700300_w2((byte)value); + } + } + else if (address >= 0x700400 && address <= 0x700401) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x780600 && address <= 0x780601) + { + int offset = (address - 0x780600) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053260.k053260_0_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x780604 && address <= 0x780605) + { + ssriders_soundkludge_w(); + } + else if (address >= 0x780700 && address <= 0x78071f) + { + int offset = (address - 0x780700) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053251_lsb_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_blswhstl(int address, short value) + { + address &= 0xffffff; + if (address >= 0x180000 && address + 1 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + K052109_word_w(offset, (ushort)value); + } + else if (address >= 0x204000 && address + 1 <= 0x207fff) + { + int offset = address - 0x204000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x300000 && address + 1 <= 0x303fff) + { + int offset = (address - 0x300000) / 2; + K053245_scattered_word_w(offset, (ushort)value); + } + else if (address >= 0x400000 && address + 1 <= 0x400fff) + { + int offset = (address - 0x400000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x500000 && address + 1 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + K054000_lsb_w(offset, (ushort)value); + } + else if (address >= 0x680000 && address + 1 <= 0x68001f) + { + int offset = (address - 0x680000) / 2; + K053244_word_noA1_w(offset, (ushort)value); + } + else if (address >= 0x700200 && address + 1 <= 0x700201) + { + blswhstl_eeprom_w((ushort)value); + } + else if (address >= 0x700300 && address + 1 <= 0x700301) + { + blswhstl_700300_w((ushort)value); + } + else if (address >= 0x700400 && address + 1 <= 0x700401) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x780600 && address + 1 <= 0x780601) + { + int offset = (address - 0x780600) / 2; + K053260.k053260_0_lsb_w(offset, (ushort)value); + } + else if (address >= 0x780604 && address + 1 <= 0x780605) + { + ssriders_soundkludge_w(); + } + else if (address >= 0x780700 && address + 1 <= 0x78071f) + { + int offset = (address - 0x780700) / 2; + K053251_lsb_w(offset, (ushort)value); + } + } + public static void MWriteLong_blswhstl(int address, int value) + { + address &= 0xffffff; + if (address >= 0x180000 && address + 3 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + K052109_word_w(offset, (ushort)(value >> 16)); + K052109_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x204000 && address + 3 <= 0x207fff) + { + int offset = address - 0x204000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x300000 && address + 3 <= 0x303fff) + { + int offset = (address - 0x300000) / 2; + K053245_scattered_word_w(offset, (ushort)(value >> 16)); + K053245_scattered_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x400000 && address + 3 <= 0x400fff) + { + int offset = (address - 0x400000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x500000 && address + 3 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + K054000_lsb_w(offset, (ushort)(value >> 16)); + K054000_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x680000 && address + 3 <= 0x68001f) + { + int offset = (address - 0x680000) / 2; + K053244_word_noA1_w(offset, (ushort)(value >> 16)); + K053244_word_noA1_w(offset + 1, (ushort)value); + } + else if (address >= 0x780700 && address + 3 <= 0x78071f) + { + int offset = (address - 0x780700) / 2; + K053251_lsb_w(offset, (ushort)(value >> 16)); + K053251_lsb_w(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_glfgreat(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_glfgreat(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x104000 && address <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053245_scattered_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053245_scattered_word_r(offset); + } + } + else if (address >= 0x108000 && address <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x10c000 && address <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053936_0_linectrl[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053936_0_linectrl[offset]; + } + } + else if (address >= 0x114000 && address <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else if (address % 2 == 1) + { + result = (sbyte)K053244_lsb_r(offset); + } + } + else if (address >= 0x120000 && address <= 0x120001) + { + if (address % 2 == 0) + { + result = sbyte2; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x120002 && address <= 0x120003) + { + if (address % 2 == 0) + { + result = sbyte4; + } + else if (address % 2 == 1) + { + result = sbyte3; + } + } + else if (address >= 0x120004 && address <= 0x120005) + { + if (address % 2 == 0) + { + result = (sbyte)dsw3; + } + else if (address % 2 == 1) + { + result = sbyte0; + } + } + else if (address >= 0x120006 && address <= 0x120007) + { + if (address % 2 == 0) + { + result = (sbyte)dsw2; + } + else if (address % 2 == 1) + { + result = (sbyte)dsw1; + } + } + else if (address >= 0x121000 && address <= 0x121001) + { + int offset = (address - 0x121000) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else if (address % 2 == 1) + { + result = (sbyte)glfgreat_ball_r(); + } + } + else if (address >= 0x125000 && address <= 0x125003) + { + int offset = (address - 0x125000) / 2; + if (address % 2 == 0) + { + result = (sbyte)glfgreat_sound_r1(offset); + } + else + { + result = (sbyte)0; + } + } + else if (address >= 0x200000 && address <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + else if (address >= 0x300000 && address <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(glfgreat_rom_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)glfgreat_rom_r(offset); + } + } + return result; + } + public static short MReadOpWord_glfgreat(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_glfgreat(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + result = (short)K053245_scattered_word_r(offset); + } + else if (address >= 0x108000 && address + 1 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x10c000 && address + 1 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + result = (short)K053936_0_linectrl[offset]; + } + else if (address >= 0x114000 && address + 1 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + result = (short)K053244_lsb_r(offset); + } + else if (address >= 0x120000 && address + 1 <= 0x120001) + { + int offset = (address - 0x120000) / 2; + result = (short)(((byte)sbyte2 << 8) | (byte)sbyte1); + } + else if (address >= 0x120002 && address + 1 <= 0x120003) + { + int offset = (address - 0x120002) / 2; + result = (short)(((byte)sbyte4 << 8) | (byte)sbyte3); + } + else if (address >= 0x120004 && address + 1 <= 0x120005) + { + int offset = (address - 0x120004) / 2; + result = (short)((dsw3 << 8) | (byte)sbyte0); + } + else if (address >= 0x120006 && address + 1 <= 0x120007) + { + int offset = (address - 0x120006) / 2; + result = (short)((dsw2 << 8) | dsw1); + } + else if (address >= 0x121000 && address + 1 <= 0x121001) + { + int offset = (address - 0x121000) / 2; + result = (short)glfgreat_ball_r(); + } + else if (address >= 0x125000 && address + 1 <= 0x125003) + { + int offset = (address - 0x125000) / 2; + result = (short)glfgreat_sound_r(offset); + } + else if (address >= 0x200000 && address + 1 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + else if (address >= 0x300000 && address + 1 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (short)glfgreat_rom_r(offset); + } + return result; + } + public static int MReadOpLong_glfgreat(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_glfgreat(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + result = (int)(K053245_scattered_word_r(offset) * 0x10000 + K053245_scattered_word_r(offset + 1)); + } + else if (address >= 0x108000 && address + 3 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x10c000 && address + 3 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + result = (int)(K053936_0_linectrl[offset] * 0x10000 + K053936_0_linectrl[offset + 1]); + } + else if (address >= 0x114000 && address + 3 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + result = (int)(K053244_lsb_r(offset) * 0x10000 + K053244_lsb_r(offset + 1)); + } + else if (address >= 0x125000 && address + 3 <= 0x125003) + { + int offset = (address - 0x125000) / 2; + result = (int)(glfgreat_sound_r(offset) * 0x10000 + glfgreat_sound_r(offset + 1)); + } + else if (address >= 0x200000 && address + 3 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + else if (address >= 0x300000 && address + 3 <= 0x3fffff) + { + int offset = (address - 0x300000) / 2; + result = (int)(glfgreat_rom_r(offset) * 0x10000 + glfgreat_rom_r(offset + 1)); + } + return result; + } + public static void MWriteByte_glfgreat(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value); + } + else if (address >= 0x104000 && address <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + if (address % 2 == 0) + { + K053245_scattered_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053245_scattered_word_w2(offset, (byte)value); + } + } + else if (address >= 0x108000 && address <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x10c000 && address <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + if (address % 2 == 0) + { + K053936_0_linectrl[offset] = (ushort)(((byte)value << 8) | (K053936_0_linectrl[offset] & 0xff)); + } + else if (address % 2 == 1) + { + K053936_0_linectrl[offset] = (ushort)((K053936_0_linectrl[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x110000 && address <= 0x11001f) + { + int offset = (address - 0x110000) / 2; + if (address % 2 == 0) + { + K053244_word_noA1_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053244_word_noA1_w2(offset, (byte)value); + } + } + else if (address >= 0x114000 && address <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053244_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x118000 && address <= 0x11801f) + { + int offset = (address - 0x118000) / 2; + if (address % 2 == 0) + { + K053936_0_ctrl[offset] = (ushort)(((byte)value << 8) | (K053936_0_ctrl[offset] & 0xff)); + } + else if (address % 2 == 1) + { + K053936_0_ctrl[offset] = (ushort)((K053936_0_ctrl[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x11c000 && address <= 0x11c01f) + { + int offset = (address - 0x11c000) / 2; + if (address % 2 == 0) + { + K053251_msb_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + + } + } + else if (address >= 0x122000 && address <= 0x122001) + { + int offset = (address - 0x122000) / 2; + if (address % 2 == 0) + { + glfgreat_122000_w1((byte)value); + } + else if (address % 2 == 1) + { + glfgreat_122000_w2((byte)value); + } + } + else if (address >= 0x124000 && address <= 0x124001) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x125000 && address <= 0x125003) + { + int offset = (address - 0x125000) / 2; + if (address % 2 == 0) + { + glfgreat_sound_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + glfgreat_sound_w2(offset, (byte)value); + } + } + else if (address >= 0x200000 && address <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_noA12_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_glfgreat(int address, short value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + K053245_scattered_word_w(offset, (ushort)value); + } + else if (address >= 0x108000 && address + 1 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x10c000 && address + 1 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + K053936_0_linectrl[offset] = (ushort)value; + } + else if (address >= 0x110000 && address + 1 <= 0x11001f) + { + int offset = (address - 0x110000) / 2; + K053244_word_noA1_w(offset, (ushort)value); + } + else if (address >= 0x114000 && address + 1 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + K053244_lsb_w(offset, (ushort)value); + } + else if (address >= 0x118000 && address + 1 <= 0x11801f) + { + int offset = (address - 0x118000) / 2; + K053936_0_ctrl[offset] = (ushort)value; + } + else if (address >= 0x11c000 && address + 1 <= 0x11c01f) + { + int offset = (address - 0x11c000) / 2; + K053251_msb_w(offset, (ushort)value); + } + else if (address >= 0x122000 && address + 1 <= 0x122001) + { + int offset = (address - 0x122000) / 2; + glfgreat_122000_w((ushort)value); + } + else if (address >= 0x124000 && address + 1 <= 0x124001) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x125000 && address + 1 <= 0x125003) + { + int offset = (address - 0x125000) / 2; + glfgreat_sound_w(offset, (ushort)value); + } + else if (address >= 0x200000 && address + 1 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + K052109_word_noA12_w(offset, (ushort)value); + } + } + public static void MWriteLong_glfgreat(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + K053245_scattered_word_w(offset, (ushort)(value >> 16)); + K053245_scattered_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x108000 && address + 3 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x10c000 && address + 3 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + K053936_0_linectrl[offset] = (ushort)(value >> 16); + K053936_0_linectrl[offset + 1] = (ushort)value; + } + else if (address >= 0x110000 && address + 3 <= 0x11001f) + { + int offset = (address - 0x110000) / 2; + K053244_word_noA1_w(offset, (ushort)(value >> 16)); + K053244_word_noA1_w(offset + 1, (ushort)value); + } + else if (address >= 0x114000 && address + 3 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + K053244_lsb_w(offset, (ushort)(value >> 16)); + K053244_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x118000 && address + 3 <= 0x11801f) + { + int offset = (address - 0x118000) / 2; + K053936_0_ctrl[offset] = (ushort)(value >> 16); + K053936_0_ctrl[offset + 1] = (ushort)value; + } + else if (address >= 0x11c000 && address + 3 <= 0x11c01f) + { + int offset = (address - 0x11c000) / 2; + K053251_msb_w(offset, (ushort)(value >> 16)); + K053251_msb_w(offset + 1, (ushort)value); + } + else if (address >= 0x125000 && address + 3 <= 0x125003) + { + int offset = (address - 0x125000) / 2; + glfgreat_sound_w(offset, (ushort)(value >> 16)); + glfgreat_sound_w(offset + 1, (ushort)value); + } + else if (address >= 0x200000 && address + 3 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + K052109_word_noA12_w(offset, (ushort)(value >> 16)); + K052109_word_noA12_w(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_tmnt2(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x0fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address <= 0x107fff) + { + int offset = address - 0x104000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_tmnt2(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x0fffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address <= 0x107fff) + { + int offset = address - 0x104000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x140000 && address <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x180000 && address <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.spriteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.spriteram16[offset]; + } + } + else if (address >= 0x1c0000 && address <= 0x1c0001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte1; + } + } + else if (address >= 0x1c0002 && address <= 0x1c0003) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte2; + } + } + else if (address >= 0x1c0004 && address <= 0x1c0005) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte3; + } + } + else if (address >= 0x1c0006 && address <= 0x1c0007) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte4; + } + } + else if (address >= 0x1c0100 && address <= 0x1c0101) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte0; + } + } + else if (address >= 0x1c0102 && address <= 0x1c0103) + { + if (address % 2 == 0) + { + result = (sbyte)(ssriders_eeprom_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)ssriders_eeprom_r(); + } + } + else if (address >= 0x1c0400 && address <= 0x1c0401) + { + Generic.watchdog_reset16_r(); + } + else if (address >= 0x1c0500 && address <= 0x1c057f) + { + int offset = address - 0x1c0500; + result = (sbyte)mainram2[offset]; + } + else if (address >= 0x5a0000 && address <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053244_word_noA1_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053244_word_noA1_r(offset); + } + } + else if (address >= 0x5c0600 && address <= 0x5c0603) + { + int offset = (address - 0x5c0600) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else + { + result = (sbyte)tmnt2_sound_r(offset); + } + } + else if (address >= 0x600000 && address <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_r(offset); + } + } + return result; + } + public static short MReadOpWord_tmnt2(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x0fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = address - 0x104000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_tmnt2(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x0fffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = address - 0x104000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x140000 && address + 1 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x180000 && address + 1 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + result = (short)Generic.spriteram16[offset]; + } + else if (address >= 0x1c0000 && address + 1 <= 0x1c0001) + { + int offset = (address - 0x1c0000) / 2; + result = (short)((byte)sbyte1); + } + else if (address >= 0x1c0002 && address + 1 <= 0x1c0003) + { + int offset = (address - 0x1c0002) / 2; + result = (short)((byte)sbyte2); + } + else if (address >= 0x1c0004 && address + 1 <= 0x1c0005) + { + int offset = (address - 0x1c0004) / 2; + result = (short)((byte)sbyte3); + } + else if (address >= 0x1c0006 && address + 1 <= 0x1c0007) + { + int offset = (address - 0x1c0006) / 2; + result = (short)((byte)sbyte4); + } + else if (address >= 0x1c0100 && address + 1 <= 0x1c0101) + { + int offset = (address - 0x1c0100) / 2; + result = (short)((byte)sbyte0); + } + else if (address >= 0x1c0102 && address + 1 <= 0x1c0103) + { + int offset = (address - 0x1c0102) / 2; + result = (short)ssriders_eeprom_r(); + } + else if (address >= 0x1c0400 && address + 1 <= 0x1c0401) + { + Generic.watchdog_reset16_r(); + } + else if (address >= 0x1c0500 && address + 1 <= 0x1c057f) + { + int offset = address - 0x1c0500; + result = (short)(mainram2[offset] * 0x100 + mainram2[offset + 1]); + } + else if (address >= 0x5a0000 && address + 1 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + result = (short)K053244_word_noA1_r(offset); + } + else if (address >= 0x5c0600 && address + 1 <= 0x5c0603) + { + int offset = (address - 0x5c0600) / 2; + result = (short)tmnt2_sound_r(offset); + } + else if (address >= 0x600000 && address + 1 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + result = (short)K052109_word_r(offset); + } + return result; + } + public static int MReadOpLong_tmnt2(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x0fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = address - 0x104000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_tmnt2(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x0fffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = address - 0x104000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x140000 && address + 3 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x180000 && address + 3 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + result = (int)(Generic.spriteram16[offset] * 0x10000 + Generic.spriteram16[offset + 1]); + } + else if (address >= 0x1c0500 && address + 3 <= 0x1c057f) + { + int offset = (address - 0x1c0500) / 2; + result = (int)(mainram2[address - 0x1c0500] * 0x1000000 + mainram2[address - 0x1c0500 + 1] * 0x10000 + mainram2[address - 0x1c0500 + 2] * 0x100 + mainram2[address - 0x1c0500 + 3]); + } + else if (address >= 0x5a0000 && address + 3 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + result = (int)(K053244_word_noA1_r(offset) * 0x10000 + K053244_word_noA1_r(offset + 1)); + } + else if (address >= 0x5c0600 && address + 3 <= 0x5c0603) + { + int offset = (address - 0x5c0600) / 2; + result = (int)(tmnt2_sound_r(offset) * 0x10000 + tmnt2_sound_r(offset + 1)); + } + else if (address >= 0x600000 && address + 3 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + result = (int)(K052109_word_r(offset) * 0x10000 + K052109_word_r(offset + 1)); + } + return result; + } + public static void MWriteByte_tmnt2(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x104000 && address <= 0x107fff) + { + int offset = address - 0x104000; + Memory.mainram[offset] = (byte)(value); + } + else if (address >= 0x140000 && address <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x180000 && address <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + if (address % 2 == 0) + { + K053245_scattered_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053245_scattered_word_w2(offset, (byte)value); + } + } + else if (address >= 0x1c0200 && address <= 0x1c0201) + { + int offset = (address - 0x1c0200) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + ssriders_eeprom_w2((byte)value); + } + } + else if (address >= 0x1c0300 && address <= 0x1c0301) + { + int offset = (address - 0x1c0300) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + ssriders_1c0300_w2(offset, (byte)value); + } + } + else if (address >= 0x1c0400 && address <= 0x1c0401) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x1c0500 && address <= 0x1c057f) + { + int offset = address - 0x1c0500; + mainram2[offset] = (byte)value; + } + else if (address >= 0x1c0800 && address <= 0x1c081f) + { + int offset = (address - 0x1c0800) / 2; + if (address % 2 == 0) + { + tmnt2_1c0800_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + tmnt2_1c0800_w2(offset, (byte)value); + } + } + else if (address >= 0x5a0000 && address <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + if (address % 2 == 0) + { + K053244_word_noA1_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053244_word_noA1_w2(offset, (byte)value); + } + } + else if (address >= 0x5c0600 && address <= 0x5c0601) + { + int offset = (address - 0x5c0600) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053260.k053260_0_lsb_w(offset, (byte)value); + } + } + else if (address >= 0x5c0604 && address <= 0x5c0605) + { + ssriders_soundkludge_w(); + } + else if (address >= 0x5c0700 && address <= 0x5c071f) + { + int offset = (address - 0x5c0700) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053251_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x600000 && address <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + K052109_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_tmnt2(int address, short value) + { + address &= 0xffffff; + if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = address - 0x104000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x140000 && address + 1 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x180000 && address + 1 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + K053245_scattered_word_w(offset, (ushort)value); + } + else if (address >= 0x1c0200 && address + 1 <= 0x1c0201) + { + int offset = (address - 0x1c0200) / 2; + ssriders_eeprom_w((ushort)value); + } + else if (address >= 0x1c0300 && address + 1 <= 0x1c0301) + { + int offset = (address - 0x1c0300) / 2; + ssriders_1c0300_w(offset, (ushort)value); + } + else if (address >= 0x1c0400 && address + 1 <= 0x1c0401) + { + Generic.watchdog_reset16_w(); + } + else if (address >= 0x1c0500 && address + 1 <= 0x1c057f) + { + int offset = address - 0x1c0500; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0x1c0800 && address + 1 <= 0x1c081f) + { + int offset = (address - 0x1c0800) / 2; + tmnt2_1c0800_w(offset, (ushort)value); + } + else if (address >= 0x5a0000 && address + 1 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + K053244_word_noA1_w(offset, (ushort)value); + } + else if (address >= 0x5c0600 && address + 1 <= 0x5c0601) + { + int offset = (address - 0x5c0600) / 2; + K053260.k053260_0_lsb_w(offset, (ushort)value); + } + else if (address >= 0x5c0604 && address + 1 <= 0x5c0605) + { + ssriders_soundkludge_w(); + } + else if (address >= 0x5c0700 && address + 1 <= 0x5c071f) + { + int offset = (address - 0x5c0700) / 2; + K053251_lsb_w(offset, (ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + K052109_word_w(offset, (ushort)value); + } + } + public static void MWriteLong_tmnt2(int address, int value) + { + address &= 0xffffff; + if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = address - 0x104000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x140000 && address + 3 <= 0x140fff) + { + int offset = (address - 0x140000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x180000 && address + 3 <= 0x183fff) + { + int offset = (address - 0x180000) / 2; + K053245_scattered_word_w(offset, (ushort)(value >> 16)); + K053245_scattered_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x1c0500 && address + 3 <= 0x1c057f) + { + int offset = address - 0x1c0500; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0x1c0800 && address + 3 <= 0x1c081f) + { + int offset = (address - 0x1c0800) / 2; + tmnt2_1c0800_w(offset, (ushort)(value >> 16)); + tmnt2_1c0800_w(offset + 1, (ushort)value); + } + else if (address >= 0x5a0000 && address + 3 <= 0x5a001f) + { + int offset = (address - 0x5a0000) / 2; + K053244_word_noA1_w(offset, (ushort)(value >> 16)); + K053244_word_noA1_w(offset + 1, (ushort)value); + } + else if (address >= 0x5c0700 && address + 3 <= 0x5c071f) + { + int offset = (address - 0x5c0700) / 2; + K053251_lsb_w(offset, (ushort)(value >> 16)); + K053251_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x600000 && address + 3 <= 0x603fff) + { + int offset = (address - 0x600000) / 2; + K052109_word_w(offset, (ushort)(value >> 16)); + K052109_word_w(offset + 1, (ushort)value); + } + } + public static sbyte MReadOpByte_thndrx2(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_thndrx2(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x400000 && address <= 0x400003) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(punkshot_sound_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)punkshot_sound_r(offset); + } + } + else if (address >= 0x500000 && address <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else if (address % 2 == 1) + { + result = (sbyte)K054000_lsb_r(offset); + } + } + else if (address >= 0x500200 && address <= 0x500201) + { + if (address % 2 == 0) + { + result = (sbyte)(thndrx2_in0_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)thndrx2_in0_r(); + } + } + else if (address >= 0x500202 && address <= 0x500203) + { + if (address % 2 == 0) + { + result = (sbyte)(thndrx2_eeprom_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)thndrx2_eeprom_r(); + } + } + else if (address >= 0x600000 && address <= 0x607fff) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + else if (address >= 0x700000 && address <= 0x700007) + { + int offset = address - 0x700000; + result = (sbyte)K051937_r(offset); + } + else if (address >= 0x700400 && address <= 0x7007ff) + { + int offset = address - 0x700400; + result = (sbyte)K051960_r(offset); + } + return result; + } + public static short MReadOpWord_thndrx2(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_thndrx2(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x400000 && address + 1 <= 0x400003) + { + int offset = (address - 0x400000) / 2; + result = (short)punkshot_sound_r(offset); + } + else if (address >= 0x500000 && address + 1 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + result = (short)K054000_lsb_r(offset); + } + else if (address >= 0x500200 && address + 1 <= 0x500201) + { + result = (short)thndrx2_in0_r(); + } + else if (address >= 0x500202 && address + 1 <= 0x500203) + { + result = (short)thndrx2_eeprom_r(); + } + else if (address >= 0x600000 && address + 1 <= 0x607fff) + { + int offset = (address - 0x600000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + else if (address >= 0x700000 && address + 1 <= 0x700007) + { + int offset = address - 0x700000; + result = (short)(K051937_r(offset) * 0x100 + K051937_r(offset + 1)); + } + else if (address >= 0x700400 && address + 1 <= 0x7007ff) + { + int offset = address - 0x700400; + result = (short)(K051960_r(offset) * 0x100 + K051960_r(offset + 1)); + } + return result; + } + public static int MReadOpLong_thndrx2(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_thndrx2(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x400000 && address + 3 <= 0x400003) + { + int offset = (address - 0x400000) / 2; + result = (int)(punkshot_sound_r(offset) * 0x10000 + punkshot_sound_r(offset + 1)); + } + else if (address >= 0x500000 && address + 3 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + result = (int)(K054000_lsb_r(offset) * 0x10000 + K054000_lsb_r(offset + 1)); + } + else if (address >= 0x600000 && address + 3 <= 0x607fff) + { + int offset = (address - 0x600000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + else if (address >= 0x700000 && address + 3 <= 0x700007) + { + int offset = address - 0x700000; + result = (short)(K051937_r(offset) * 0x1000000 + K051937_r(offset + 1) * 0x10000 + K051937_r(offset + 2) * 0x100 + K051937_r(offset + 3)); + } + else if (address >= 0x700400 && address + 3 <= 0x7007ff) + { + int offset = address - 0x700400; + result = (short)(K051960_r(offset) * 0x1000000 + K051960_r(offset + 1) * 0x10000 + K051960_r(offset + 2) * 0x100 + K051960_r(offset + 3)); + } + return result; + } + public static void MWriteByte_thndrx2(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value); + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x300000 && address <= 0x30001f) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053251_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x400000 && address <= 0x400001) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053260.k053260_0_lsb_w2(0, (byte)value); + } + } + else if (address >= 0x500000 && address <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K054000_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x500100 && address <= 0x500101) + { + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + thndrx2_eeprom_w2((byte)value); + } + } + else if (address >= 0x500300 && address <= 0x500301) + { + int offset = (address - 0x500300) / 2; + //NOP + } + else if (address >= 0x600000 && address <= 0x607fff) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_noA12_w2(offset, (byte)value); + } + } + else if (address >= 0x700000 && address <= 0x700007) + { + int offset = address - 0x700000; + K051937_w(offset, (byte)value); + } + else if (address >= 0x700400 && address <= 0x7007ff) + { + int offset = address - 0x700400; + K051960_w(offset, (byte)value); + } + } + public static void MWriteWord_thndrx2(int address, short value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x300000 && address + 1 <= 0x30001f) + { + int offset = (address - 0x300000) / 2; + K053251_lsb_w(offset, (ushort)value); + } + else if (address >= 0x400000 && address + 1 <= 0x400001) + { + K053260.k053260_0_lsb_w(0, (ushort)value); + } + else if (address >= 0x500000 && address + 1 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + K054000_lsb_w(offset, (ushort)value); + } + else if (address >= 0x500100 && address + 1 <= 0x500101) + { + int offset = (address - 0x500100) / 2; + thndrx2_eeprom_w((ushort)value); + } + else if (address >= 0x500300 && address + 1 <= 0x500301) + { + int offset = (address - 0x500300) / 2; + //NOP + } + else if (address >= 0x600000 && address + 1 <= 0x607fff) + { + int offset = (address - 0x600000) / 2; + K052109_word_noA12_w(offset, (ushort)value); + } + else if (address >= 0x700000 && address + 1 <= 0x700007) + { + int offset = address - 0x700000; + K051937_w(offset, (byte)(value >> 8)); + K051937_w(offset + 1, (byte)value); + } + else if (address >= 0x700400 && address + 1 <= 0x7007ff) + { + int offset = address - 0x700400; + K051960_w(offset, (byte)(value >> 8)); + K051960_w(offset + 1, (byte)value); + } + } + public static void MWriteLong_thndrx2(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x300000 && address + 3 <= 0x30001f) + { + int offset = (address - 0x300000) / 2; + K053251_lsb_w(offset, (ushort)(value >> 16)); + K053251_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x500000 && address + 3 <= 0x50003f) + { + int offset = (address - 0x500000) / 2; + K054000_lsb_w(offset, (ushort)(value >> 16)); + K054000_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x600000 && address + 3 <= 0x607fff) + { + int offset = (address - 0x600000) / 2; + K052109_word_noA12_w(offset, (ushort)(value >> 16)); + K052109_word_noA12_w(offset + 1, (ushort)value); + } + else if (address >= 0x700000 && address + 3 <= 0x700007) + { + int offset = address - 0x700000; + K051937_w(offset, (byte)(value >> 24)); + K051937_w(offset + 1, (byte)(value >> 16)); + K051937_w(offset + 2, (byte)(value >> 8)); + K051937_w(offset + 3, (byte)value); + } + else if (address >= 0x700400 && address + 3 <= 0x7007ff) + { + int offset = address - 0x700400; + K051960_w(offset, (byte)(value >> 24)); + K051960_w(offset + 1, (byte)(value >> 16)); + K051960_w(offset + 2, (byte)(value >> 8)); + K051960_w(offset + 3, (byte)value); + } + } + public static sbyte MReadOpByte_prmrsocr(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + return result; + } + public static sbyte MReadByte_prmrsocr(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x104000 && address <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053245_scattered_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053245_scattered_word_r(offset); + } + } + else if (address >= 0x108000 && address <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x10c000 && address <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K053936_0_linectrl[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K053936_0_linectrl[offset]; + } + } + else if (address >= 0x114000 && address <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + if (address % 2 == 0) + { + result = (sbyte)0; + } + else if (address % 2 == 1) + { + result = (sbyte)K053244_lsb_r(offset); + } + } + else if (address >= 0x120000 && address <= 0x120001) + { + if (address % 2 == 0) + { + result = (sbyte)(prmrsocr_IN0_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)prmrsocr_IN0_r(); + } + } + else if (address >= 0x120002 && address <= 0x120003) + { + if (address % 2 == 0) + { + result = (sbyte)(prmrsocr_eeprom_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)prmrsocr_eeprom_r(); + } + } + else if (address >= 0x121014 && address <= 0x121015) + { + if (address % 2 == 0) + { + result = (sbyte)(prmrsocr_sound_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)prmrsocr_sound_r(); + } + } + else if (address >= 0x200000 && address <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(K052109_word_noA12_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)K052109_word_noA12_r(offset); + } + } + else if (address >= 0x300000 && address <= 0x33ffff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)prmrsocr_rom_r1(offset); + } + else if (address % 2 == 1) + { + result = (sbyte)prmrsocr_rom_r2(offset); + } + } + return result; + } + public static short MReadOpWord_prmrsocr(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + return result; + } + public static short MReadWord_prmrsocr(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + result = (short)K053245_scattered_word_r(offset); + } + else if (address >= 0x108000 && address + 1 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x10c000 && address + 1 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + result = (short)K053936_0_linectrl[offset]; + } + else if (address >= 0x114000 && address + 1 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + result = (short)K053244_lsb_r(offset); + } + else if (address >= 0x120000 && address + 1 <= 0x120001) + { + int offset = (address - 0x120000) / 2; + result = (short)prmrsocr_IN0_r(); + } + else if (address >= 0x120002 && address + 1 <= 0x120003) + { + int offset = (address - 0x120002) / 2; + result = (short)prmrsocr_eeprom_r(); + } + else if (address >= 0x121014 && address + 1 <= 0x121015) + { + int offset = (address - 0x121014) / 2; + result = (short)prmrsocr_sound_r(); + } + else if (address >= 0x200000 && address + 1 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + result = (short)K052109_word_noA12_r(offset); + } + else if (address >= 0x300000 && address + 1 <= 0x33ffff) + { + int offset = (address - 0x300000) / 2; + result = (short)prmrsocr_rom_r(offset); + } + return result; + } + public static int MReadOpLong_prmrsocr(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + return result; + } + public static int MReadLong_prmrsocr(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + result = (int)(K053245_scattered_word_r(offset) * 0x10000 + K053245_scattered_word_r(offset + 1)); + } + else if (address >= 0x108000 && address + 3 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x10c000 && address + 3 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + result = (int)(K053936_0_linectrl[offset] * 0x10000 + K053936_0_linectrl[offset + 1]); + } + else if (address >= 0x114000 && address + 3 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + result = (int)(K053244_lsb_r(offset) * 0x10000 + K053244_lsb_r(offset + 1)); + } + else if (address >= 0x200000 && address + 3 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(K052109_word_noA12_r(offset) * 0x10000 + K052109_word_noA12_r(offset + 1)); + } + else if (address >= 0x300000 && address + 3 <= 0x33ffff) + { + int offset = (address - 0x300000) / 2; + result = (int)(prmrsocr_rom_r(offset) * 0x10000 + prmrsocr_rom_r(offset + 1)); + } + return result; + } + public static void MWriteByte_prmrsocr(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x100000 && address <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value); + } + else if (address >= 0x104000 && address <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + if (address % 2 == 0) + { + K053245_scattered_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053245_scattered_word_w2(offset, (byte)value); + } + } + else if (address >= 0x108000 && address <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w2(offset, (byte)value); + } + } + else if (address >= 0x10c000 && address <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + if (address % 2 == 0) + { + K053936_0_linectrl[offset] = (ushort)(((byte)value << 8) | (K053936_0_linectrl[offset] & 0xff)); + } + else if (address % 2 == 1) + { + K053936_0_linectrl[offset] = (ushort)((K053936_0_linectrl[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x110000 && address <= 0x11001f) + { + int offset = (address - 0x110000) / 2; + if (address % 2 == 0) + { + K053244_word_noA1_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K053244_word_noA1_w2(offset, (byte)value); + } + } + else if (address >= 0x114000 && address <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + K053244_lsb_w2(offset, (byte)value); + } + } + else if (address >= 0x118000 && address <= 0x11801f) + { + int offset = (address - 0x118000) / 2; + if (address % 2 == 0) + { + K053936_0_ctrl[offset] = (ushort)(((byte)value << 8) | (K053936_0_ctrl[offset] & 0xff)); + } + else if (address % 2 == 1) + { + K053936_0_ctrl[offset] = (ushort)((K053936_0_ctrl[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x11c000 && address <= 0x11c01f) + { + int offset = (address - 0x11c000) / 2; + if (address % 2 == 0) + { + K053251_msb_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + + } + } + else if (address >= 0x12100c && address <= 0x12100f) + { + int offset = (address - 0x12100c) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + prmrsocr_sound_cmd_w2(offset, (byte)value); + } + } + else if (address >= 0x122000 && address <= 0x122001) + { + if (address % 2 == 0) + { + prmrsocr_eeprom_w1((byte)value); + } + else if (address % 2 == 1) + { + prmrsocr_eeprom_w2((byte)value); + } + } + else if (address >= 0x123000 && address <= 0x123001) + { + prmrsocr_sound_irq_w(); + } + else if (address >= 0x200000 && address <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + K052109_word_noA12_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + K052109_word_noA12_w2(offset, (byte)value); + } + } + else if (address >= 0x280000 && address <= 0x280001) + { + Generic.watchdog_reset16_w(); + } + } + public static void MWriteWord_prmrsocr(int address, short value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 1 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x104000 && address + 1 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + K053245_scattered_word_w(offset, (ushort)value); + } + else if (address >= 0x108000 && address + 1 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)value); + } + else if (address >= 0x10c000 && address + 1 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + K053936_0_linectrl[offset] = (ushort)value; + } + else if (address >= 0x110000 && address + 1 <= 0x11001f) + { + int offset = (address - 0x110000) / 2; + K053244_word_noA1_w(offset, (ushort)value); + } + else if (address >= 0x114000 && address + 1 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + K053244_lsb_w(offset, (ushort)value); + } + else if (address >= 0x118000 && address + 1 <= 0x11801f) + { + int offset = (address - 0x118000) / 2; + K053936_0_ctrl[offset] = (ushort)value; + } + else if (address >= 0x11c000 && address + 1 <= 0x11c01f) + { + int offset = (address - 0x11c000) / 2; + K053251_msb_w(offset, (ushort)value); + } + else if (address >= 0x12100c && address + 1 <= 0x12100f) + { + int offset = (address - 0x12100c) / 2; + prmrsocr_sound_cmd_w(offset, (ushort)value); + } + else if (address >= 0x122000 && address + 1 <= 0x122001) + { + prmrsocr_eeprom_w((ushort)value); + } + else if (address >= 0x123000 && address + 1 <= 0x123001) + { + prmrsocr_sound_irq_w(); + } + else if (address >= 0x200000 && address + 1 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + K052109_word_noA12_w(offset, (ushort)value); + } + else if (address >= 0x280000 && address + 1 <= 0x280001) + { + Generic.watchdog_reset16_w(); + } + } + public static void MWriteLong_prmrsocr(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x103fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x104000 && address + 3 <= 0x107fff) + { + int offset = (address - 0x104000) / 2; + K053245_scattered_word_w(offset, (ushort)(value >> 16)); + K053245_scattered_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x108000 && address + 3 <= 0x108fff) + { + int offset = (address - 0x108000) / 2; + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x10c000 && address + 3 <= 0x10cfff) + { + int offset = (address - 0x10c000) / 2; + K053936_0_linectrl[offset] = (ushort)(value >> 16); + K053936_0_linectrl[offset + 1] = (ushort)value; + } + else if (address >= 0x110000 && address + 3 <= 0x11001f) + { + int offset = (address - 0x110000) / 2; + K053244_word_noA1_w(offset, (ushort)(value >> 16)); + K053244_word_noA1_w(offset + 1, (ushort)value); + } + else if (address >= 0x114000 && address + 3 <= 0x11401f) + { + int offset = (address - 0x114000) / 2; + K053244_lsb_w(offset, (ushort)(value >> 16)); + K053244_lsb_w(offset + 1, (ushort)value); + } + else if (address >= 0x118000 && address + 3 <= 0x11801f) + { + int offset = (address - 0x118000) / 2; + K053936_0_ctrl[offset] = (ushort)(value >> 16); + K053936_0_ctrl[offset + 1] = (ushort)value; + } + else if (address >= 0x11c000 && address + 3 <= 0x11c01f) + { + int offset = (address - 0x11c000) / 2; + K053251_msb_w(offset, (ushort)(value >> 16)); + K053251_msb_w(offset + 1, (ushort)value); + } + else if (address >= 0x12100c && address + 3 <= 0x12100f) + { + int offset = (address - 0x12100c) / 2; + prmrsocr_sound_cmd_w(offset, (ushort)(value >> 16)); + prmrsocr_sound_cmd_w(offset + 1, (ushort)value); + } + else if (address >= 0x200000 && address + 3 <= 0x207fff) + { + int offset = (address - 0x200000) / 2; + K052109_word_noA12_w(offset, (ushort)(value >> 16)); + K052109_word_noA12_w(offset + 1, (ushort)value); + } + } + public static byte ZReadOp_glfgreat(ushort address) + { + byte result = 0; + if (address <= 0xefff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_glfgreat(ushort address) + { + byte result = 0; + if (address <= 0xefff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else if (address >= 0xf800 && address <= 0xf82f) + { + int offset = address - 0xf800; + result = K053260.k053260_0_r(offset); + } + return result; + } + public static void ZWriteMemory_glfgreat(ushort address, byte value) + { + if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + Memory.audioram[offset] = value; + } + else if (address >= 0xf800 && address <= 0xf82f) + { + int offset = address - 0xf800; + K053260.k053260_0_w(offset, value); + } + else if (address == 0xfa00) + { + sound_arm_nmi_w(); + } + } + public static byte ZReadOp_thndrx2(ushort address) + { + byte result = 0; + if (address <= 0xefff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_thndrx2(ushort address) + { + byte result = 0; + if (address <= 0xefff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + result = Memory.audioram[offset]; + } + else if (address == 0xf801 || address == 0xf811) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0xfc00 && address <= 0xfc2f) + { + int offset = address - 0xfc00; + result = K053260.k053260_0_r(offset); + } + return result; + } + public static void ZWriteMemory_thndrx2(ushort address, byte value) + { + if (address >= 0xf000 && address <= 0xf7ff) + { + int offset = address - 0xf000; + Memory.audioram[offset] = value; + } + else if (address == 0xf800 || address == 0xf810) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0xf801 || address == 0xf811) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address == 0xfa00) + { + sound_arm_nmi_w(); + } + else if (address >= 0xfc00 && address <= 0xfc2f) + { + int offset = address - 0xfc00; + K053260.k053260_0_w(offset, value); + } + } + public static byte ZReadOp_prmrsocr(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.audiorom[basebanksnd + offset]; + } + else if (address >= 0xc000 && address <= 0xdfff) + { + int offset = address - 0xc000; + result = Memory.audioram[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory_prmrsocr(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.audiorom[basebanksnd + offset]; + } + else if (address >= 0xc000 && address <= 0xdfff) + { + int offset = address - 0xc000; + result = Memory.audioram[offset]; + } + else if (address >= 0xe000 && address <= 0xe0ff) + { + int offset = address - 0xe000; + result = K054539.k054539_0_r(offset); + } + else if (address >= 0xe100 && address <= 0xe12f) + { + int offset = address - 0xe100; + result = k054539_0_ctrl_r(offset); + } + else if (address == 0xf002) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address == 0xf003) + { + result = (byte)Sound.soundlatch2_r(); + } + return result; + } + public static void ZWriteMemory_prmrsocr(ushort address, byte value) + { + if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + Memory.audiorom[basebanksnd + offset] = value; + } + else if (address >= 0xc000 && address <= 0xdfff) + { + int offset = address - 0xc000; + Memory.audioram[offset] = value; + } + else if (address >= 0xe000 && address <= 0xe0ff) + { + int offset = address - 0xe000; + K054539.k054539_0_w(offset, value); + } + else if (address >= 0xe100 && address <= 0xe12f) + { + int offset = address - 0xe100; + k054539_0_ctrl_w(offset, value); + } + else if (address == 0xf000) + { + Sound.soundlatch3_w((ushort)value); + } + else if (address == 0xf800) + { + prmrsocr_audio_bankswitch_w(value); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory2.cs.meta new file mode 100644 index 00000000..3ae5beb2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 295c4e202a3694c4591684950343af27 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/State.cs new file mode 100644 index 00000000..309a56b1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/State.cs @@ -0,0 +1,1244 @@ +using cpu.m68000; +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Konami68000 + { + public static void SaveStateBinary_cuebrick(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(dsw3); + writer.Write(cuebrick_snd_irqlatch); + writer.Write(cuebrick_nvram_bank); + for (i = 0; i < 0x8000; i++) + { + writer.Write(cuebrick_nvram[i]); + } + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K051960(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + writer.Write(mainram2, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_cuebrick(BinaryReader reader) + { + int i; + dsw1 = reader.ReadByte(); + dsw2 = reader.ReadByte(); + dsw3 = reader.ReadByte(); + cuebrick_snd_irqlatch = reader.ReadInt32(); + cuebrick_nvram_bank = reader.ReadInt32(); + for (i = 0; i < 0x8000; i++) + { + cuebrick_nvram[i] = reader.ReadUInt16(); + } + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K051960(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + mainram2_set = reader.ReadBytes(0x4000); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_mia(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(dsw3); + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K051960(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + writer.Write(mainram2, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K007232.SaveStateBinary(writer); + for (i = 0; i < 1; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 1; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k007232stream.output_sampindex); + writer.Write(Sound.k007232stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_mia(BinaryReader reader) + { + int i; + dsw1 = reader.ReadByte(); + dsw2 = reader.ReadByte(); + dsw3 = reader.ReadByte(); + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K051960(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + mainram2_set = reader.ReadBytes(0x4000); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K007232.LoadStateBinary(reader); + for (i = 0; i < 1; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 1; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k007232stream.output_sampindex = reader.ReadInt32(); + Sound.k007232stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_tmnt(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(dsw3); + writer.Write(tmnt_soundlatch); + for (i = 0; i < 0x40000; i++) + { + writer.Write(sampledata[i]); + } + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K051960(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K007232.SaveStateBinary(writer); + Upd7759.SaveStateBinary(writer); + Sample.SaveStateBinary(writer); + for (i = 0; i < 1; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 1; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k007232stream.output_sampindex); + writer.Write(Sound.k007232stream.output_base_sampindex); + writer.Write(Sound.upd7759stream.output_sampindex); + writer.Write(Sound.upd7759stream.output_base_sampindex); + writer.Write(Sound.samplestream.output_sampindex); + writer.Write(Sound.samplestream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_tmnt(BinaryReader reader) + { + int i; + dsw1 = reader.ReadByte(); + dsw2 = reader.ReadByte(); + dsw3 = reader.ReadByte(); + tmnt_soundlatch = reader.ReadInt32(); + for (i = 0; i < 0x40000; i++) + { + sampledata[i] = reader.ReadInt16(); + } + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K051960(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K007232.LoadStateBinary(reader); + Upd7759.LoadStateBinary(reader); + Sample.LoadStateBinary(reader); + for (i = 0; i < 1; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 1; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k007232stream.output_sampindex = reader.ReadInt32(); + Sound.k007232stream.output_base_sampindex = reader.ReadInt32(); + Sound.upd7759stream.output_sampindex = reader.ReadInt32(); + Sound.upd7759stream.output_base_sampindex = reader.ReadInt32(); + Sound.samplestream.output_sampindex = reader.ReadInt32(); + Sound.samplestream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_punkshot(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(dsw3); + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K051960(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K053260.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k053260stream.output_sampindex); + writer.Write(Sound.k053260stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_punkshot(BinaryReader reader) + { + int i; + dsw1 = reader.ReadByte(); + dsw2 = reader.ReadByte(); + dsw3 = reader.ReadByte(); + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K051960(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K053260.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_lgtnfght(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(dsw3); + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K053245(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K053260.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k053260stream.output_sampindex); + writer.Write(Sound.k053260stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_lgtnfght(BinaryReader reader) + { + int i; + dsw1 = reader.ReadByte(); + dsw2 = reader.ReadByte(); + dsw3 = reader.ReadByte(); + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K053245(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K053260.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_blswhstl(BinaryWriter writer) + { + int i; + writer.Write(bytee); + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K053245(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K053260.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k053260stream.output_sampindex); + writer.Write(Sound.k053260stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Eeprom.SaveStateBinary(writer); + } + public static void LoadStateBinary_blswhstl(BinaryReader reader) + { + int i; + bytee = reader.ReadByte(); + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K053245(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K053260.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Eeprom.LoadStateBinary(reader); + } + public static void SaveStateBinary_glfgreat(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(dsw3); + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K053245(writer); + SaveStateBinary_K053936(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + K053260.SaveStateBinary(writer); + writer.Write(Sound.k053260stream.output_sampindex); + writer.Write(Sound.k053260stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_glfgreat(BinaryReader reader) + { + int i; + dsw1 = reader.ReadByte(); + dsw2 = reader.ReadByte(); + dsw3 = reader.ReadByte(); + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K053245(reader); + LoadStateBinary_K053936(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + K053260.LoadStateBinary(reader); + Sound.k053260stream.output_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_tmnt2(BinaryWriter writer) + { + int i; + for (i = 0; i < 0x10; i++) + { + writer.Write(tmnt2_1c0800[i]); + } + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K053245(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + writer.Write(mainram2, 0, 0x80); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K053260.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k053260stream.output_sampindex); + writer.Write(Sound.k053260stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Eeprom.SaveStateBinary(writer); + } + public static void LoadStateBinary_tmnt2(BinaryReader reader) + { + int i; + for (i = 0; i < 0x10; i++) + { + tmnt2_1c0800[i] = reader.ReadUInt16(); + } + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K053245(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + mainram2_set = reader.ReadBytes(0x80); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K053260.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Eeprom.LoadStateBinary(reader); + } + public static void SaveStateBinary_ssriders(BinaryWriter writer) + { + int i; + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K053245(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + writer.Write(mainram2, 0, 0x80); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K053260.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k053260stream.output_sampindex); + writer.Write(Sound.k053260stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Eeprom.SaveStateBinary(writer); + } + public static void LoadStateBinary_ssriders(BinaryReader reader) + { + int i; + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K053245(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + mainram2_set = reader.ReadBytes(0x80); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K053260.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Eeprom.LoadStateBinary(reader); + } + public static void SaveStateBinary_thndrx2(BinaryWriter writer) + { + int i; + writer.Write(bytee); + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K051960(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + K053260.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.k053260stream.output_sampindex); + writer.Write(Sound.k053260stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Eeprom.SaveStateBinary(writer); + } + public static void LoadStateBinary_thndrx2(BinaryReader reader) + { + int i; + bytee = reader.ReadByte(); + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K051960(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + K053260.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_sampindex = reader.ReadInt32(); + Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Eeprom.LoadStateBinary(reader); + } + public static void SaveStateBinary_prmrsocr(BinaryWriter writer) + { + int i; + writer.Write(basebanksnd); + writer.Write(init_eeprom_count); + writer.Write(toggle); + writer.Write(dim_c); + writer.Write(dim_v); + writer.Write(lastdim); + writer.Write(lasten); + writer.Write(sprite_colorbase); + writer.Write(bg_colorbase); + for (i = 0; i < 3; i++) + { + writer.Write(layer_colorbase[i]); + } + SaveStateBinary_K053251(writer); + SaveStateBinary_K052109(writer); + SaveStateBinary_K053245(writer); + SaveStateBinary_K053936(writer); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x2000); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + K054539.SaveStateBinary(writer); + for (i = 0; i < 3; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 3; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(Sound.k054539stream.output_sampindex); + writer.Write(Sound.k054539stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Eeprom.SaveStateBinary(writer); + } + public static void LoadStateBinary_prmrsocr(BinaryReader reader) + { + int i; + basebanksnd = reader.ReadInt32(); + init_eeprom_count = reader.ReadInt32(); + toggle = reader.ReadInt32(); + dim_c = reader.ReadInt32(); + dim_v = reader.ReadInt32(); + lastdim = reader.ReadInt32(); + lasten = reader.ReadInt32(); + sprite_colorbase = reader.ReadInt32(); + bg_colorbase = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + layer_colorbase[i] = reader.ReadInt32(); + } + LoadStateBinary_K053251(reader); + LoadStateBinary_K052109(reader); + LoadStateBinary_K053245(reader); + LoadStateBinary_K053936(reader); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x800; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x2000)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + K054539.LoadStateBinary(reader); + for (i = 0; i < 3; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 3; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + Sound.k054539stream.output_sampindex = reader.ReadInt32(); + Sound.k054539stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Eeprom.LoadStateBinary(reader); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/State.cs.meta new file mode 100644 index 00000000..a85839e3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9698a73e328938a4095c8ec4545b00ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Tilemap.cs new file mode 100644 index 00000000..27d8ac73 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Tilemap.cs @@ -0,0 +1,283 @@ +using System; + +namespace MAME.Core +{ + public partial class Konami68000 + { + public static Tmap[] K052109_tilemap, K053251_tilemaps; + public static void tilemap_init() + { + + } + } + public unsafe partial class Tmap + { + public void tilemap_draw_instanceKonami68000(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + { + continue; + } + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x200 + xpos + x_start, x_end - x_start); + if (priority != 0) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = pixmap[offsety2 * width + i - xpos]; + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tile_updateKonami68000_0(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + int flipy = 0; + tile_index = row * cols + col; + code = Konami68000.K052109_ram[Konami68000.K052109_videoram_F_offset + tile_index] + 256 * Konami68000.K052109_ram[Konami68000.K052109_videoram2_F_offset + tile_index]; + color = Konami68000.K052109_ram[Konami68000.K052109_colorram_F_offset + tile_index]; + int flags = 0; + int priority = 0; + int bank = Konami68000.K052109_charrombank[(color & 0x0c) >> 2]; + if (Konami68000.has_extra_video_ram != 0) + { + bank = (color & 0x0c) >> 2; + } + color = (color & 0xf3) | ((bank & 0x03) << 2); + bank >>= 2; + flipy = color & 0x02; + int code2, color2, flags2; + Konami68000.K052109_callback(0, bank, code, color, flags, priority, out code2, out color2, out flags2); + code = code2; + color = color2; + flags = flags2; + if ((Konami68000.K052109_tileflip_enable & 1) == 0) + { + flags &= ~0x01; + } + if (flipy != 0 && (Konami68000.K052109_tileflip_enable & 2) != 0) + { + flags |= 0x02; + } + code = code % Konami68000.K052109_tilemap[0].total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x10 * color; + group = 0; + flags = flags ^ (attributes & 0x03); + tileflags[row, col] = tile_drawKonami68000(Konami68000.gfx12rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateKonami68000_1(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + int flipy = 0; + tile_index = row * cols + col; + code = Konami68000.K052109_ram[Konami68000.K052109_videoram_A_offset + tile_index] + 256 * Konami68000.K052109_ram[Konami68000.K052109_videoram2_A_offset + tile_index]; + color = Konami68000.K052109_ram[Konami68000.K052109_colorram_A_offset + tile_index]; + int flags = 0; + int priority = 0; + int bank = Konami68000.K052109_charrombank[(color & 0x0c) >> 2]; + if (Konami68000.has_extra_video_ram != 0) + { + bank = (color & 0x0c) >> 2; + } + color = (color & 0xf3) | ((bank & 0x03) << 2); + bank >>= 2; + flipy = color & 0x02; + int code2, color2, flags2; + Konami68000.K052109_callback(1, bank, code, color, flags, priority, out code2, out color2, out flags2); + code = code2; + color = color2; + flags = flags2; + if ((Konami68000.K052109_tileflip_enable & 1) == 0) + { + flags &= ~0x01; + } + if (flipy != 0 && (Konami68000.K052109_tileflip_enable & 2) != 0) + { + flags |= 0x02; + } + code = code % Konami68000.K052109_tilemap[1].total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x10 * color; + group = 0; + flags = flags ^ (attributes & 0x03); + tileflags[row, col] = tile_drawKonami68000(Konami68000.gfx12rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateKonami68000_2(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int tile_index; + int code, color; + int pen_data_offset, palette_base, group; + int flipy = 0; + tile_index = row * cols + col; + code = Konami68000.K052109_ram[Konami68000.K052109_videoram_B_offset + tile_index] + 256 * Konami68000.K052109_ram[Konami68000.K052109_videoram2_B_offset + tile_index]; + color = Konami68000.K052109_ram[Konami68000.K052109_colorram_B_offset + tile_index]; + int flags = 0; + int priority = 0; + int bank = Konami68000.K052109_charrombank[(color & 0x0c) >> 2]; + if (Konami68000.has_extra_video_ram != 0) + { + bank = (color & 0x0c) >> 2; + } + color = (color & 0xf3) | ((bank & 0x03) << 2); + bank >>= 2; + flipy = color & 0x02; + int code2, color2, flags2; + Konami68000.K052109_callback(2, bank, code, color, flags, priority, out code2, out color2, out flags2); + code = code2; + color = color2; + flags = flags2; + if ((Konami68000.K052109_tileflip_enable & 1) == 0) + { + flags &= ~0x01; + } + if (flipy != 0 && (Konami68000.K052109_tileflip_enable & 2) != 0) + { + flags |= 0x02; + } + code = code % Konami68000.K052109_tilemap[2].total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x10 * color; + group = 0; + flags = flags ^ (attributes & 0x03); + tileflags[row, col] = tile_drawKonami68000(Konami68000.gfx12rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public byte tile_drawKonami68000(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Tilemap.cs.meta new file mode 100644 index 00000000..39ebc762 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 434b80cfec2ad8c42919cda44df8e24b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Video.cs new file mode 100644 index 00000000..5ce57e08 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Video.cs @@ -0,0 +1,728 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Konami68000 + { + private static int[] layer_colorbase; + private static int sprite_colorbase, bg_colorbase; + private static int priorityflag; + private static int dim_c, dim_v; + private static int lastdim, lasten, last; + private static int[] layerpri, sorted_layer; + private static int blswhstl_rombank, glfgreat_pixel; + private static int glfgreat_roz_rom_bank, glfgreat_roz_char_bank, glfgreat_roz_rom_mode, prmrsocr_sprite_bank; + private static Tmap roz_tilemap; + public static void mia_tile_callback(int layer, int bank, int code, int color, int flags, int priority, out int code2, out int color2, out int flags2) + { + flags2 = (color & 0x04) != 0 ? 1 : 0; + if (layer == 0) + { + code2 = code | ((color & 0x01) << 8); + color2 = layer_colorbase[layer] + ((color & 0x80) >> 5) + ((color & 0x10) >> 1); + } + else + { + code2 = code | ((color & 0x01) << 8) | ((color & 0x18) << 6) | (bank << 11); + color2 = layer_colorbase[layer] + ((color & 0xe0) >> 5); + } + } + public static void cuebrick_tile_callback(int layer, int bank, int code, int color, int flags, int priority, out int code2, out int color2, out int flags2) + { + flags2 = flags; + if ((K052109_get_RMRD_line() == 0) && (layer == 0)) + { + code2 = code | ((color & 0x01) << 8); + color2 = layer_colorbase[layer] + ((color & 0x80) >> 5) + ((color & 0x10) >> 1); + } + else + { + code2 = code | ((color & 0xf) << 8); + color2 = layer_colorbase[layer] + ((color & 0xe0) >> 5); + } + } + public static void tmnt_tile_callback(int layer, int bank, int code, int color, int flags, int priority, out int code2, out int color2, out int flags2) + { + flags2 = flags; + code2 = code | ((color & 0x03) << 8) | ((color & 0x10) << 6) | ((color & 0x0c) << 9) | (bank << 13); + color2 = layer_colorbase[layer] + ((color & 0xe0) >> 5); + } + public static void blswhstl_tile_callback(int layer, int bank, int code, int color, int flags, int priority, out int code2, out int color2, out int flags2) + { + flags2 = flags; + code2 = code | ((color & 0x01) << 8) | ((color & 0x10) << 5) | ((color & 0x0c) << 8) | (bank << 12) | blswhstl_rombank << 14; + color2 = layer_colorbase[layer] + ((color & 0xe0) >> 5); + } + public static void mia_sprite_callback(int code, int color, int priority, int shadow, out int code2, out int color2, out int priority2) + { + code2 = code; + color2 = sprite_colorbase + (color & 0x0f); + priority2 = priority; + } + public static void tmnt_sprite_callback(int code, int color, int priority, int shadow, out int code2, out int color2, out int priority2) + { + code2 = code | ((color & 0x10) << 9); + color2 = sprite_colorbase + (color & 0x0f); + priority2 = priority; + } + public static void punkshot_sprite_callback(int code, int color, int priority, int shadow, out int code2, out int color2, out int priority_mask) + { + int pri = 0x20 | ((color & 0x60) >> 2); + if (pri <= layerpri[2]) + { + priority_mask = 0; + } + else if (pri > layerpri[2] && pri <= layerpri[1]) + { + priority_mask = 0xf0; + } + else if (pri > layerpri[1] && pri <= layerpri[0]) + { + priority_mask = 0xf0 | 0xcc; + } + else + { + priority_mask = 0xf0 | 0xcc | 0xaa; + } + code2 = code | ((color & 0x10) << 9); + color2 = sprite_colorbase + (color & 0x0f); + } + public static void thndrx2_sprite_callback(int code, int color, int proority, int shadow, out int code2, out int color2, out int priority_mask) + { + int pri = 0x20 | ((color & 0x60) >> 2); + if (pri <= layerpri[2]) + { + priority_mask = 0; + } + else if (pri > layerpri[2] && pri <= layerpri[1]) + { + priority_mask = 0xf0; + } + else if (pri > layerpri[1] && pri <= layerpri[0]) + { + priority_mask = 0xf0 | 0xcc; + } + else + { + priority_mask = 0xf0 | 0xcc | 0xaa; + } + code2 = code; + color2 = sprite_colorbase + (color & 0x0f); + } + public static void lgtnfght_sprite_callback(int code, int color, out int code2, out int color2, out int priority_mask) + { + int pri = 0x20 | ((color & 0x60) >> 2); + if (pri <= layerpri[2]) + { + priority_mask = 0; + } + else if (pri > layerpri[2] && pri <= layerpri[1]) + { + priority_mask = 0xf0; + } + else if (pri > layerpri[1] && pri <= layerpri[0]) + { + priority_mask = 0xf0 | 0xcc; + } + else + { + priority_mask = 0xf0 | 0xcc | 0xaa; + } + code2 = code; + color2 = sprite_colorbase + (color & 0x1f); + } + public static void blswhstl_sprite_callback(int code, int color, out int code2, out int color2, out int priority_mask) + { + int pri = 0x20 | ((color & 0x60) >> 2); + if (pri <= layerpri[2]) + { + priority_mask = 0; + } + else if (pri > layerpri[2] && pri <= layerpri[1]) + { + priority_mask = 0xf0; + } + else if (pri > layerpri[1] && pri <= layerpri[0]) + { + priority_mask = 0xf0 | 0xcc; + } + else + { + priority_mask = 0xf0 | 0xcc | 0xaa; + } + code2 = code; + color2 = sprite_colorbase + (color & 0x1f); + } + public static void prmrsocr_sprite_callback(int code, int color, out int code2, out int color2, out int priority_mask) + { + int pri = 0x20 | ((color & 0x60) >> 2); + if (pri <= layerpri[2]) + { + priority_mask = 0; + } + else if (pri > layerpri[2] && pri <= layerpri[1]) + { + priority_mask = 0xf0; + } + else if (pri > layerpri[1] && pri <= layerpri[0]) + { + priority_mask = 0xf0 | 0xcc; + } + else + { + priority_mask = 0xf0 | 0xcc | 0xaa; + } + code2 = code | (prmrsocr_sprite_bank << 14); + color2 = sprite_colorbase + (color & 0x1f); + } + + public static void video_start_tmnt() + { + layer_colorbase[0] = 0; + layer_colorbase[1] = 32; + layer_colorbase[2] = 40; + sprite_colorbase = 16; + K052109_vh_start(); + K051960_vh_start(); + } + public static void video_start_punkshot() + { + K053251_vh_start(); + K052109_vh_start(); + K051960_vh_start(); + } + public static void video_start_lgtnfght() + { + K053251_vh_start(); + K052109_vh_start(); + K053245_vh_start(); + K05324x_set_z_rejection(0); + dim_c = dim_v = lastdim = lasten = 0; + } + public static void video_start_blswhstl() + { + K053251_vh_start(); + K052109_vh_start(); + K053245_vh_start(); + } + public static void video_start_glfgreat() + { + K053251_vh_start(); + K052109_vh_start(); + K053245_vh_start(); + roz_tilemap = new Tmap(); + roz_tilemap.rows = 512; + roz_tilemap.cols = 512; + roz_tilemap.tilewidth = 16; + roz_tilemap.tileheight = 16; + roz_tilemap.width = roz_tilemap.cols * roz_tilemap.tilewidth; + roz_tilemap.height = roz_tilemap.rows * roz_tilemap.tileheight; + roz_tilemap.enable = true; + roz_tilemap.all_tiles_dirty = true; + roz_tilemap.scrollrows = 1; + roz_tilemap.scrollcols = 1; + //roz_tilemap = tilemap_create(glfgreat_get_roz_tile_info,tilemap_scan_rows,16,16,512,512); + //tilemap_set_transparent_pen(roz_tilemap,0); + K053936_wraparound_enable(0, 1); + K053936_set_offset(0, 85, 0); + } + public static void video_start_thndrx2() + { + K053251_vh_start(); + K052109_vh_start();// "k052109", NORMAL_PLANE_ORDER, tmnt_tile_callback); + K051960_vh_start();//, "k051960", NORMAL_PLANE_ORDER, thndrx2_sprite_callback); + } + public static void video_start_prmrsocr() + { + K053251_vh_start(); + K052109_vh_start();//, "k052109", NORMAL_PLANE_ORDER, tmnt_tile_callback); + K053245_vh_start();//, 0, "k053245", NORMAL_PLANE_ORDER, prmrsocr_sprite_callback); + //roz_tilemap = tilemap_create(prmrsocr_get_roz_tile_info, tilemap_scan_rows, 16, 16, 512, 256); + //tilemap_set_transparent_pen(roz_tilemap, 0); + K053936_wraparound_enable(0, 0); + K053936_set_offset(0, 85, 1); + } + public static void tmnt_paletteram_word_w(int offset, ushort data) + { + ushort data1; + Generic.paletteram16[offset] = data; + //COMBINE_DATA(paletteram16 + offset); + offset &= ~1; + data1 = (ushort)((Generic.paletteram16[offset] << 8) | Generic.paletteram16[offset + 1]); + Palette.palette_set_callback(offset / 2, Palette.make_rgb(Palette.pal5bit((byte)(data1 >> 0)), Palette.pal5bit((byte)(data1 >> 5)), Palette.pal5bit((byte)(data1 >> 10)))); + //palette_set_color_rgb(machine,offset / 2,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10)); + } + public static void tmnt_paletteram_word_w1(int offset, byte data) + { + ushort data1; + Generic.paletteram16[offset] = (ushort)((data << 8) | (Generic.paletteram16[offset] & 0xff)); + offset &= ~1; + data1 = (ushort)((Generic.paletteram16[offset] << 8) | Generic.paletteram16[offset + 1]); + Palette.palette_set_callback(offset / 2, Palette.make_rgb(Palette.pal5bit((byte)(data1 >> 0)), Palette.pal5bit((byte)(data1 >> 5)), Palette.pal5bit((byte)(data1 >> 10)))); + } + public static void tmnt_paletteram_word_w2(int offset, byte data) + { + ushort data1; + Generic.paletteram16[offset] = (ushort)((Generic.paletteram16[offset] & 0xff00) | data); + offset &= ~1; + data1 = (ushort)((Generic.paletteram16[offset] << 8) | Generic.paletteram16[offset + 1]); + Palette.palette_set_callback(offset / 2, Palette.make_rgb(Palette.pal5bit((byte)(data1 >> 0)), Palette.pal5bit((byte)(data1 >> 5)), Palette.pal5bit((byte)(data1 >> 10)))); + } + public static void tmnt_0a0000_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + if (last == 0x08 && (data & 0x08) == 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + //cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); + } + last = data & 0x08; + Generic.interrupt_enable_w((byte)(data & 0x20)); + K052109_set_RMRD_line((data & 0x80) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void tmnt_0a0000_w2(byte data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + if (last == 0x08 && (data & 0x08) == 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + last = data & 0x08; + Generic.interrupt_enable_w((byte)(data & 0x20)); + K052109_set_RMRD_line((data & 0x80) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void punkshot_0a0020_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + if (last == 0x04 && (data & 0x04) == 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + last = data & 0x04; + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void punkshot_0a0020_w2(byte data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + if (last == 0x04 && (data & 0x04) == 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + last = data & 0x04; + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void lgtnfght_0a0018_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + if (last == 0x00 && (data & 0x04) == 0x04) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + last = data & 0x04; + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void lgtnfght_0a0018_w2(byte data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + if (last == 0x00 && (data & 0x04) == 0x04) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.HOLD_LINE); + } + last = data & 0x04; + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void blswhstl_700300_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + if (blswhstl_rombank != ((data & 0x80) >> 7)) + { + blswhstl_rombank = (data & 0x80) >> 7; + //tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); + } + } + } + public static void blswhstl_700300_w2(byte data) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + if (blswhstl_rombank != ((data & 0x80) >> 7)) + { + blswhstl_rombank = (data & 0x80) >> 7; + //tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); + } + } + public static ushort glfgreat_rom_r(int offset) + { + if (glfgreat_roz_rom_mode != 0) + { + return zoomrom[glfgreat_roz_char_bank * 0x80000 + offset]; + } + else if (offset < 0x40000) + { + return (ushort)(user1rom[offset + 0x80000 + glfgreat_roz_rom_bank * 0x40000] + 256 * user1rom[offset + glfgreat_roz_rom_bank * 0x40000]); + } + else + { + return user1rom[((offset & 0x3ffff) >> 2) + 0x100000 + glfgreat_roz_rom_bank * 0x10000]; + } + } + public static void glfgreat_122000_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + K052109_set_RMRD_line((data & 0x10) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + if (glfgreat_roz_rom_bank != (data & 0x20) >> 5) + { + glfgreat_roz_rom_bank = (data & 0x20) >> 5; + roz_tilemap.all_tiles_dirty = true; + } + glfgreat_roz_char_bank = (data & 0xc0) >> 6; + } + //if (ACCESSING_BITS_8_15) + { + glfgreat_roz_rom_mode = data & 0x100; + } + } + public static void glfgreat_122000_w1(byte data) + { + glfgreat_roz_rom_mode = (data << 8) & 0x100; + } + public static void glfgreat_122000_w2(byte data) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + K052109_set_RMRD_line((data & 0x10) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + if (glfgreat_roz_rom_bank != (data & 0x20) >> 5) + { + glfgreat_roz_rom_bank = (data & 0x20) >> 5; + roz_tilemap.all_tiles_dirty = true; + } + glfgreat_roz_char_bank = (data & 0xc0) >> 6; + } + + public static void ssriders_1c0300_w(int offset, ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + dim_v = (data & 0x70) >> 4; + } + } + public static void ssriders_1c0300_w2(int offset, byte data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + K052109_set_RMRD_line((data & 0x08) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + dim_v = (data & 0x70) >> 4; + } + } + public static void prmrsocr_122000_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + K052109_set_RMRD_line((data & 0x10) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + prmrsocr_sprite_bank = (data & 0x40) >> 6; + K053244_bankselect(0, prmrsocr_sprite_bank << 2); + glfgreat_roz_char_bank = (data & 0x80) >> 7; + } + } + public static void prmrsocr_122000_w2(byte data) + { + K052109_set_RMRD_line((data & 0x10) != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + prmrsocr_sprite_bank = (data & 0x40) >> 6; + K053244_bankselect(0, prmrsocr_sprite_bank << 2); + glfgreat_roz_char_bank = (data & 0x80) >> 7; + } + public static ushort prmrsocr_rom_r(int offset) + { + ushort result; + if (glfgreat_roz_char_bank != 0) + { + result = (ushort)(zoomrom[offset] * 0x100 + zoomrom[offset + 1]);// memory_region(machine, "zoom")[offset]; + } + else + { + result = (ushort)(user1rom[offset] * 0x100 + user1rom[offset + 0x20000]); + } + return result; + } + public static byte prmrsocr_rom_r1(int offset) + { + byte result; + if (glfgreat_roz_char_bank != 0) + { + result = zoomrom[offset]; + } + else + { + result = user1rom[offset]; + } + return result; + } + public static byte prmrsocr_rom_r2(int offset) + { + byte result; + if (glfgreat_roz_char_bank != 0) + { + result = zoomrom[offset + 1]; + } + else + { + result = user1rom[offset + 0x20000]; + } + return result; + } + public static void tmnt_priority_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + priorityflag = (data & 0x0c) >> 2; + } + } + public static void tmnt_priority_w2(byte data) + { + priorityflag = (data & 0x0c) >> 2; + } + public static void swap(int[] layer, int[] pri, int a, int b) + { + if (pri[a] < pri[b]) + { + int t; + t = pri[a]; pri[a] = pri[b]; pri[b] = t; + t = layer[a]; layer[a] = layer[b]; layer[b] = t; + } + } + public static void sortlayers(int[] layer, int[] pri) + { + swap(layer, pri, 0, 1); + swap(layer, pri, 0, 2); + swap(layer, pri, 1, 2); + } + public static void video_update_mia() + { + K052109_tilemap_update(); + K052109_tilemap[2].tilemap_draw_primask(Video.screenstate.visarea, 0, 0); + if ((priorityflag & 1) == 1) + { + K051960_sprites_draw(Video.screenstate.visarea, 0, 0); + } + K052109_tilemap[1].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + if ((priorityflag & 1) == 0) + { + K051960_sprites_draw(Video.screenstate.visarea, 0, 0); + } + K052109_tilemap[0].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 0); + } + public static void video_update_punkshot() + { + int i; + bg_colorbase = K053251_get_palette_index(0); + sprite_colorbase = K053251_get_palette_index(1); + layer_colorbase[0] = K053251_get_palette_index(2); + layer_colorbase[1] = K053251_get_palette_index(4); + layer_colorbase[2] = K053251_get_palette_index(3); + K052109_tilemap_update(); + sorted_layer[0] = 0; + layerpri[0] = K053251_get_priority(2); + sorted_layer[1] = 1; + layerpri[1] = K053251_get_priority(4); + sorted_layer[2] = 2; + layerpri[2] = K053251_get_priority(3); + sortlayers(sorted_layer, layerpri); + Array.Clear(Tilemap.priority_bitmap, 0, 0x40000); + K052109_tilemap[sorted_layer[0]].tilemap_draw_primask(Video.screenstate.visarea, 0, 1); + K052109_tilemap[sorted_layer[1]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 2); + K052109_tilemap[sorted_layer[2]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 4); + K051960_sprites_draw(Video.screenstate.visarea, -1, -1); + } + public static void video_update_lgtnfght() + { + int i; + bg_colorbase = K053251_get_palette_index(0); + sprite_colorbase = K053251_get_palette_index(1); + layer_colorbase[0] = K053251_get_palette_index(2); + layer_colorbase[1] = K053251_get_palette_index(4); + layer_colorbase[2] = K053251_get_palette_index(3); + K052109_tilemap_update(); + sorted_layer[0] = 0; + layerpri[0] = K053251_get_priority(2); + sorted_layer[1] = 1; + layerpri[1] = K053251_get_priority(4); + sorted_layer[2] = 2; + layerpri[2] = K053251_get_priority(3); + sortlayers(sorted_layer, layerpri); + Array.Clear(Tilemap.priority_bitmap, 0, 0x40000); + for (i = 0; i < 0x20000; i++) + { + Video.bitmapbase_Ptrs[Video.curbitmap][i] = (ushort)(16 * bg_colorbase); + } + K052109_tilemap[sorted_layer[0]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 1); + K052109_tilemap[sorted_layer[1]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 2); + K052109_tilemap[sorted_layer[2]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 4); + K053245_sprites_draw(Video.screenstate.visarea); + } + public static ushort glfgreat_ball_r() + { + if (glfgreat_pixel < 0x400 || glfgreat_pixel >= 0x500) + { + return 0; + } + else + { + return (ushort)(glfgreat_pixel & 0xff); + } + } + public static void video_update_glfgreat() + { + int i; + K053251_set_tilemaps(null, null, K052109_tilemap[0], K052109_tilemap[1], K052109_tilemap[2]); + bg_colorbase = K053251_get_palette_index(0); + sprite_colorbase = K053251_get_palette_index(1); + layer_colorbase[0] = K053251_get_palette_index(2); + layer_colorbase[1] = K053251_get_palette_index(3) + 8; + layer_colorbase[2] = K053251_get_palette_index(4); + K052109_tilemap_update(); + sorted_layer[0] = 0; + layerpri[0] = K053251_get_priority(2); + sorted_layer[1] = 1; + layerpri[1] = K053251_get_priority(3); + sorted_layer[2] = 2; + layerpri[2] = K053251_get_priority(4); + sortlayers(sorted_layer, layerpri); + Array.Clear(Tilemap.priority_bitmap, 0, 0x40000); + for (i = 0; i < 0x20000; i++) + { + Video.bitmapbase_Ptrs[Video.curbitmap][i] = (ushort)(16 * bg_colorbase); + } + K052109_tilemap[sorted_layer[0]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 1); + if (layerpri[0] >= 0x30 && layerpri[1] < 0x30) + { + //K053936_0_zoom_draw(Video.screenstate.visarea, roz_tilemap, 0, 1); + //glfgreat_pixel = *BITMAP_ADDR16(bitmap, 0x80, 0x105); + } + K052109_tilemap[sorted_layer[1]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 2); + if (layerpri[1] >= 0x30 && layerpri[2] < 0x30) + { + //K053936_0_zoom_draw(Video.screenstate.visarea, roz_tilemap, 0, 1); + //glfgreat_pixel = *BITMAP_ADDR16(bitmap, 0x80, 0x105); + } + K052109_tilemap[sorted_layer[2]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 4); + if (layerpri[2] >= 0x30) + { + //K053936_0_zoom_draw(Video.screenstate.visarea, roz_tilemap, 0, 1); + //glfgreat_pixel = *BITMAP_ADDR16(bitmap, 0x80, 0x105); + } + K053245_sprites_draw(Video.screenstate.visarea); + } + + public static void video_update_tmnt2() + { + double brt; + int i, newdim, newen, cb, ce; + newdim = dim_v | ((~dim_c & 0x10) >> 1); + newen = (K053251_get_priority(5) != 0 && K053251_get_priority(5) != 0x3e) ? 1 : 0; + if (newdim != lastdim || newen != lasten) + { + brt = 1.0; + if (newen != 0) + { + brt -= (1.0 - 0.6) * newdim / 8; + } + lastdim = newdim; + lasten = newen; + cb = layer_colorbase[sorted_layer[2]] << 4; + ce = cb + 128; + /*for (i = 0; i < cb; i++) + { + palette_set_brightness(screen->machine, i, brt); + } + for (i = cb; i < ce; i++) + { + palette_set_brightness(screen->machine, i, 1.0); + } + for (i = ce; i < 2048; i++) + { + palette_set_brightness(screen->machine, i, brt); + } + if ((~dim_c & 0x10)!=0) + { + palette_set_shadow_mode(screen->machine, 1); + } + else + { + palette_set_shadow_mode(screen->machine, 0); + }*/ + } + video_update_lgtnfght(); + } + public static void video_update_thndrx2() + { + int i; + bg_colorbase = K053251_get_palette_index(0); + sprite_colorbase = K053251_get_palette_index(1); + layer_colorbase[0] = K053251_get_palette_index(2); + layer_colorbase[1] = K053251_get_palette_index(4); + layer_colorbase[2] = K053251_get_palette_index(3); + K052109_tilemap_update(); + sorted_layer[0] = 0; + layerpri[0] = K053251_get_priority(2); + sorted_layer[1] = 1; + layerpri[1] = K053251_get_priority(4); + sorted_layer[2] = 2; + layerpri[2] = K053251_get_priority(3); + sortlayers(sorted_layer, layerpri); + Array.Clear(Tilemap.priority_bitmap, 0, 0x40000); + for (i = 0; i < 0x20000; i++) + { + Video.bitmapbase_Ptrs[Video.curbitmap][i] = (ushort)(16 * bg_colorbase); + } + K052109_tilemap[sorted_layer[0]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 1); + K052109_tilemap[sorted_layer[1]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 2); + K052109_tilemap[sorted_layer[2]].tilemap_draw_primask(Video.screenstate.visarea, 0x10, 4); + K051960_sprites_draw(Video.screenstate.visarea, -1, -1); + } + public static void video_eof() + { + + } + public static void video_eof_blswhstl() + { + K053245_clear_buffer(0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Video.cs.meta new file mode 100644 index 00000000..5caf6d85 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/konami68000/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb2427cd8b85a76429562482c7cdfc9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72.meta new file mode 100644 index 00000000..d8e7ba37 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf3b97672a066d24b8ca7d065518fe11 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Audio.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Audio.cs new file mode 100644 index 00000000..2b1fa179 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Audio.cs @@ -0,0 +1,113 @@ +namespace MAME.Core +{ + public unsafe partial class M72 + { + public static int setvector_param; + public static byte irqvector; + public static int sample_addr; + public static void setvector_callback() + { + switch (setvector_param) + { + case 0: + irqvector = 0xff; + break; + case 1: + irqvector &= 0xef; + break; + case 2: + irqvector |= 0x10; + break; + case 3: + irqvector &= 0xdf; + break; + case 4: + irqvector |= 0x20; + break; + } + Cpuint.interrupt_vector[1, 0] = irqvector; + if (irqvector == 0xff) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.CLEAR_LINE); + } + else + { + Cpuint.cpunum_set_input_line(1, 0, LineState.ASSERT_LINE); + } + } + public static void machine_reset_m72_sound() + { + setvector_param = 0; + setvector_callback(); + } + public static void m72_ym2151_irq_handler(int irq) + { + if (irq != 0) + { + Cpuint.lvec.Add(new vec(1, EmuTimer.get_current_time())); + setvector_param = 1; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + else + { + Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time())); + setvector_param = 2; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + } + public static void m72_sound_command_w(int offset, ushort data) + { + //if (ACCESSING_BITS_0_7) + { + Sound.soundlatch_w(data); + Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); + setvector_param = 3; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + } + public static void m72_sound_command_byte_w(int offset, byte data) + { + Sound.soundlatch_w(data); + Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); + setvector_param = 3; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + public static void m72_sound_irq_ack_w(int offset, byte data) + { + Cpuint.lvec.Add(new vec(4, EmuTimer.get_current_time())); + setvector_param = 4; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + public static void m72_set_sample_start(int start) + { + sample_addr = start; + } + public static void rtype2_sample_addr_w(int offset, byte data) + { + sample_addr >>= 5; + if (offset == 1) + { + sample_addr = (sample_addr & 0x00ff) | ((data << 8) & 0xff00); + } + else + { + sample_addr = (sample_addr & 0xff00) | ((data << 0) & 0x00ff); + } + sample_addr <<= 5; + } + public static byte m72_sample_r() + { + return samplesrom[sample_addr]; + } + public static void m72_sample_w(byte data) + { + DAC.dac_signed_data_w(0, data); + sample_addr = (sample_addr + 1) & (samplesromLength - 1); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Audio.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Audio.cs.meta new file mode 100644 index 00000000..4b8f861a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Audio.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e1bf054ca7d49b40b555bc5ce310602 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Drawgfx.cs new file mode 100644 index 00000000..fc1c56a8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Drawgfx.cs @@ -0,0 +1,103 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_m72(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 0x10 - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x200) + { + ex = 0x200 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x10 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x11c) + { + ey = 0x11c - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 0x10 * color; + blockmove_8toN_transpen16_m72(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx); + } + public static void blockmove_8toN_transpen16_m72(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsety, int offsetx) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * 0x100; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * 0x10; + ydir = -1; + } + else + { + srcdata_offset += topskip * 0x10; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Drawgfx.cs.meta new file mode 100644 index 00000000..640b71f3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce0b84c1923dce943b65960895f05374 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Input.cs new file mode 100644 index 00000000..5e814b63 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Input.cs @@ -0,0 +1,225 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class M72 + { + public static void loop_inputports_m72_common() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + ushort1 &= unchecked((ushort)~0x0004); + } + else + { + ushort1 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + ushort1 &= unchecked((ushort)~0x0008); + } + else + { + ushort1 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + ushort1 &= unchecked((ushort)~0x0001); + } + else + { + ushort1 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + ushort1 &= unchecked((ushort)~0x0002); + } + else + { + ushort1 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + ushort0 &= unchecked((ushort)~0x0001); + } + else + { + ushort0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + ushort0 &= unchecked((ushort)~0x0002); + } + else + { + ushort0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + ushort0 &= unchecked((ushort)~0x0004); + } + else + { + ushort0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + ushort0 &= unchecked((ushort)~0x0008); + } + else + { + ushort0 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + ushort0 &= unchecked((ushort)~0x0080); + } + else + { + ushort0 |= 0x0080; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + ushort0 &= unchecked((ushort)~0x0040); + } + else + { + ushort0 |= 0x0040; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + ushort0 &= unchecked((ushort)~0x0020); + } + else + { + ushort0 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + ushort0 &= unchecked((ushort)~0x0010); + } + else + { + ushort0 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + ushort0 &= unchecked((ushort)~0x0100); + } + else + { + ushort0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + ushort0 &= unchecked((ushort)~0x0200); + } + else + { + ushort0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + ushort0 &= unchecked((ushort)~0x0400); + } + else + { + ushort0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + ushort0 &= unchecked((ushort)~0x0800); + } + else + { + ushort0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + ushort0 &= unchecked((ushort)~0x8000); + } + else + { + ushort0 |= 0x8000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + ushort0 &= unchecked((ushort)~0x4000); + } + else + { + ushort0 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + ushort0 &= unchecked((ushort)~0x2000); + } + else + { + ushort0 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + ushort0 &= unchecked((ushort)~0x1000); + } + else + { + ushort0 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + ushort1 &= unchecked((ushort)~0x0010); + } + else + { + ushort1 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + ushort1 &= unchecked((ushort)~0x0020); + } + else + { + ushort1 |= 0x0020; + } + } + public static void record_port() + { + if (ushort0 != ushort0_old || ushort1 != ushort1_old) + { + ushort0_old = ushort0; + ushort1_old = ushort1; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(ushort0); + Mame.bwRecord.Write(ushort1); + } + } + public static void replay_port() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + ushort0_old = Mame.brRecord.ReadUInt16(); + ushort1_old = Mame.brRecord.ReadUInt16(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + ushort0 = ushort0_old; + ushort1 = ushort1_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Input.cs.meta new file mode 100644 index 00000000..1b896b7f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 15660408fdac4c74d96c7cb7c5e6c210 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/M72.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/M72.cs new file mode 100644 index 00000000..48509fcd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/M72.cs @@ -0,0 +1,335 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class M72 + { + public static byte[] protection_ram; + public static EmuTimer.emu_timer scanline_timer; + public static byte m72_irq_base; + public static int m72_scanline_param; + + //public static byte[] spritesrom, sprites1rom, samplesrom /*,gfx2rom,*/ /*gfx21rom,*/ /*gfx3rom/*, gfx31rom*/; + + + #region //指针化 spritesrom + static byte[] spritesrom_src; + static GCHandle spritesrom_handle; + public static byte* spritesrom; + public static int spritesromLength; + public static bool spritesrom_IsNull => spritesrom == null; + public static byte[] spritesrom_set + { + set + { + spritesrom_handle.ReleaseGCHandle(); + if (value == null) + return; + spritesrom_src = value; + spritesromLength = value.Length; + spritesrom_src.GetObjectPtr(ref spritesrom_handle, ref spritesrom); + } + } + #endregion + + + #region //指针化 sprites1rom + static byte[] sprites1rom_src; + static GCHandle sprites1rom_handle; + public static byte* sprites1rom; + public static int sprites1romLength; + public static bool sprites1rom_IsNull => sprites1rom == null; + public static byte[] sprites1rom_set + { + set + { + sprites1rom_handle.ReleaseGCHandle(); + if (value == null) + return; + sprites1rom_src = value; + sprites1romLength = value.Length; + sprites1rom_src.GetObjectPtr(ref sprites1rom_handle, ref sprites1rom); + } + } + #endregion + + #region //指针化 samplesrom + static byte[] samplesrom_src; + static GCHandle samplesrom_handle; + public static byte* samplesrom; + public static int samplesromLength; + public static bool samplesrom_IsNull => samplesrom == null; + public static byte[] samplesrom_set + { + set + { + samplesrom_handle.ReleaseGCHandle(); + if (value == null) + return; + samplesrom_src = value; + samplesromLength = value.Length; + samplesrom_src.GetObjectPtr(ref samplesrom_handle, ref samplesrom); + } + } + #endregion + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + + #region //指针化 gfx21rom + static byte[] gfx21rom_src; + static GCHandle gfx21rom_handle; + public static byte* gfx21rom; + public static int gfx21romLength; + public static bool gfx21rom_IsNull => gfx21rom == null; + public static byte[] gfx21rom_set + { + set + { + gfx21rom_handle.ReleaseGCHandle(); + gfx21rom_src = value; + gfx21romLength = value.Length; + gfx21rom_src.GetObjectPtr(ref gfx21rom_handle, ref gfx21rom); + } + } + #endregion + + + #region //指针化 gfx3rom + static byte[] gfx3rom_src; + static GCHandle gfx3rom_handle; + public static byte* gfx3rom; + public static int gfx3romLength; + public static bool gfx3rom_IsNull => gfx3rom == null; + public static byte[] gfx3rom_set + { + set + { + gfx3rom_handle.ReleaseGCHandle(); + if (value == null) + return; + gfx3rom_src = value; + gfx3romLength = value.Length; + gfx3rom_src.GetObjectPtr(ref gfx3rom_handle, ref gfx3rom); + } + } + #endregion + + + + #region //指针化 gfx31rom + static byte[] gfx31rom_src; + static GCHandle gfx31rom_handle; + public static byte* gfx31rom; + public static int gfx31romLength; + public static bool gfx31rom_IsNull => gfx31rom == null; + public static byte[] gfx31rom_set + { + set + { + gfx31rom_handle.ReleaseGCHandle(); + gfx31rom_src = value; + gfx31romLength = value.Length; + gfx31rom_src.GetObjectPtr(ref gfx31rom_handle, ref gfx31rom); + } + } + #endregion + + + public static byte[] airduelm72_code = new byte[] { + 0x68, 0x00, 0xd0, 0x1f, 0xc6, 0x06, 0xc0, 0x1c, 0x57, 0xea, 0x69, 0x0b, 0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + }; + public static byte[] gunforce_decryption_table = new byte[256] { + 0xff,0x90,0x90,0x2c,0x90,0x90,0x43,0x88, 0x90,0x13,0x0a,0xbd,0xba,0x60,0xea,0x90, /* 00 */ + 0x90,0x90,0xf2,0x29,0xb3,0x22,0x90,0x0c, 0xa9,0x5f,0x9d,0x07,0x90,0x90,0x0b,0xbb, /* 10 */ + 0x8a,0x90,0x90,0x90,0x3a,0x3c,0x5a,0x38, 0x99,0x90,0xf8,0x89,0x90,0x91,0x90,0x55, /* 20 */ + 0xac,0x40,0x73,0x90,0x59,0x90,0xfc,0x90, 0x50,0xfa,0x90,0x25,0x90,0x34,0x47,0xb7, /* 30 */ + 0x90,0x90,0x90,0x49,0x90,0x0f,0x8b,0x05, 0xc3,0xa5,0xbf,0x83,0x86,0xc5,0x90,0x90, /* 40 */ + 0x28,0x77,0x24,0xb4,0x90,0x92,0x90,0x3b, 0x5e,0xb6,0x80,0x0d,0x2e,0xab,0xe7,0x90, /* 50 */ + 0x48,0x90,0xad,0xc0,0x90,0x1b,0xc6,0xa3, 0x04,0x90,0x90,0x90,0x16,0xb0,0x7d,0x98, /* 60 */ + 0x87,0x46,0x8c,0x90,0x90,0xfe,0x90,0xcf, 0x90,0x68,0x84,0x90,0xd2,0x90,0x18,0x51, /* 70 */ + 0x76,0xa4,0x36,0x52,0xfb,0x90,0xb9,0x90, 0x90,0xb1,0x1c,0x21,0xe6,0xb5,0x17,0x27, /* 80 */ + 0x3d,0x45,0xbe,0xae,0x90,0x4a,0x0e,0xe5, 0x90,0x58,0x1f,0x61,0xf3,0x02,0x90,0xe8, /* 90 */ + 0x90,0x90,0x90,0xf7,0x56,0x96,0x90,0xbc, 0x4f,0x90,0x90,0x79,0xd0,0x90,0x2a,0x12, /* A0 */ + 0x4e,0xb8,0x90,0x41,0x90,0x90,0xd3,0x90, 0x2d,0x33,0xf6,0x90,0x90,0x14,0x90,0x32, /* B0 */ + 0x5d,0xa8,0x53,0x26,0x2b,0x20,0x81,0x75, 0x7f,0x3e,0x90,0x90,0x00,0x93,0x90,0xb2, /* C0 */ + 0x57,0x90,0xa0,0x90,0x39,0x90,0x90,0x72, 0x90,0x01,0x42,0x74,0x9c,0x1e,0x90,0x5b, /* D0 */ + 0x90,0xf9,0x90,0x2f,0x85,0x90,0xeb,0xa2, 0x90,0xe2,0x11,0x90,0x4b,0x7e,0x90,0x78, /* E0 */ + 0x90,0x90,0x09,0xa1,0x03,0x90,0x23,0xc1, 0x8e,0xe9,0xd1,0x7c,0x90,0x90,0xc7,0x06, /* F0 */ + }; + public static byte[] airduelm72_crc = new byte[] { 0x72, 0x9c, 0xca, 0x85, 0xc9, 0x12, 0xcc, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + public static void M72Init() + { + int i1, i2, i3, n1, n2, n3; + Generic.paletteram16_set = new ushort[0x600]; + Generic.paletteram16_2_set = new ushort[0x600]; + Generic.spriteram16_set = new ushort[0x200]; + Machine.bRom = true; + EmuTimer.setvector = setvector_callback; + protection_ram = new byte[0x1000]; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + Memory.Set_audiorom(Machine.GetRom("soundcpu.rom")); + //Memory.audiorom_set = new byte[0x10000]; + spritesrom_set = Machine.GetRom("sprites.rom"); + n1 = spritesromLength; + sprites1rom_set = new byte[n1 * 2]; + for (i1 = 0; i1 < n1; i1++) + { + sprites1rom[i1 * 2] = (byte)(spritesrom[i1] >> 4); + sprites1rom[i1 * 2 + 1] = (byte)(spritesrom[i1] & 0x0f); + } + gfx2rom_set = Machine.GetRom("gfx2.rom"); + n2 = gfx2romLength; + gfx21rom_set = new byte[n2 * 2]; + for (i2 = 0; i2 < n2; i2++) + { + gfx21rom[i2 * 2] = (byte)(gfx2rom[i2] >> 4); + gfx21rom[i2 * 2 + 1] = (byte)(gfx2rom[i2] & 0x0f); + } + gfx3rom_set = Machine.GetRom("gfx3.rom"); + if (gfx3rom != null) + { + n3 = gfx3romLength; + gfx31rom_set = new byte[n3 * 2]; + for (i3 = 0; i3 < n3; i3++) + { + gfx31rom[i3 * 2] = (byte)(gfx3rom[i3] >> 4); + gfx31rom[i3 * 2 + 1] = (byte)(gfx3rom[i3] & 0x0f); + } + } + samplesrom_set = Machine.GetRom("samples.rom"); + Memory.Set_mainram(new byte[0x4000]); + Memory.Set_audioram(new byte[0x10000]); + dsw = 0xffbf; + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || sprites1rom == null || gfx21rom == null || samplesrom == null) + { + Machine.bRom = false; + } + } + public static byte protection_r(byte[] protection_code, int offset) + { + Array.Copy(protection_code, protection_ram, 96); + return protection_ram[0xffa + offset]; + } + public static ushort protection_r2(byte[] protection_code, int offset) + { + Array.Copy(protection_code, protection_ram, 96); + return (ushort)(protection_ram[0xffa + offset] + protection_ram[0xffa + 1 + offset] * 0x100); + } + public static void protection_w(byte[] protection_crc, int offset, byte data) + { + data ^= 0xff; + protection_ram[offset] = data; + data ^= 0xff; + if (offset == 0xfff && data == 0) + { + Array.Copy(protection_crc, 0, protection_ram, 0xfe0, 18); + } + } + public static void protection_w(byte[] protection_crc, int offset, ushort data) + { + data ^= 0xffff; + protection_ram[offset * 2] = (byte)data; + protection_ram[offset * 2 + 1] = (byte)(data >> 8); + data ^= 0xffff; + if (offset == 0x0fff / 2 && (data >> 8) == 0) + { + Array.Copy(protection_crc, 0, protection_ram, 0xfe0, 18); + } + } + public static void fake_nmi() + { + byte sample = m72_sample_r(); + if (sample != 0) + { + m72_sample_w(sample); + } + } + public static void airduelm72_sample_trigger_w(byte data) + { + int[] a = new int[16]{ + 0x00000, 0x00020, 0x03ec0, 0x05640, 0x06dc0, 0x083a0, 0x0c000, 0x0eb60, + 0x112e0, 0x13dc0, 0x16520, 0x16d60, 0x18ae0, 0x1a5a0, 0x1bf00, 0x1c340 + }; + if ((data & 0xff) < 16) + { + m72_set_sample_start(a[data & 0xff]); + } + } + public static byte soundram_r(int offset) + { + return Memory.audioram[offset]; + } + public static ushort soundram_r2(int offset) + { + return (ushort)(Memory.audioram[offset * 2 + 0] | (Memory.audioram[offset * 2 + 1] << 8)); + } + public static void soundram_w(int offset, byte data) + { + Memory.audioram[offset] = data; + } + public static void soundram_w(int offset, ushort data) + { + Memory.audioram[offset * 2] = (byte)data; + Memory.audioram[offset * 2 + 1] = (byte)(data >> 8); + } + public static void machine_start_m72() + { + scanline_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M72_m72_scanline_interrupt, false); + } + public static void machine_reset_m72() + { + m72_irq_base = 0x20; + machine_reset_m72_sound(); + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + } + public static void machine_reset_kengo() + { + m72_irq_base = 0x18; + machine_reset_m72_sound(); + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + } + public static void m72_scanline_interrupt() + { + int scanline = m72_scanline_param; + if (scanline < 256 && scanline == m72_raster_irq_position - 128) + { + Video.video_screen_update_partial(scanline); + Cpuexec.cpu[0].cpunum_set_input_line_and_vector(0, 0, LineState.HOLD_LINE, m72_irq_base + 2); + } + else if (scanline == 256) + { + Video.video_screen_update_partial(scanline); + Cpuexec.cpu[0].cpunum_set_input_line_and_vector(0, 0, LineState.HOLD_LINE, m72_irq_base + 0); + } + if (++scanline >= Video.screenstate.height) + { + scanline = 0; + } + m72_scanline_param = scanline; + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/M72.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/M72.cs.meta new file mode 100644 index 00000000..6b76f263 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/M72.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee6d6abc7e7420f4db81313303097698 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory.cs new file mode 100644 index 00000000..a77707da --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory.cs @@ -0,0 +1,666 @@ +namespace MAME.Core +{ + public unsafe partial class M72 + { + public static ushort ushort0, ushort1, dsw; + public static ushort ushort0_old, ushort1_old; + public static byte NReadOpByte(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0xfffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte NReadByte_m72(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0x7ffff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0xa0000 && address <= 0xa3fff) + { + result = Memory.mainram[address - 0xa0000]; + } + else if (address >= 0xc0000 && address <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + result = (byte)Generic.spriteram16[offset]; + } + else if (address >= 0xc8000 && address <= 0xc8bff) + { + int offset = (address - 0xc8000) / 2; + result = (byte)m72_palette1_r(offset); + } + else if (address >= 0xcc000 && address <= 0xccbff) + { + int offset = (address - 0xcc000) / 2; + result = (byte)m72_palette2_r(offset); + } + else if (address >= 0xd0000 && address <= 0xd3fff) + { + int offset = address - 0xd0000; + result = m72_videoram1[offset]; + } + else if (address >= 0xd8000 && address <= 0xdbfff) + { + int offset = address - 0xd8000; + result = m72_videoram2[offset]; + } + else if (address >= 0xe0000 && address <= 0xeffff) + { + int offset = address - 0xe0000; + result = soundram_r(offset); + } + else if (address >= 0xffff0 && address <= 0xfffff) + { + result = Memory.mainrom[address & 0xfffff]; + } + return result; + } + public static ushort NReadWord_m72(int address) + { + address &= 0xfffff; + ushort result = 0; + if (address >= 0 && address + 1 <= 0x7ffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + else if (address >= 0xa0000 && address + 1 <= 0xa3fff) + { + result = (ushort)(Memory.mainram[address - 0xa0000] + Memory.mainram[address - 0xa0000 + 1] * 0x100); + } + else if (address >= 0xc0000 && address + 1 <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + result = Generic.spriteram16[offset]; + } + else if (address >= 0xc8000 && address + 1 <= 0xc8bff) + { + int offset = (address - 0xc8000) / 2; + result = m72_palette1_r(offset); + } + else if (address >= 0xcc000 && address + 1 <= 0xccbff) + { + int offset = (address - 0xcc000) / 2; + result = m72_palette2_r(offset); + } + else if (address >= 0xd0000 && address + 1 <= 0xd3fff) + { + int offset = address - 0xd0000; + result = (ushort)(m72_videoram1[offset] + m72_videoram1[offset + 1] * 0x100); + } + else if (address >= 0xd8000 && address + 1 <= 0xdbfff) + { + int offset = address - 0xd8000; + result = (ushort)(m72_videoram2[offset] + m72_videoram2[offset + 1] * 0x100); + } + else if (address >= 0xe0000 && address + 1 <= 0xeffff) + { + int offset = (address - 0xe0000) / 2; + result = soundram_r2(offset); + } + else if (address >= 0xffff0 && address + 1 <= 0xfffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + return result; + } + public static void NWriteByte_m72(int address, byte value) + { + address &= 0xfffff; + if (address >= 0xa0000 && address <= 0xa3fff) + { + Memory.mainram[address - 0xa0000] = value; + } + else if (address >= 0xc0000 && address <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xc8000 && address <= 0xc8bff) + { + int offset = (address - 0xc8000) / 2; + m72_palette1_w(offset, value); + } + else if (address >= 0xcc000 && address <= 0xccbff) + { + int offset = (address - 0xcc000) / 2; + m72_palette2_w(offset, value); + } + else if (address >= 0xd0000 && address <= 0xd3fff) + { + int offset = address - 0xd0000; + m72_videoram1_w(offset, value); + } + else if (address >= 0xd8000 && address <= 0xdbfff) + { + int offset = address - 0xd8000; + m72_videoram2_w(offset, value); + } + else if (address >= 0xe0000 && address <= 0xeffff) + { + int offset = address - 0xe0000; + soundram_w(offset, value); + } + } + public static void NWriteWord_m72(int address, ushort value) + { + address &= 0xfffff; + if (address >= 0xa0000 && address + 1 <= 0xa3fff) + { + Memory.mainram[address - 0xa0000] = (byte)value; + Memory.mainram[address - 0xa0000 + 1] = (byte)(value >> 8); + } + else if (address >= 0xc0000 && address + 1 <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xc8000 && address + 1 <= 0xc8bff) + { + int offset = (address - 0xc8000) / 2; + m72_palette1_w(offset, value); + } + else if (address >= 0xcc000 && address + 1 <= 0xccbff) + { + int offset = (address - 0xcc000) / 2; + m72_palette2_w(offset, value); + } + else if (address >= 0xd0000 && address + 1 <= 0xd3fff) + { + int offset = (address - 0xd0000) / 2; + m72_videoram1_w(offset, value); + } + else if (address >= 0xd8000 && address + 1 <= 0xdbfff) + { + int offset = (address - 0xd8000) / 2; + m72_videoram2_w(offset, value); + } + else if (address >= 0xe0000 && address + 1 <= 0xeffff) + { + int offset = (address - 0xe0000) / 2; + soundram_w(offset, value); + } + } + public static byte NReadIOByte(int address) + { + byte result = 0; + if (address >= 0x00 && address <= 0x01) + { + result = (byte)ushort0; + } + else if (address >= 0x02 && address <= 0x03) + { + result = (byte)ushort1; + } + else if (address >= 0x04 && address <= 0x05) + { + result = (byte)dsw; + } + return result; + } + public static ushort NReadIOWord(int address) + { + ushort result = 0; + if (address >= 0x00 && address + 1 <= 0x01) + { + result = ushort0; + } + else if (address >= 0x02 && address + 1 <= 0x03) + { + result = ushort1; + } + else if (address >= 0x04 && address + 1 <= 0x05) + { + result = dsw; + } + return result; + } + public static void NWriteIOByte_m72(int address, byte value) + { + if (address >= 0x00 && address <= 0x01) + { + m72_sound_command_w(0, value); + } + else if (address >= 0x02 && address <= 0x03) + { + m72_port02_w(value); + } + else if (address >= 0x04 && address <= 0x05) + { + m72_dmaon_w(value); + } + else if (address >= 0x06 && address <= 0x07) + { + m72_irq_line_w(value); + } + else if (address >= 0x40 && address <= 0x43) + { + + } + else if (address >= 0x80 && address <= 0x81) + { + m72_scrolly1_w(value); + } + else if (address >= 0x82 && address <= 0x83) + { + m72_scrollx1_w(value); + } + else if (address >= 0x84 && address <= 0x85) + { + m72_scrolly2_w(value); + } + else if (address >= 0x86 && address <= 0x87) + { + m72_scrollx2_w(value); + } + } + public static void NWriteIOWord_m72(int address, ushort value) + { + if (address >= 0x00 && address + 1 <= 0x01) + { + m72_sound_command_w(0, value); + } + else if (address >= 0x02 && address + 1 <= 0x03) + { + m72_port02_w(value); + } + else if (address >= 0x04 && address + 1 <= 0x05) + { + m72_dmaon_w(value); + } + else if (address >= 0x06 && address + 1 <= 0x07) + { + m72_irq_line_w(value); + } + else if (address >= 0x40 && address + 1 <= 0x43) + { + + } + else if (address >= 0x80 && address + 1 <= 0x81) + { + m72_scrolly1_w(value); + } + else if (address >= 0x82 && address + 1 <= 0x83) + { + m72_scrollx1_w(value); + } + else if (address >= 0x84 && address + 1 <= 0x85) + { + m72_scrolly2_w(value); + } + else if (address >= 0x86 && address + 1 <= 0x87) + { + m72_scrollx2_w(value); + } + } + public static byte NReadByte_kengo(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0x7ffff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x80000 && address <= 0x83fff) + { + int offset = address - 0x80000; + result = m72_videoram1[offset]; + } + else if (address >= 0x84000 && address <= 0x87fff) + { + int offset = address - 0x84000; + result = m72_videoram2[offset]; + } + else if (address >= 0xa0000 && address <= 0xa0bff) + { + int offset = (address - 0xa0000) / 2; + result = (byte)m72_palette1_r(offset); + } + else if (address >= 0xa8000 && address <= 0xa8bff) + { + int offset = (address - 0xa8000) / 2; + result = (byte)m72_palette2_r(offset); + } + else if (address >= 0xc0000 && address <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + result = (byte)Generic.spriteram16[offset]; + } + else if (address >= 0xe0000 && address <= 0xe3fff) + { + result = Memory.mainram[address - 0xe0000]; + } + else if (address >= 0xffff0 && address <= 0xfffff) + { + result = Memory.mainrom[address & 0xfffff]; + } + return result; + } + public static ushort NReadWord_kengo(int address) + { + address &= 0xfffff; + ushort result = 0; + if (address >= 0 && address + 1 <= 0x7ffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + else if (address >= 0x80000 && address + 1 <= 0x83fff) + { + int offset = address - 0x80000; + result = (ushort)(m72_videoram1[offset] + m72_videoram1[offset + 1] * 0x100); + } + else if (address >= 0x84000 && address + 1 <= 0x87fff) + { + int offset = address - 0x84000; + result = (ushort)(m72_videoram2[offset] + m72_videoram2[offset + 1] * 0x100); + } + else if (address >= 0xa0000 && address + 1 <= 0xa0bff) + { + int offset = (address - 0xa0000) / 2; + result = m72_palette1_r(offset); + } + else if (address >= 0xa8000 && address + 1 <= 0xa8bff) + { + int offset = (address - 0xa8000) / 2; + result = m72_palette2_r(offset); + } + else if (address >= 0xc0000 && address + 1 <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + result = Generic.spriteram16[offset]; + } + else if (address >= 0xe0000 && address + 1 <= 0xe3fff) + { + result = (ushort)(Memory.mainram[address - 0xe0000] + Memory.mainram[address - 0xe0000 + 1] * 0x100); + } + else if (address >= 0xffff0 && address + 1 <= 0xfffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + return result; + } + public static void NWriteByte_kengo(int address, byte value) + { + address &= 0xfffff; + if (address >= 0x80000 && address <= 0x83fff) + { + int offset = address - 0x80000; + m72_videoram1_w(offset, value); + } + else if (address >= 0x84000 && address <= 0x87fff) + { + int offset = address - 0x84000; + m72_videoram2_w(offset, value); + } + else if (address >= 0xa0000 && address <= 0xa0bff) + { + int offset = (address - 0xa0000) / 2; + m72_palette1_w(offset, value); + } + else if (address >= 0xa8000 && address <= 0xa8bff) + { + int offset = (address - 0xa8000) / 2; + m72_palette2_w(offset, value); + } + else if (address >= 0xb0000 && address <= 0xb0001) + { + m72_irq_line_w(value); + } + else if (address >= 0xbc000 && address <= 0xbc001) + { + m72_dmaon_w(value); + } + else if (address >= 0xc0000 && address <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xe0000 && address <= 0xe3fff) + { + Memory.mainram[address - 0xe0000] = value; + } + } + public static void NWriteWord_kengo(int address, ushort value) + { + address &= 0xfffff; + if (address >= 0x80000 && address + 1 <= 0x83fff) + { + int offset = (address - 0x80000) / 2; + m72_videoram1_w(offset, value); + } + else if (address >= 0x84000 && address + 1 <= 0x87fff) + { + int offset = (address - 0x84000) / 2; + m72_videoram2_w(offset, value); + } + else if (address >= 0xa0000 && address + 1 <= 0xa0bff) + { + int offset = (address - 0xa0000) / 2; + m72_palette1_w(offset, value); + } + else if (address >= 0xa8000 && address + 1 <= 0xa8bff) + { + int offset = (address - 0xa8000) / 2; + m72_palette2_w(offset, value); + } + else if (address >= 0xb0000 && address + 1 <= 0xb0001) + { + m72_irq_line_w(value); + } + else if (address >= 0xbc000 && address + 1 <= 0xbc001) + { + m72_dmaon_w(value); + } + else if (address >= 0xc0000 && address + 1 <= 0xc03ff) + { + int offset = (address - 0xc0000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xe0000 && address + 1 <= 0xe3fff) + { + Memory.mainram[address - 0xe0000] = (byte)value; + Memory.mainram[address - 0xe0000 + 1] = (byte)(value >> 8); + } + } + public static void NWriteIOByte_kengo(int address, byte value) + { + if (address >= 0x00 && address <= 0x01) + { + m72_sound_command_w(0, value); + } + else if (address >= 0x02 && address <= 0x03) + { + rtype2_port02_w(value); + } + else if (address >= 0x80 && address <= 0x81) + { + m72_scrolly1_w(value); + } + else if (address >= 0x82 && address <= 0x83) + { + m72_scrollx1_w(value); + } + else if (address >= 0x84 && address <= 0x85) + { + m72_scrolly2_w(value); + } + else if (address >= 0x86 && address <= 0x87) + { + m72_scrollx2_w(value); + } + else + { + int i1 = 1; + } + } + public static void NWriteIOWord_kengo(int address, ushort value) + { + if (address >= 0x00 && address + 1 <= 0x01) + { + m72_sound_command_w(0, value); + } + else if (address >= 0x02 && address + 1 <= 0x03) + { + rtype2_port02_w(value); + } + else if (address >= 0x80 && address + 1 <= 0x81) + { + m72_scrolly1_w(value); + } + else if (address >= 0x82 && address + 1 <= 0x83) + { + m72_scrollx1_w(value); + } + else if (address >= 0x84 && address + 1 <= 0x85) + { + m72_scrolly2_w(value); + } + else if (address >= 0x86 && address + 1 <= 0x87) + { + m72_scrollx2_w(value); + } + else + { + int i1 = 1; + } + } + public static byte ZReadOp(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0xffff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static byte ZReadMemory_ram(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0xffff) + { + result = Memory.audioram[address]; + } + return result; + } + public static byte ZReadMemory_rom(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0xefff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xf000 && address <= 0xffff) + { + result = Memory.audioram[address - 0xf000]; + } + return result; + } + public static void ZWriteMemory_ram(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0xffff) + { + Memory.audioram[address] = value; + } + } + public static void ZWriteMemory_rom(ushort address, byte value) + { + if (address >= 0xf000 && address <= 0xffff) + { + Memory.audioram[address - 0xf000] = value; + } + } + public static byte ZReadHardware(ushort address) + { + byte result = 0; + address &= 0xff; + if (address == 0x01) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address == 0x02) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address == 0x84) + { + result = m72_sample_r(); + } + + return result; + } + public static byte ZReadHardware_rtype2(ushort address) + { + byte result = 0; + address &= 0xff; + if (address == 0x01) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address == 0x80) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address == 0x84) + { + result = m72_sample_r(); + } + + return result; + } + public static void ZWriteHardware(ushort address, byte value) + { + address &= 0xff; + if (address == 0x00) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0x01) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address == 0x06) + { + m72_sound_irq_ack_w(0, value); + } + else if (address == 0x82) + { + m72_sample_w(value); + } + } + public static void ZWriteHardware_rtype2(ushort address, byte value) + { + address &= 0xff; + if (address == 0x00) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0x01) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address >= 0x80 && address <= 0x81) + { + int offset = address - 0x80; + rtype2_sample_addr_w(offset, value); + } + else if (address == 0x82) + { + m72_sample_w(value); + } + else if (address == 0x83) + { + m72_sound_irq_ack_w(0, value); + } + } + public static int ZIRQCallback() + { + return Cpuint.cpu_irq_callback(1, 0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory.cs.meta new file mode 100644 index 00000000..64ddcf13 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1120976d70b180149830871522fc5ac2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory2.cs new file mode 100644 index 00000000..10ae392c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory2.cs @@ -0,0 +1,113 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class M72 + { + public static byte NReadOpByte_airduel(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0xb0000 && address <= 0xb0fff) + { + int offset = address - 0xb0000; + result = protection_ram[offset]; + } + else + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte NReadByte_m72_airduel(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0xb0ffa && address <= 0xb0ffb) + { + int offset = address - 0xb0ffa; + Array.Copy(airduelm72_code, protection_ram, 96); + result = protection_ram[0xffa + offset]; + } + else if (address >= 0xb0000 && address <= 0xb0fff) + { + int offset = address - 0xb0000; + result = protection_ram[offset]; + } + else + { + result = NReadByte_m72(address); + } + return result; + } + public static ushort NReadWord_m72_airduel(int address) + { + address &= 0xfffff; + ushort result = 0; + if (address >= 0xb0ffa && address + 1 <= 0xb0ffb) + { + int offset = address - 0xb0ffa; + Array.Copy(airduelm72_code, protection_ram, 96); + result = (ushort)(protection_ram[0xffa + offset] + protection_ram[0xffa + offset + 1] * 0x100); + } + else if (address >= 0xb0000 && address + 1 <= 0xb0fff) + { + int offset = address - 0xb0000; + result = (ushort)(protection_ram[offset] + protection_ram[offset + 1] * 0x100); + } + else + { + result = NReadWord_m72(address); + } + return result; + } + public static void NWriteByte_m72_airduel(int address, byte value) + { + address &= 0xfffff; + if (address >= 0xb0000 && address <= 0xb0fff) + { + int offset = address - 0xb0000; + protection_w(airduelm72_crc, offset, value); + } + else + { + NWriteByte_m72(address, value); + } + } + public static void NWriteWord_m72_airduel(int address, ushort value) + { + address &= 0xfffff; + if (address >= 0xb0000 && address + 1 <= 0xb0fff) + { + int offset = (address - 0xb0000) / 2; + protection_w(airduelm72_crc, offset, value); + } + else + { + NWriteWord_m72(address, value); + } + } + public static void NWriteIOByte_m72_airduel(int address, byte data) + { + if (address >= 0xc0 && address <= 0xc1) + { + airduelm72_sample_trigger_w(data); + } + else + { + NWriteIOByte_m72(address, data); + } + } + public static void NWriteIOWord_m72_airduel(int address, ushort data) + { + if (address >= 0xc0 && address + 1 <= 0xc1) + { + airduelm72_sample_trigger_w((byte)data); + } + else + { + NWriteIOWord_m72(address, data); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory2.cs.meta new file mode 100644 index 00000000..1278a555 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 260b949724c5393489a25c1d9a16db90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/State.cs new file mode 100644 index 00000000..87a6d9b7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/State.cs @@ -0,0 +1,133 @@ +using cpu.nec; +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class M72 + { + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + writer.Write(dsw); + writer.Write(setvector_param); + writer.Write(irqvector); + writer.Write(sample_addr); + writer.Write(protection_ram, 0, 0x1000); + writer.Write(m72_irq_base); + writer.Write(m72_scanline_param); + for (i = 0; i < 0x600; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x600; i++) + { + writer.Write(Generic.paletteram16_2[i]); + } + for (i = 0; i < 0x200; i++) + { + writer.Write(Generic.spriteram16[i]); + } + writer.Write(m72_videoram1, 0, 0x4000); + writer.Write(m72_videoram2, 0, 0x4000); + writer.Write(m72_raster_irq_position); + writer.Write(video_off); + writer.Write(scrollx1); + writer.Write(scrolly1); + writer.Write(scrollx2); + writer.Write(scrolly2); + for (i = 0; i < 0x200; i++) + { + writer.Write(m72_spriteram[i]); + } + //majtitle_rowscrollram spriteram_size majtitle_rowscroll + for (i = 0; i < 0x201; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x4000); + Nec.nn1[0].SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x10000); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + Cpuint.SaveStateBinary_v(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + DAC.SaveStateBinary(writer); + writer.Write(Sound.latched_value[0]); + writer.Write(Sound.utempdata[0]); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.dacstream.output_sampindex); + writer.Write(Sound.dacstream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + dsw = reader.ReadUInt16(); + setvector_param = reader.ReadInt32(); + irqvector = reader.ReadByte(); + sample_addr = reader.ReadInt32(); + protection_ram = reader.ReadBytes(0x1000); + m72_irq_base = reader.ReadByte(); + m72_scanline_param = reader.ReadInt32(); + for (i = 0; i < 0x600; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x600; i++) + { + Generic.paletteram16_2[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x200; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + m72_videoram1 = reader.ReadBytes(0x4000); + m72_videoram2 = reader.ReadBytes(0x4000); + m72_raster_irq_position = reader.ReadInt32(); + video_off = reader.ReadInt32(); + scrollx1 = reader.ReadInt32(); + scrolly1 = reader.ReadInt32(); + scrollx2 = reader.ReadInt32(); + scrolly2 = reader.ReadInt32(); + for (i = 0; i < 0x200; i++) + { + m72_spriteram[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x201; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x4000)); + Nec.nn1[0].LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x10000)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + Cpuint.LoadStateBinary_v(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + DAC.LoadStateBinary(reader); + Sound.latched_value[0] = reader.ReadUInt16(); + Sound.utempdata[0] = reader.ReadUInt16(); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.dacstream.output_sampindex = reader.ReadInt32(); + Sound.dacstream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/State.cs.meta new file mode 100644 index 00000000..4df23c43 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b3e9c4f8cad024488b7c88949b770b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Tilemap.cs new file mode 100644 index 00000000..d9ff740d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Tilemap.cs @@ -0,0 +1,478 @@ +using System; + +namespace MAME.Core +{ + public partial class M72 + { + public static Tmap bg_tilemap, fg_tilemap, bg_tilemap_large; + public static void tilemap_init() + { + int i; + bg_tilemap = new Tmap(); + bg_tilemap.rows = 64; + bg_tilemap.cols = 64; + bg_tilemap.tilewidth = 8; + bg_tilemap.tileheight = 8; + bg_tilemap.width = 0x200; + bg_tilemap.height = 0x200; + bg_tilemap.enable = true; + bg_tilemap.all_tiles_dirty = true; + bg_tilemap.pixmap = new ushort[0x200 * 0x200]; + bg_tilemap.flagsmap = new byte[0x200, 0x200]; + bg_tilemap.tileflags = new byte[0x40, 0x40]; + bg_tilemap.total_elements = M72.gfx21romLength / 0x40; + bg_tilemap.pen_data_set = new byte[0x40]; + bg_tilemap.pen_to_flags = new byte[3, 16]; + for (i = 0; i < 16; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x20; + } + for (i = 0; i < 8; i++) + { + bg_tilemap.pen_to_flags[1, i] = 0x20; + } + for (i = 8; i < 16; i++) + { + bg_tilemap.pen_to_flags[1, i] = 0x10; + } + bg_tilemap.pen_to_flags[2, 0] = 0x20; + for (i = 1; i < 16; i++) + { + bg_tilemap.pen_to_flags[2, i] = 0x10; + } + bg_tilemap.scrollrows = 1; + bg_tilemap.scrollcols = 1; + bg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap.tilemap_draw_instance3 = bg_tilemap.tilemap_draw_instanceM72; + fg_tilemap = new Tmap(); + fg_tilemap.cols = 64; + fg_tilemap.rows = 64; + fg_tilemap.tilewidth = 8; + fg_tilemap.tileheight = 8; + fg_tilemap.width = 0x200; + fg_tilemap.height = 0x200; + fg_tilemap.enable = true; + fg_tilemap.all_tiles_dirty = true; + fg_tilemap.pixmap = new ushort[0x200 * 0x200]; + fg_tilemap.flagsmap = new byte[0x200, 0x200]; + fg_tilemap.tileflags = new byte[0x40, 0x40]; + fg_tilemap.total_elements = M72.gfx21romLength / 0x40; + fg_tilemap.pen_data_set = new byte[0x400]; + fg_tilemap.pen_to_flags = new byte[3, 32]; + fg_tilemap.pen_to_flags[0, 0] = 0; + for (i = 1; i < 16; i++) + { + fg_tilemap.pen_to_flags[0, i] = 0x20; + } + fg_tilemap.pen_to_flags[1, 0] = 0; + for (i = 1; i < 8; i++) + { + fg_tilemap.pen_to_flags[1, i] = 0x20; + } + for (i = 8; i < 16; i++) + { + fg_tilemap.pen_to_flags[1, i] = 0x10; + } + fg_tilemap.pen_to_flags[2, 0] = 0; + for (i = 1; i < 16; i++) + { + fg_tilemap.pen_to_flags[2, i] = 0x10; + } + fg_tilemap.scrollrows = 1; + fg_tilemap.scrollcols = 1; + fg_tilemap.rowscroll = new int[fg_tilemap.scrollrows]; + fg_tilemap.colscroll = new int[fg_tilemap.scrollcols]; + fg_tilemap.tilemap_draw_instance3 = fg_tilemap.tilemap_draw_instanceM72; + switch (Machine.sName) + { + case "airduel": + case "airduelm72": + bg_tilemap.tile_update3 = bg_tilemap.tile_updateM72_bg_m72; + fg_tilemap.tile_update3 = fg_tilemap.tile_updateM72_fg_m72; + break; + case "ltswords": + case "kengo": + case "kengoa": + bg_tilemap.tile_update3 = bg_tilemap.tile_updateM72_bg_rtype2; + fg_tilemap.tile_update3 = fg_tilemap.tile_updateM72_fg_rtype2; + break; + } + } + public static void tilemap_init_m82() + { + int i; + bg_tilemap = new Tmap(); + bg_tilemap.rows = 64; + bg_tilemap.cols = 64; + bg_tilemap.tilewidth = 8; + bg_tilemap.tileheight = 8; + bg_tilemap.width = 0x200; + bg_tilemap.height = 0x200; + bg_tilemap.enable = true; + bg_tilemap.all_tiles_dirty = true; + bg_tilemap.pixmap = new ushort[0x200 * 0x200]; + bg_tilemap.flagsmap = new byte[0x200, 0x200]; + bg_tilemap.tileflags = new byte[0x40, 0x40]; + bg_tilemap.total_elements = M72.gfx21romLength / 0x40; + bg_tilemap.pen_data_set = new byte[0x40]; + bg_tilemap.pen_to_flags = new byte[3, 16]; + for (i = 0; i < 16; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x20; + } + for (i = 0; i < 8; i++) + { + bg_tilemap.pen_to_flags[1, i] = 0x20; + } + for (i = 8; i < 16; i++) + { + bg_tilemap.pen_to_flags[1, i] = 0x10; + } + bg_tilemap.pen_to_flags[2, 0] = 0x20; + for (i = 1; i < 16; i++) + { + bg_tilemap.pen_to_flags[2, i] = 0x10; + } + bg_tilemap.scrollrows = 1; + bg_tilemap.scrollcols = 1; + bg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap.tilemap_draw_instance3 = bg_tilemap.tilemap_draw_instanceM72; + fg_tilemap = new Tmap(); + fg_tilemap.cols = 64; + fg_tilemap.rows = 64; + fg_tilemap.tilewidth = 8; + fg_tilemap.tileheight = 8; + fg_tilemap.width = 0x200; + fg_tilemap.height = 0x200; + fg_tilemap.enable = true; + fg_tilemap.all_tiles_dirty = true; + fg_tilemap.pixmap = new ushort[0x200 * 0x200]; + fg_tilemap.flagsmap = new byte[0x200, 0x200]; + fg_tilemap.tileflags = new byte[0x40, 0x40]; + fg_tilemap.total_elements = M72.gfx21romLength / 0x40; + fg_tilemap.pen_data_set = new byte[0x400]; + fg_tilemap.pen_to_flags = new byte[3, 32]; + fg_tilemap.pen_to_flags[0, 0] = 0; + for (i = 1; i < 16; i++) + { + fg_tilemap.pen_to_flags[0, i] = 0x20; + } + fg_tilemap.pen_to_flags[1, 0] = 0; + for (i = 1; i < 8; i++) + { + fg_tilemap.pen_to_flags[1, i] = 0x20; + } + for (i = 8; i < 16; i++) + { + fg_tilemap.pen_to_flags[1, i] = 0x10; + } + fg_tilemap.pen_to_flags[2, 0] = 0; + for (i = 1; i < 16; i++) + { + fg_tilemap.pen_to_flags[2, i] = 0x10; + } + fg_tilemap.scrollrows = 1; + fg_tilemap.scrollcols = 1; + fg_tilemap.rowscroll = new int[fg_tilemap.scrollrows]; + fg_tilemap.colscroll = new int[fg_tilemap.scrollcols]; + fg_tilemap.tilemap_draw_instance3 = fg_tilemap.tilemap_draw_instanceM72; + bg_tilemap_large = new Tmap(); + bg_tilemap_large.rows = 0x40; + bg_tilemap_large.cols = 0x80; + bg_tilemap_large.tilewidth = 8; + bg_tilemap_large.tileheight = 8; + bg_tilemap_large.width = 0x400; + bg_tilemap_large.height = 0x200; + bg_tilemap_large.enable = true; + bg_tilemap_large.all_tiles_dirty = true; + bg_tilemap_large.pixmap = new ushort[0x400 * 0x200]; + bg_tilemap_large.flagsmap = new byte[0x200, 0x400]; + bg_tilemap_large.tileflags = new byte[0x40, 0x80]; + bg_tilemap_large.total_elements = M72.gfx21romLength / 0x40; + bg_tilemap_large.pen_data_set = new byte[0x40]; + bg_tilemap_large.pen_to_flags = new byte[3, 16]; + for (i = 0; i < 16; i++) + { + bg_tilemap_large.pen_to_flags[0, i] = 0x20; + } + for (i = 0; i < 8; i++) + { + bg_tilemap_large.pen_to_flags[1, i] = 0x20; + } + for (i = 8; i < 16; i++) + { + bg_tilemap_large.pen_to_flags[1, i] = 0x10; + } + bg_tilemap_large.pen_to_flags[2, 0] = 0x20; + for (i = 1; i < 16; i++) + { + bg_tilemap_large.pen_to_flags[2, i] = 0x10; + } + bg_tilemap_large.scrollrows = 1; + bg_tilemap_large.scrollcols = 1; + bg_tilemap_large.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap_large.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap_large.tilemap_draw_instance3 = bg_tilemap_large.tilemap_draw_instanceM72; + bg_tilemap.tile_update3 = bg_tilemap.tile_updateM72_bg_m72; + fg_tilemap.tile_update3 = fg_tilemap.tile_updateM72_fg_m72; + bg_tilemap_large.tile_update3 = bg_tilemap.tile_updateM72_bg_m72; + } + } + public unsafe partial class Tmap + { + public void tilemap_draw_instanceM72(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + continue; + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = (ushort)(pixmap[offsety2 * width + i - xpos] + palette_offset); + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = (ushort)(pixmap[offsety2 * width + i - xpos] + palette_offset); + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tile_updateM72_bg_m72(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int code, code1, attr, color, pri, tile_index; + int pen_data_offset; + tile_index = (0x40 * row + col) * 2; + code = M72.m72_videoram2[tile_index * 2] + M72.m72_videoram2[tile_index * 2 + 1] * 0x100; + color = M72.m72_videoram2[(tile_index + 1) * 2]; + attr = M72.m72_videoram2[(tile_index + 1) * 2 + 1]; + if ((attr & 0x01) != 0) + { + pri = 2; + } + else if ((color & 0x80) != 0) + { + pri = 1; + } + else + { + pri = 0; + } + code1 = (code + ((attr & 0x3f) << 8)) % M72.bg_tilemap.total_elements; + pen_data_offset = code1 * 0x40; + tileflags[row, col] = tile_drawM72(M72.gfx31rom, pen_data_offset, x0, y0, 0x100 + 0x10 * (color & 0x0f), pri, (((color & 0xc0) >> 6) & 3) ^ (attributes & 0x03)); + } + public void tile_updateM72_bg_rtype2(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int code, code1, attr, color, pri, tile_index; + int pen_data_offset; + tile_index = (0x40 * row + col) * 2; + code = M72.m72_videoram2[tile_index * 2] + M72.m72_videoram2[tile_index * 2 + 1] * 0x100; + color = M72.m72_videoram2[(tile_index + 1) * 2]; + attr = M72.m72_videoram2[(tile_index + 1) * 2 + 1]; + if ((attr & 0x01) != 0) + { + pri = 2; + } + else if ((color & 0x80) != 0) + { + pri = 1; + } + else + { + pri = 0; + } + code1 = code % M72.bg_tilemap.total_elements; + pen_data_offset = code1 * 0x40; + tileflags[row, col] = tile_drawM72(M72.gfx21rom, pen_data_offset, x0, y0, 0x100 + 0x10 * (color & 0x0f), pri, (((color & 0x60) >> 5) & 3) ^ (attributes & 0x03)); + } + public byte tile_drawM72(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + int height = tileheight; + int width = tilewidth; + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += height - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += width - 1; + dx0 = -1; + } + for (ty = 0; ty < height; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < width; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % 0x200) * 0x200 + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % 0x200, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public void tile_updateM72_fg_m72(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int code, code1, attr, color, pri, tile_index; + int pen_data_offset; + tile_index = (0x40 * row + col) * 2; + code = M72.m72_videoram1[tile_index * 2] + M72.m72_videoram1[tile_index * 2 + 1] * 0x100; + color = M72.m72_videoram1[(tile_index + 1) * 2]; + attr = M72.m72_videoram1[(tile_index + 1) * 2 + 1]; + if ((attr & 0x01) != 0) + { + pri = 2; + } + else if ((color & 0x80) != 0) + { + pri = 1; + } + else + { + pri = 0; + } + code1 = code % M72.fg_tilemap.total_elements; + pen_data_offset = code1 * 0x40; + tileflags[row, col] = tile_drawM72(M72.gfx21rom, pen_data_offset, x0, y0, 0x100 + 0x10 * (color & 0x0f), pri, (((color & 0x60) >> 5) & 3) ^ (attributes & 0x03)); + } + public void tile_updateM72_fg_rtype2(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int y0offset; + int code, code1, attr, color, pri, tile_index; + int pen_data_offset; + tile_index = (0x40 * row + col) * 2; + code = M72.m72_videoram1[tile_index * 2] + M72.m72_videoram1[tile_index * 2 + 1] * 0x100; + color = M72.m72_videoram1[(tile_index + 1) * 2]; + attr = M72.m72_videoram1[(tile_index + 1) * 2 + 1]; + if ((attr & 0x01) != 0) + { + pri = 2; + } + else if ((color & 0x80) != 0) + { + pri = 1; + } + else + { + pri = 0; + } + if (pri == 0) + { + y0offset = 0x90; + } + else + { + y0offset = 0; + } + code1 = code % M72.fg_tilemap.total_elements; + pen_data_offset = code1 * 0x40; + tileflags[row, col] = tile_drawM72(M72.gfx21rom, pen_data_offset, x0, y0, 0x100 + 0x10 * (color & 0x0f), pri, (((color & 0x60) >> 5) & 3) ^ (attributes & 0x03)); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Tilemap.cs.meta new file mode 100644 index 00000000..cacb3a19 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3d2d2e4bb4c4974fbd9850d2a748d85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Video.cs new file mode 100644 index 00000000..8bc62bd9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Video.cs @@ -0,0 +1,273 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class M72 + { + public static byte[] m72_videoram1, m72_videoram2; + public static ushort[] majtitle_rowscrollram; + public static int m72_raster_irq_position; + //public static ushort[] m72_spriteram; + + #region //指针化m72_spriteram + static ushort[] m72_spriteram_src; + static GCHandle m72_spriteram_handle; + public static ushort* m72_spriteram; + public static int m72_spriteramLength; + public static ushort[] m72_spriteram_set + { + set + { + m72_spriteram_handle.ReleaseGCHandle(); + m72_spriteram_src = value; + m72_spriteramLength = value.Length; + m72_spriteram_src.GetObjectPtr(ref m72_spriteram_handle, ref m72_spriteram); + } + } + #endregion + + private static ushort[] uuB200; + public static int scrollx1, scrolly1, scrollx2, scrolly2; + public static int video_off, spriteram_size, majtitle_rowscroll; + public static ushort m72_palette1_r(int offset) + { + offset &= ~0x100; + return (ushort)(Generic.paletteram16[offset] | 0xffe0); + } + public static ushort m72_palette2_r(int offset) + { + offset &= ~0x100; + return (ushort)(Generic.paletteram16_2[offset] | 0xffe0); + } + public static void changecolor(int color, int r, int g, int b) + { + Palette.palette_entry_set_color1(color, Palette.make_rgb(Palette.pal5bit((byte)r), Palette.pal5bit((byte)g), Palette.pal5bit((byte)b))); + } + public static void m72_palette1_w(int offset, ushort data) + { + offset &= ~0x100; + Generic.paletteram16[offset] = data; + offset &= 0x0ff; + changecolor(offset, Generic.paletteram16[offset + 0x000], Generic.paletteram16[offset + 0x200], Generic.paletteram16[offset + 0x400]); + } + public static void m72_palette2_w(int offset, ushort data) + { + offset &= ~0x100; + Generic.paletteram16_2[offset] = data; + offset &= 0x0ff; + changecolor(offset + 256, Generic.paletteram16_2[offset + 0x000], Generic.paletteram16_2[offset + 0x200], Generic.paletteram16_2[offset + 0x400]); + } + public static void m72_videoram1_w(int offset, byte data) + { + int row, col; + m72_videoram1[offset] = data; + row = (offset / 4) / 0x40; + col = (offset / 4) % 0x40; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void m72_videoram2_w(int offset, byte data) + { + int row, col; + m72_videoram2[offset] = data; + row = (offset / 4) / 0x40; + col = (offset / 4) % 0x40; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void m72_videoram1_w(int offset, ushort data) + { + int row, col; + m72_videoram1[offset * 2] = (byte)data; + m72_videoram1[offset * 2 + 1] = (byte)(data >> 8); + row = (offset / 2) / 0x40; + col = (offset / 2) % 0x40; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void m72_videoram2_w(int offset, ushort data) + { + int row, col; + m72_videoram2[offset * 2] = (byte)data; + m72_videoram2[offset * 2 + 1] = (byte)(data >> 8); + row = (offset / 2) / 0x40; + col = (offset / 2) % 0x40; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void m72_irq_line_w(ushort data) + { + m72_raster_irq_position = data; + } + public static void m72_scrollx1_w(ushort data) + { + scrollx1 = data; + } + public static void m72_scrollx2_w(ushort data) + { + scrollx2 = data; + } + public static void m72_scrolly1_w(ushort data) + { + scrolly1 = data; + } + public static void m72_scrolly2_w(ushort data) + { + scrolly2 = data; + } + public static void m72_dmaon_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + AxiArray.Copy(Generic.spriteram16, m72_spriteram, spriteram_size / 2); + } + public static void m72_port02_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + //flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(machine, "DSW") >> 8) & 1)); + video_off = data & 0x08; + if ((data & 0x10) != 0) + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, LineState.CLEAR_LINE); + } + else + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, LineState.ASSERT_LINE); + } + } + } + public static void rtype2_port02_w(ushort data) + { + //if (ACCESSING_BITS_0_7) + { + //coin_counter_w(0,data & 0x01); + //coin_counter_w(1,data & 0x02); + //flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(machine, "DSW") >> 8) & 1)); + video_off = data & 0x08; + } + } + public static void majtitle_gfx_ctrl_w(ushort data) + { + //if (ACCESSING_BITS_8_15) + { + if ((data & 0xff00) != 0) + { + majtitle_rowscroll = 1; + } + else + { + majtitle_rowscroll = 0; + } + } + } + public static void m72_draw_sprites(RECT rect) + { + int offs; + offs = 0; + while (offs < spriteram_size / 2) + { + int code, color, sx, sy, flipx, flipy, w, h, x, y; + code = m72_spriteram[offs + 1]; + color = m72_spriteram[offs + 2] & 0x0f; + sx = -256 + (m72_spriteram[offs + 3] & 0x3ff); + sy = 384 - (m72_spriteram[offs + 0] & 0x1ff); + flipx = m72_spriteram[offs + 2] & 0x0800; + flipy = m72_spriteram[offs + 2] & 0x0400; + w = 1 << ((m72_spriteram[offs + 2] & 0xc000) >> 14); + h = 1 << ((m72_spriteram[offs + 2] & 0x3000) >> 12); + sy -= 16 * h; + /*if (flip_screen_get()) + { + sx = 512 - 16*w - sx; + sy = 284 - 16*h - sy; + flipx = !flipx; + flipy = !flipy; + }*/ + for (x = 0; x < w; x++) + { + for (y = 0; y < h; y++) + { + int c = code; + if (flipx != 0) + { + c += 8 * (w - 1 - x); + } + else + { + c += 8 * x; + } + if (flipy != 0) + { + c += h - 1 - y; + } + else + { + c += y; + } + Drawgfx.common_drawgfx_m72(M72.sprites1rom, c, color, flipx, flipy, sx + 16 * x, sy + 16 * y, rect); + } + } + offs += w * 4; + } + } + public static void video_start_m72() + { + int i; + uuB200 = new ushort[0x200 * 0x200]; + Video.new_clip = new RECT(); + spriteram_size = 0x400; + for (i = 0; i < 0x40000; i++) + { + uuB200[i] = 0x200; + } + m72_spriteram_set = new ushort[0x200]; + m72_videoram1 = new byte[0x4000]; + m72_videoram2 = new byte[0x4000]; + fg_tilemap.tilemap_set_scrolldx(0, 0); + fg_tilemap.tilemap_set_scrolldy(-128, 16); + bg_tilemap.tilemap_set_scrolldx(0, 0); + bg_tilemap.tilemap_set_scrolldy(-128, 16); + switch (Machine.sName) + { + case "ltswords": + case "kengo": + case "kengoa": + fg_tilemap.tilemap_set_scrolldx(6, 0); + bg_tilemap.tilemap_set_scrolldx(6, 0); + break; + } + } + public static void video_update_m72() + { + if (video_off != 0) + { + Array.Copy(uuB200, Video.bitmapbase[Video.curbitmap], 0x40000); + return; + } + fg_tilemap.tilemap_set_scrollx(0, scrollx1); + fg_tilemap.tilemap_set_scrolly(0, scrolly1); + bg_tilemap.tilemap_set_scrollx(0, scrollx2); + bg_tilemap.tilemap_set_scrolly(0, scrolly2); + bg_tilemap.tilemap_draw_primask(Video.new_clip, 0x20, 0); + fg_tilemap.tilemap_draw_primask(Video.new_clip, 0x20, 0); + m72_draw_sprites(Video.new_clip); + bg_tilemap.tilemap_draw_primask(Video.new_clip, 0x10, 0); + fg_tilemap.tilemap_draw_primask(Video.new_clip, 0x10, 0); + } + public static void video_eof_m72() + { + + } + public static void video_start_m82() + { + int i; + uuB200 = new ushort[0x400 * 0x200]; + Video.new_clip = new RECT(); + spriteram_size = 0x400; + for (i = 0; i < 0x80000; i++) + { + uuB200[i] = 0x200; + } + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Video.cs.meta new file mode 100644 index 00000000..b74be250 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m72/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec03b8507128e284895db1a03a63d572 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92.meta new file mode 100644 index 00000000..262b2cdd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be47a38e4c8797a4998df2afe2a720b4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Drawgfx.cs new file mode 100644 index 00000000..11c443ca --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Drawgfx.cs @@ -0,0 +1,115 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_m92(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip, uint primask) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 0x10 - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x200) + { + ex = 0x200 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x10 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 0x10 * color; + blockmove_8toN_transpen_pri16_m92(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx, primask); + } + public unsafe static void blockmove_8toN_transpen_pri16_m92(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int sy, int sx, uint primask) + { + int ydir, xdir, col, i, j; + int offsetx = sx, offsety = sy; + int srcdata_offset = code * 0x100; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * 0x10; + ydir = -1; + } + else + { + srcdata_offset += topskip * 0x10; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0) + { + if ((1 << (Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x1f) & primask) == 0) + { + if ((Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x80) != 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = 0x800; + } + else + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] = (byte)((Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x7f) | 0x1f); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Drawgfx.cs.meta new file mode 100644 index 00000000..7cd72eee --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0653e773069f7e741a424853dacb16a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Input.cs new file mode 100644 index 00000000..42ed0615 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Input.cs @@ -0,0 +1,230 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class M92 + { + public static void loop_inputports_m92_common() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + ushort1 &= unchecked((ushort)~0x0004); + } + else + { + ushort1 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + ushort1 &= unchecked((ushort)~0x0008); + } + else + { + ushort1 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + ushort1 &= unchecked((ushort)~0x0001); + } + else + { + ushort1 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + ushort1 &= unchecked((ushort)~0x0002); + } + else + { + ushort1 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + ushort0 &= unchecked((ushort)~0x0001); + } + else + { + ushort0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + ushort0 &= unchecked((ushort)~0x0002); + } + else + { + ushort0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + ushort0 &= unchecked((ushort)~0x0004); + } + else + { + ushort0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + ushort0 &= unchecked((ushort)~0x0008); + } + else + { + ushort0 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + ushort0 &= unchecked((ushort)~0x0080); + } + else + { + ushort0 |= 0x0080; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + ushort0 &= unchecked((ushort)~0x0040); + } + else + { + ushort0 |= 0x0040; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + ushort0 &= unchecked((ushort)~0x0020); + } + else + { + ushort0 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + ushort0 &= unchecked((ushort)~0x0010); + } + else + { + ushort0 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + ushort0 &= unchecked((ushort)~0x0100); + } + else + { + ushort0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + ushort0 &= unchecked((ushort)~0x0200); + } + else + { + ushort0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + ushort0 &= unchecked((ushort)~0x0400); + } + else + { + ushort0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + ushort0 &= unchecked((ushort)~0x0800); + } + else + { + ushort0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + ushort0 &= unchecked((ushort)~0x8000); + } + else + { + ushort0 |= 0x8000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + ushort0 &= unchecked((ushort)~0x4000); + } + else + { + ushort0 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + ushort0 &= unchecked((ushort)~0x2000); + } + else + { + ushort0 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + ushort0 &= unchecked((ushort)~0x1000); + } + else + { + ushort0 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + ushort1 &= unchecked((ushort)~0x0010); + } + else + { + ushort1 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + ushort1 &= unchecked((ushort)~0x0020); + } + else + { + ushort1 |= 0x0020; + } + } + public static void record_port() + { + if (ushort0 != ushort0_old || ushort1 != ushort1_old || ushort2 != ushort2_old) + { + ushort0_old = ushort0; + ushort1_old = ushort1; + ushort2_old = ushort2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(ushort0); + Mame.bwRecord.Write(ushort1); + Mame.bwRecord.Write(ushort2); + } + } + public static void replay_port() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + ushort0_old = Mame.brRecord.ReadUInt16(); + ushort1_old = Mame.brRecord.ReadUInt16(); + ushort2_old = Mame.brRecord.ReadUInt16(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + //Mame.mame_pause(true); + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + ushort0 = ushort0_old; + ushort1 = ushort1_old; + ushort2 = ushort2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Input.cs.meta new file mode 100644 index 00000000..2432e404 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a21deda5a39505446a687425a80b5ab7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/M92.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/M92.cs new file mode 100644 index 00000000..be390150 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/M92.cs @@ -0,0 +1,562 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class M92 + { + public static byte irqvector; + public static ushort sound_status; + public static int bankaddress; + public static EmuTimer.emu_timer scanline_timer; + public static byte m92_irq_vectorbase; + public static int m92_raster_irq_position; + public static int m92_scanline_param; + public static int setvector_param; + public static byte m92_sprite_buffer_busy; + //public static byte[] /*gfx1rom,*/ /*gfx11rom,*//* gfx2rom,*/ /*gfx21rom,*/ eeprom; + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 gfx11rom + static byte[] gfx11rom_src; + static GCHandle gfx11rom_handle; + public static byte* gfx11rom; + public static int gfx11romLength; + public static bool gfx11rom_IsNull => gfx11rom == null; + public static byte[] gfx11rom_set + { + set + { + gfx11rom_handle.ReleaseGCHandle(); + gfx11rom_src = value; + gfx11romLength = value.Length; + gfx11rom_src.GetObjectPtr(ref gfx11rom_handle, ref gfx11rom); + } + } + #endregion + + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + #region //指针化 gfx21rom + static byte[] gfx21rom_src; + static GCHandle gfx21rom_handle; + public static byte* gfx21rom; + public static int gfx21romLength; + public static bool gfx21rom_IsNull => gfx21rom == null; + public static byte[] gfx21rom_set + { + set + { + gfx21rom_handle.ReleaseGCHandle(); + gfx21rom_src = value; + gfx21romLength = value.Length; + gfx21rom_src.GetObjectPtr(ref gfx21rom_handle, ref gfx21rom); + } + } + #endregion + + + #region //指针化 eeprom + static byte[] eeprom_src; + static GCHandle eeprom_handle; + public static byte* eeprom; + public static int eepromLength; + public static bool eeprom_IsNull => eeprom == null; + public static byte[] eeprom_set + { + set + { + eeprom_handle.ReleaseGCHandle(); + eeprom_src = value; + eepromLength = value.Length; + eeprom_src.GetObjectPtr(ref eeprom_handle, ref eeprom); + } + } + #endregion + + + public static byte[] gunforce_decryption_table = new byte[256] { + 0xff,0x90,0x90,0x2c,0x90,0x90,0x43,0x88, 0x90,0x13,0x0a,0xbd,0xba,0x60,0xea,0x90, /* 00 */ + 0x90,0x90,0xf2,0x29,0xb3,0x22,0x90,0x0c, 0xa9,0x5f,0x9d,0x07,0x90,0x90,0x0b,0xbb, /* 10 */ + 0x8a,0x90,0x90,0x90,0x3a,0x3c,0x5a,0x38, 0x99,0x90,0xf8,0x89,0x90,0x91,0x90,0x55, /* 20 */ + 0xac,0x40,0x73,0x90,0x59,0x90,0xfc,0x90, 0x50,0xfa,0x90,0x25,0x90,0x34,0x47,0xb7, /* 30 */ + 0x90,0x90,0x90,0x49,0x90,0x0f,0x8b,0x05, 0xc3,0xa5,0xbf,0x83,0x86,0xc5,0x90,0x90, /* 40 */ + 0x28,0x77,0x24,0xb4,0x90,0x92,0x90,0x3b, 0x5e,0xb6,0x80,0x0d,0x2e,0xab,0xe7,0x90, /* 50 */ + 0x48,0x90,0xad,0xc0,0x90,0x1b,0xc6,0xa3, 0x04,0x90,0x90,0x90,0x16,0xb0,0x7d,0x98, /* 60 */ + 0x87,0x46,0x8c,0x90,0x90,0xfe,0x90,0xcf, 0x90,0x68,0x84,0x90,0xd2,0x90,0x18,0x51, /* 70 */ + 0x76,0xa4,0x36,0x52,0xfb,0x90,0xb9,0x90, 0x90,0xb1,0x1c,0x21,0xe6,0xb5,0x17,0x27, /* 80 */ + 0x3d,0x45,0xbe,0xae,0x90,0x4a,0x0e,0xe5, 0x90,0x58,0x1f,0x61,0xf3,0x02,0x90,0xe8, /* 90 */ + 0x90,0x90,0x90,0xf7,0x56,0x96,0x90,0xbc, 0x4f,0x90,0x90,0x79,0xd0,0x90,0x2a,0x12, /* A0 */ + 0x4e,0xb8,0x90,0x41,0x90,0x90,0xd3,0x90, 0x2d,0x33,0xf6,0x90,0x90,0x14,0x90,0x32, /* B0 */ + 0x5d,0xa8,0x53,0x26,0x2b,0x20,0x81,0x75, 0x7f,0x3e,0x90,0x90,0x00,0x93,0x90,0xb2, /* C0 */ + 0x57,0x90,0xa0,0x90,0x39,0x90,0x90,0x72, 0x90,0x01,0x42,0x74,0x9c,0x1e,0x90,0x5b, /* D0 */ + 0x90,0xf9,0x90,0x2f,0x85,0x90,0xeb,0xa2, 0x90,0xe2,0x11,0x90,0x4b,0x7e,0x90,0x78, /* E0 */ + 0x90,0x90,0x09,0xa1,0x03,0x90,0x23,0xc1, 0x8e,0xe9,0xd1,0x7c,0x90,0x90,0xc7,0x06, /* F0 */ + }; + public static byte[] bomberman_decryption_table = new byte[256] { + 0x90,0x90,0x79,0x90,0x9d,0x48,0x90,0x90, 0x90,0x90,0x2e,0x90,0x90,0xa5,0x72,0x90, /* 00 */ + 0x46,0x5b,0xb1,0x3a,0xc3,0x90,0x35,0x90, 0x90,0x23,0x90,0x99,0x90,0x05,0x90,0x3c, /* 10 */ + 0x3b,0x76,0x11,0x90,0x90,0x4b,0x90,0x92, 0x90,0x32,0x5d,0x90,0xf7,0x5a,0x9c,0x90, /* 20 */ + 0x26,0x40,0x89,0x90,0x90,0x90,0x90,0x57, 0x90,0x90,0x90,0x90,0x90,0xba,0x53,0xbb, /* 30 */ + 0x42,0x59,0x2f,0x90,0x77,0x90,0x90,0x4f, 0xbf,0x4a,0xcb,0x86,0x62,0x7d,0x90,0xb8, /* 40 */ + 0x90,0x34,0x90,0x5f,0x90,0x7f,0xf8,0x80, 0xa0,0x84,0x12,0x52,0x90,0x90,0x90,0x47, /* 50 */ + 0x90,0x2b,0x88,0xf9,0x90,0xa3,0x83,0x90, 0x75,0x87,0x90,0xab,0xeb,0x90,0xfe,0x90, /* 60 */ + 0x90,0xaf,0xd0,0x2c,0xd1,0xe6,0x90,0x43, 0xa2,0xe7,0x85,0xe2,0x49,0x22,0x29,0x90, /* 70 */ + 0x7c,0x90,0x90,0x9a,0x90,0x90,0xb9,0x90, 0x14,0xcf,0x33,0x02,0x90,0x90,0x90,0x73, /* 80 */ + 0x90,0xc5,0x90,0x90,0x90,0xf3,0xf6,0x24, 0x90,0x56,0xd3,0x90,0x09,0x01,0x90,0x90, /* 90 */ + 0x03,0x2d,0x1b,0x90,0xf5,0xbe,0x90,0x90, 0xfb,0x8e,0x21,0x8d,0x0b,0x90,0x90,0xb2, /* A0 */ + 0xfc,0xfa,0xc6,0x90,0xe8,0xd2,0x90,0x08, 0x0a,0xa8,0x78,0xff,0x90,0xb5,0x90,0x90, /* B0 */ + 0xc7,0x06,0x18,0x90,0x90,0x1e,0x7e,0xb0, 0x0e,0x0f,0x90,0x90,0x0c,0xaa,0x55,0x90, /* C0 */ + 0x90,0x74,0x3d,0x90,0x90,0x38,0x27,0x50, 0x90,0xb6,0x5e,0x8b,0x07,0xe5,0x39,0xea, /* D0 */ + 0xbd,0x90,0x81,0xb7,0x90,0x8a,0x0d,0x90, 0x58,0xa1,0xa9,0x36,0x90,0xc4,0x90,0x8f, /* E0 */ + 0x8c,0x1f,0x51,0x04,0xf2,0x90,0xb3,0xb4, 0xe9,0x2a,0x90,0x90,0x90,0x25,0x90,0xbc, /* F0 */ + }; + public static byte[] lethalth_decryption_table = new byte[256]{ + 0x7f,0x26,0x5d,0x90,0xba,0x90,0x1e,0x5e, 0xb8,0x90,0xbc,0xe8,0x01,0x90,0x4a,0x25, /* 00 */ + 0x90,0xbd,0x90,0x22,0x10,0x90,0x02,0x57, 0x70,0x90,0x7e,0x90,0xe7,0x52,0x90,0xa9, /* 10 */ + 0x90,0x90,0xc6,0x06,0xa0,0xfe,0xcf,0x8e, 0x43,0x8f,0x2d,0x90,0xd4,0x85,0x75,0xa2, /* 20 */ + 0x3d,0x90,0x90,0x38,0x7c,0x89,0xd1,0x80, 0x3b,0x72,0x07,0x90,0x42,0x37,0x0a,0x18, /* 30 */ + 0x88,0xb4,0x98,0x8b,0xb9,0x9c,0xad,0x0e, 0x2b,0x90,0xbf,0x90,0x55,0x90,0x56,0xb0, /* 40 */ + 0x93,0x91,0x90,0xeb,0x90,0x50,0x41,0x29, 0x47,0x90,0x90,0x60,0x90,0xab,0x90,0x90, /* 50 */ + 0xc3,0xe2,0xd0,0xb2,0x11,0x79,0x90,0x08, 0x90,0xfb,0x90,0x2c,0x23,0x90,0x28,0x0d, /* 60 */ + 0x90,0x90,0x90,0x83,0x3c,0x90,0x1b,0x34, 0x5b,0x90,0x40,0x90,0x90,0x04,0xfc,0xcd, /* 70 */ + 0xb1,0xf3,0x8a,0x90,0x90,0x87,0x90,0x90, 0x90,0x90,0x90,0x90,0xbe,0x84,0x1f,0xe6, /* 80 */ + 0xff,0x90,0x12,0x90,0xb5,0x36,0x90,0xb3, 0x90,0x90,0x90,0xd2,0x4e,0x90,0x90,0x90, /* 90 */ + 0xa5,0x90,0x90,0xc7,0x90,0x27,0x0b,0x90, 0x20,0x90,0x90,0x90,0x90,0x90,0x61,0x7d, /* A0 */ + 0x90,0x90,0x86,0x0f,0x90,0xb7,0x90,0x4f, 0x90,0x90,0xc0,0xfd,0x90,0x39,0x90,0x77, /* B0 */ + 0x05,0x3a,0x90,0x48,0x92,0x76,0x3e,0x03, 0x90,0xf8,0x90,0x59,0xa8,0x5f,0xf9,0xbb, /* C0 */ + 0x81,0xfa,0x9d,0xe9,0x2e,0xa1,0xc1,0x33, 0x90,0x78,0x90,0x0c,0x90,0x24,0xaa,0xac, /* D0 */ + 0x90,0xb6,0x90,0xea,0x90,0x73,0xe5,0x58, 0x00,0xf7,0x90,0x74,0x90,0x76,0x90,0xa3, /* E0 */ + 0x90,0x5a,0xf6,0x32,0x46,0x2a,0x90,0x90, 0x53,0x4b,0x90,0x0d,0x51,0x68,0x99,0x13, /* F0 */ + }; + public static byte[] dynablaster_decryption_table = new byte[256]{ + 0x1f,0x51,0x84,0x90,0x3d,0x09,0x0d,0x90, 0x90,0x57,0x90,0x90,0x90,0x32,0x11,0x90, /* 00 */ + 0x90,0x9c,0x90,0x90,0x4b,0x90,0x90,0x03, 0x90,0x90,0x90,0x89,0xb0,0x90,0x90,0x90, /* 10 */ + 0x90,0xbb,0x18,0xbe,0x53,0x21,0x55,0x7c, 0x90,0x90,0x47,0x58,0xf6,0x90,0x90,0xb2, /* 20 */ + 0x06,0x90,0x2b,0x90,0x2f,0x0b,0xfc, 0x91 , 0x90,0x90,0xfa,0x81,0x83,0x40,0x38,0x90, /* 30 */ + 0x90,0x90,0x49,0x85,0xd1,0xf5,0x07,0xe2, 0x5e,0x1e,0x90,0x04,0x90,0x90,0x90,0xb1, /* 40 */ + 0xc7,0x90,0x96, 0xf2 /*0xaf*/, 0xb6,0xd2,0xc3,0x90, 0x87,0xba,0xcb,0x88,0x90,0xb9,0xd0,0xb5, /* 50 */ + 0x9a,0x80,0xa2,0x72,0x90,0xb4,0x90,0xaa, 0x26,0x7d,0x52,0x33,0x2e,0xbc,0x08,0x79, /* 60 */ + 0x48,0x90,0x76,0x36,0x02,0x90,0x5b,0x12, 0x8b,0xe7,0x90,0x90,0x90,0xab,0x90,0x4f, /* 70 */ + 0x90,0x90,0xa8,0xe5,0x39,0x0e,0xa9,0x90, 0x90,0x14,0x90,0xff, 0x7f/*0x75*/ ,0x90,0x90,0x27, /* 80 */ + 0x90,0x01,0x90,0x90,0xe6,0x8a,0xd3,0x90, 0x90,0x8e,0x56,0xa5,0x92,0x90,0x90,0xf9, /* 90 */ + 0x22,0x90,0x5f,0x90,0x90,0xa1,0x90,0x74, 0xb8,0x90,0x46,0x05,0xeb,0xcf,0xbf,0x5d, /* a0 */ + 0x24,0x90,0x9d,0x90,0x90,0x90,0x90,0x90, 0x59,0x8d,0x3c,0xf8,0xc5,0x90,0xf3,0x4e, /* b0 */ + 0x90,0x90,0x50,0xc6,0xe9,0xfe,0x0a,0x90, 0x99,0x86,0x90,0x90,0xaf ,0x8c/*0x8e*/,0x42,0xf7, /* c0 */ + 0x90,0x41,0x90,0xa3,0x90,0x3a,0x2a,0x43, 0x90,0xb3,0xe8,0x90,0xc4,0x35,0x78,0x25, /* d0 */ + 0x75,0x90,0xb7,0x90,0x23,0x90, 0x90/*0xe2*/,0x8f, 0x90,0x90,0x2c,0x90,0x77,0x7e,0x90,0x0f, /* e0 */ + 0x0c,0xa0,0xbd,0x90,0x90,0x2d,0x29,0xea, 0x90,0x3b,0x73,0x90,0xfb,0x20,0x90,0x5a /* f0 */ + }; + public static byte[] mysticri_decryption_table = new byte[256]{ + 0x90,0x57,0x90,0x90,0x90,0x90,0x90,0x90, 0xbf,0x43,0x90,0x90,0x90,0x90,0xfc,0x90, /* 00 */ + 0x90,0x90,0x90,0x90,0x90,0x52,0xa3,0x26, 0x90,0xc7,0x90,0x0f,0x90,0x0c,0x90,0x90, /* 10 */ + 0x90,0x90,0xff,0x90,0x90,0x02,0x90,0x90, 0x2e,0x90,0x5f,0x90,0x90,0x90,0x73,0x50, /* 20 */ + 0xb2,0x3a,0x90,0x90,0xbb,0x90,0x90,0x90, 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, /* 30 */ + 0x90,0x90,0x8e,0x3c,0x42,0x90,0x90,0xb9, 0x90,0x90,0x2a,0x90,0x47,0xa0,0x2b,0x03, /* 40 */ + 0xb5,0x1f,0x90,0xaa,0x90,0xfb,0x90,0x90, 0x90,0x90,0x90,0x90,0x38,0x90,0x90,0x90, /* 50 */ + 0x2c,0x90,0x90,0xc6,0x90,0x90,0xb1,0x90, 0x90,0x90,0x90,0x90,0x90,0x90,0xa2,0x90, /* 60 */ + 0xe9,0xe8,0x90,0x90,0x86,0x90,0x8b,0x90, 0x90,0x90,0x90,0x90,0x5b,0x72,0x90,0x90, /* 70 */ + 0x90,0x90,0x5d,0x0a,0x90,0x90,0x89,0x90, 0xb0,0x88,0x90,0x90,0x90,0x87,0x75,0xbd, /* 80 */ + 0x90,0x51,0x90,0x90,0x90,0x90,0x90,0x90, 0x90,0x90,0x90,0x5a,0x58,0x90,0x90,0x56, /* 90 */ + 0x90,0x8a,0x90,0x55,0x90,0x90,0x90,0xb4, 0x08,0x90,0xf6,0x90,0x90,0x9d,0x90,0xbc, /* A0 */ + 0x0b,0x90,0x90,0x5e,0x90,0x90,0x90,0x22, 0x36,0x90,0x1e,0x90,0xb6,0xba,0x23,0x90, /* B0 */ + 0x20,0x90,0x90,0x90,0x59,0x53,0x90,0x04, 0x81,0x90,0x90,0xf3,0x90,0x90,0x3b,0x06, /* C0 */ + 0x90,0x79,0x83,0x9c,0x90,0x18,0x80,0x90, 0xc3,0x90,0x90,0x90,0x32,0x90,0xcf,0x90, /* D0 */ + 0xeb,0x90,0x90,0x33,0x90,0xfa,0x90,0x90, 0xd2,0x90,0x24,0x90,0x74,0x41,0xb8,0x90, /* E0 */ + 0x90,0x90,0xd0,0x07,0x90,0x90,0x90,0x90, 0x90,0x46,0x90,0xea,0xfe,0x78,0x90,0x90, /* F0 */ + }; + public static byte[] majtitl2_decryption_table = new byte[256]{ + 0x87,0x90,0x78,0xaa,0x90,0x90,0x90,0x2c, 0x32,0x0a,0x0f,0x90,0x5e,0x90,0xc6,0x8a, /* 00 */ + 0x33,0x90,0x90,0x90,0x90,0xea,0x90,0x72, 0x90,0x90,0x90,0x90,0x90,0x90,0x24,0x55, /* 10 */ + 0x90,0x90,0x90,0x89,0xfb,0x90,0x59,0x02, 0x90,0x90,0x5d,0x90,0x90,0x90,0x36,0x90, /* 20 */ + 0x90,0x06,0x79,0x90,0x90,0x1e,0x07,0x90, 0x90,0x90,0x83,0x90,0x90,0x90,0x90,0x90, /* 30 */ + 0x9d,0x90,0x90,0x74,0x90,0x90,0x90,0x0c, 0x58,0x90,0x90,0x90,0x90,0x90,0x90,0x90, /* 40 */ + 0x3c,0x90,0x03,0x90,0x90,0xfa,0x43,0x90, 0xbf,0x90,0x90,0x75,0x90,0x88,0x90,0x80, /* 50 */ + 0x90,0xa3,0x90,0xfe,0x90,0x90,0x90,0x90, 0x90,0x90,0x90,0x90,0x3a,0x90,0x90,0x90, /* 60 */ + 0x2b,0x90,0x90,0x90,0x90,0xe9,0x5f,0x90, 0x46,0x90,0x41,0x90,0x18,0xb8,0x90,0x90, /* 70 */ + 0xb4,0x5a,0xb1,0x90,0x90,0x50,0xe8,0x20, 0x90,0xb2,0x90,0x90,0x90,0x90,0x90,0x51, /* 80 */ + 0x90,0x90,0x90,0x56,0x90,0x90,0x90,0x90, 0x90,0xcf,0x90,0x90,0x90,0xc3,0x90,0x90, /* 90 */ + 0x90,0x90,0x90,0x90,0x0b,0x90,0x90,0xb5, 0x57,0x90,0x90,0xc7,0x3b,0x90,0x90,0x90, /* A0 */ + 0x90,0x90,0x90,0x90,0xb6,0x90,0xeb,0x90, 0x38,0x90,0xa0,0x08,0x90,0x86,0xb0,0x90, /* B0 */ + 0x42,0x1f,0x73,0x90,0xf6,0x90,0x90,0x90, 0x53,0x90,0x52,0x90,0x04,0xbd,0x90,0x90, /* C0 */ + 0x26,0xff,0x2e,0x90,0x81,0x90,0x47,0x90, 0x90,0x90,0x90,0xd0,0x22,0x90,0x90,0xb9, /* D0 */ + 0x23,0x90,0xf3,0x90,0x90,0x90,0x90,0x90, 0x90,0xd2,0x8b,0xba,0x90,0x90,0x90,0x5b, /* E0 */ + 0x90,0x90,0x9c,0x90,0x90,0x90,0x90,0xfc, 0xbc,0xa2,0x2a,0x90,0x90,0x8e,0xbb,0x90, /* F0 */ + }; + public static byte[] hook_decryption_table = new byte[256] { + 0xb6,0x20,0x22,0x90,0x0f,0x57,0x59,0xc6, 0xeb,0x90,0xb0,0xbb,0x3b,0x90,0x90,0x90, /* 00 */ + 0x36,0x90,0x90,0x90,0x90,0x90,0x90,0x90, 0x90,0xfe,0x90,0x90,0x90,0x90,0x90,0xa0, /* 10 */ + 0x2e,0x90,0x0b,0x90,0x90,0x58,0x90,0x90, 0x90,0x90,0x90,0x90,0x90,0x80,0x90,0x90, /* 20 */ + 0x33,0x90,0x90,0xbf,0x55,0x90,0x90,0x90, 0x53,0x90,0x90,0x90,0x90,0x90,0x90,0x90, /* 30 */ + 0x47,0x74,0x90,0xb1,0xb4,0x90,0x90,0x88, 0x90,0x90,0x38,0xcf,0x90,0x8e,0x90,0x90, /* 40 */ + 0x90,0xc7,0x90,0x32,0x90,0x52,0x3c,0x90, 0x90,0x90,0x90,0x90,0x90,0x90,0x83,0x72, /* 50 */ + 0x90,0x73,0x90,0x5a,0x90,0x43,0x90,0x90, 0x90,0x90,0x41,0xe9,0xbd,0x90,0xb2,0xd2, /* 60 */ + 0x90,0xaa,0xa2,0x90,0x90,0x90,0x90,0x90, 0x90,0x90,0x90,0x26,0x90,0x90,0x8a,0x90, /* 70 */ + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x18, 0x90,0x9d,0x90,0x90,0x90,0x5d,0x90,0x46, /* 80 */ + 0x90,0x90,0x90,0xf6,0xc3,0xa3,0x1e,0x07, 0x5f,0x81,0x90,0x0c,0x90,0xb8,0x90,0x75, /* 90 */ + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x79, /* A0 */ + 0x90,0x5e,0x90,0x90,0x06,0x90,0xff,0x90, 0x5b,0x24,0x90,0x2b,0x90,0x90,0x90,0x02, /* B0 */ + 0x86,0x90,0x90,0xfb,0x90,0x90,0x50,0xfc, 0x08,0x90,0x90,0x90,0x03,0x90,0xb9,0x90, /* C0 */ + 0x90,0xbc,0xe8,0x1f,0xfa,0x42,0x90,0x90, 0x89,0x90,0x23,0x87,0x90,0x2a,0x90,0x90, /* D0 */ + 0x8b,0x90,0xf3,0xea,0x04,0x2c,0xb5,0x90, 0x0a,0x90,0x51,0x90,0x90,0x3a,0x90,0x9c, /* E0 */ + 0x90,0x90,0x78,0x90,0xba,0x90,0x90,0x90, 0x90,0x90,0x90,0x90,0xd0,0x56,0x90,0x90, /* F0 */ + }; + public static byte[] rtypeleo_decryption_table = new byte[256]{ + 0x5d,0x90,0xc6,0x90,0x90,0x90,0x2a,0x3a, 0x90,0x90,0x90,0x86,0x90,0x22,0x90,0xf3, /* 00 */ + 0x90,0x90,0x90,0x90,0x90,0x38,0x01,0x42, 0x04,0x90,0x90,0x1f,0x90,0x90,0x90,0x58, /* 10 */ + 0x57,0x2e,0x90,0x90,0x53,0x90,0xb9,0x90, 0x90,0x90,0x90,0x90,0x20,0x55,0x90,0x3d, /* 20 */ + 0xa0,0x90,0x90,0x0c,0x03,0x90,0x83,0x90, 0x90,0x90,0x8a,0x90,0x90,0xaa,0x90,0x90, /* 30 */ + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, 0x90,0x41,0x0a,0x26,0x8b,0x56,0x5e,0x90, /* 40 */ + 0x90,0x74,0x90,0x90,0x90,0x90,0x06,0x90, 0x90,0x89,0x5b,0xc7,0x43,0x90,0x90,0x90, /* 50 */ + 0x90,0xb6,0x90,0x3b,0x90,0x90,0x90,0x90, 0x90,0x36,0xea,0x80,0x90,0x90,0x90,0x5f, /* 60 */ + 0x90,0x0f,0x90,0x90,0x90,0x46,0x90,0x90, 0x3c,0x8e,0x90,0xa3,0x87,0x90,0x90,0x90, /* 70 */ + 0x2b,0xfb,0x47,0x0b,0x90,0xfc,0x02,0x90, 0x90,0x90,0x90,0x90,0x90,0x90,0x72,0x2c, /* 80 */ + 0x33,0x90,0x90,0x90,0x90,0x90,0x9d,0xbd, 0x90,0xb2,0x90,0x78,0x75,0xb8,0x90,0x90, /* 90 */ + 0x90,0x90,0x90,0x90,0xcf,0x5a,0x88,0x90, 0x90,0x90,0xc3,0x90,0xeb,0xfa,0x90,0x32, /* A0 */ + 0x90,0x90,0x90,0x52,0xb4,0x90,0x90,0x90, 0x90,0xbc,0x90,0x90,0x90,0xb1,0x59,0x50, /* B0 */ + 0x90,0x90,0xb5,0x90,0x08,0xa2,0xbf,0xbb, 0x1e,0x9c,0x90,0x73,0x90,0xd0,0x90,0x90, /* C0 */ + 0x90,0x90,0x90,0x90,0x81,0x90,0x79,0x90, 0x90,0x24,0x23,0x90,0x90,0xb0,0x07,0xff, /* D0 */ + 0x90,0xba,0xf6,0x51,0x90,0x90,0x90,0xfe, 0x90,0x90,0x90,0x90,0x90,0x90,0xe9,0x90, /* E0 */ + 0x90,0x90,0x90,0x90,0x90,0x90,0xe8,0xd2, 0x90,0x18,0x90,0x90,0x90,0xd1,0x90,0x90, /* F0 */ + }; + public static byte[] inthunt_decryption_table = new byte[256]{ + 0x1f,0x90,0xbb,0x50,0x90,0x58,0x42,0x57, 0x90,0x90,0xe9,0x90,0x90,0x90,0x90,0x0b, /* 00 */ + 0x90,0x90,0x9d,0x9c,0x90,0x90,0x1e,0x90, 0x90,0xb4,0x5b,0x90,0x90,0x90,0x90,0x90, /* 10 */ + 0x90,0x90,0x78,0xc7,0x90,0x90,0x83,0x90, 0x90,0x0c,0xb0,0x04,0x90,0x90,0x90,0x90, /* 20 */ + 0x90,0x90,0x90,0x90,0x3b,0xc3,0xb5,0x47, 0x90,0x90,0x90,0x90,0x59,0x90,0x90,0x90, /* 30 */ + 0x90,0x90,0x90,0x38,0x90,0x90,0x90,0x90, 0x5f,0xa3,0xfa,0x90,0xe8,0x36,0x75,0x90, /* 40 */ + 0x88,0x33,0x90,0x90,0x90,0x90,0x43,0x90, 0x90,0x87,0x90,0x90,0x90,0x90,0x90,0x90, /* 50 */ + 0x90,0x90,0x90,0x90,0x8e,0xf3,0x56,0x90, 0x90,0x90,0x90,0x26,0xff,0x90,0x90,0x90, /* 60 */ + 0x90,0x90,0x90,0x2a,0x90,0x8a,0x90,0x18, 0x90,0x90,0x03,0x89,0x24,0x90,0x90,0x90, /* 70 */ + 0x0a,0x90,0xeb,0x90,0x86,0x90,0x90,0x90, 0x79,0x3a,0x90,0x90,0x90,0x90,0xa0,0x90, /* 80 */ + 0xea,0x90,0x90,0x90,0x90,0x90,0x2c,0x90, 0xc6,0x90,0x90,0x46,0x90,0xaa,0xb6,0x5e, /* 90 */ + 0x90,0x90,0x90,0x90,0x8b,0x90,0x90,0x90, 0x90,0x90,0xba,0x90,0xb9,0x53,0xa2,0x90, /* A0 */ + 0x90,0x07,0x90,0x90,0x90,0x3c,0x32,0x90, 0x2b,0x90,0xb8,0x90,0x90,0x90,0x90,0x90, /* B0 */ + 0xbd,0x90,0x90,0x90,0x90,0x81,0x90,0xd0, 0x08,0x90,0x55,0x06,0xcf,0x90,0x90,0xfc, /* C0 */ + 0x90,0x90,0x90,0xb1,0xbf,0x90,0x90,0x51, 0x52,0x90,0x5d,0x90,0x5a,0x90,0xb2,0x90, /* D0 */ + 0xfe,0x90,0x90,0x22,0x20,0x72,0xf6,0x80, 0x02,0x2e,0x90,0x74,0x0f,0x90,0x90,0x90, /* E0 */ + 0x90,0x90,0x90,0x90,0xbc,0x41,0x90,0xfb, 0x73,0x90,0x90,0x90,0x23,0xd2,0x90,0x90, /* F0 */ + }; + public static byte[] leagueman_decryption_table = new byte[256]{ + 0x90,0x90,0x90,0x55,0xbb,0x90,0x23,0x79, 0x90,0x90,0x90,0x90,0x90,0x90,0x38,0x90, /* 00 */ + 0x01,0x90,0x90,0x90,0x90,0x90,0x90,0x90, 0x3d,0x90,0x90,0x90,0xba,0x90,0x1e,0x90, /* 10 */ + 0x2c,0x46,0x90,0xb5,0x90,0x4b,0x90,0xfe, 0x90,0x90,0xfb,0x2e,0x90,0x90,0x36,0x04, /* 20 */ + 0xcf,0x90,0xf3,0x5a,0x8a,0x0c,0x9c,0x90, 0x90,0x90,0xb2,0x50,0x90,0x90,0x90,0x5f, /* 30 */ + 0x90,0x90,0x24,0x90,0x90,0x41,0x2b,0x90, 0xe9,0x90,0x08,0x3b,0x90,0x90,0x90,0x90, /* 40 */ + 0x90,0xd2,0x51,0x90,0x90,0x90,0x22,0x90, 0xeb,0x3a,0x5b,0xa2,0xb1,0x80,0x90,0x90, /* 50 */ + 0x90,0x90,0x90,0x90,0x59,0xb4,0x88,0x90, 0x90,0xbf,0xd1,0x90,0xb9,0x57,0x90,0x90, /* 60 */ + 0x72,0x90,0x73,0x90,0x90,0x90,0x90,0x0f, 0x90,0x90,0x90,0x90,0x56,0x90,0x90,0xc6, /* 70 */ + 0x90,0x90,0x90,0x90,0x90,0x2a,0x8e,0x90, 0x81,0xa3,0x58,0x90,0xaa,0x78,0x89,0x90, /* 80 */ + 0x90,0x90,0x90,0x90,0x90,0x90,0xbd,0x90, 0x90,0x90,0xff,0x90,0x90,0x90,0x07,0x53, /* 90 */ + 0xa0,0x90,0x90,0x5e,0xb0,0x90,0x83,0xf6, 0x90,0x26,0x32,0x90,0x90,0x90,0x74,0x0a, /* A0 */ + 0x18,0x90,0x90,0x90,0x75,0x03,0x90,0x90, 0xb6,0x02,0x90,0x90,0x43,0x90,0xb8,0x90, /* B0 */ + 0xe8,0x90,0xfc,0x90,0x20,0xc3,0x90,0x06, 0x90,0x1f,0x86,0x00,0x90,0x90,0x90,0xd0, /* C0 */ + 0x47,0x90,0x87,0x90,0x90,0x9d,0x3c,0xc7, 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, /* D0 */ + 0x90,0x90,0x90,0x8b,0x90,0x90,0x33,0x90, 0x90,0x90,0x90,0x90,0xfa,0x42,0x90,0x90, /* E0 */ + 0x90,0x90,0x90,0xea,0x90,0x52,0x90,0x5d, 0x90,0x90,0x90,0x90,0xbc,0x90,0x90,0x90, /* F0 */ + }; + public static byte[] psoldier_decryption_table = new byte[256]{ + 0x90,0x90,0x90,0x8a,0x90,0xaa,0x90,0x90, 0x90,0x20,0x23,0x55,0x90,0xb5,0x0a,0x90, /* 00 */ + 0x90,0x46,0x90,0xb6,0x90,0x74,0x8b,0x90, 0x90,0xba,0x01,0x90,0x90,0x5a,0x86,0xfb, /* 10 */ + 0xb2,0x90,0xb0,0x90,0x42,0x06,0x1e,0x08, 0x22,0x9d,0x90,0x90,0x90,0x90,0x90,0x73, /* 20 */ + 0x90,0x90,0x5f,0x90,0x90,0xd0,0x90,0xff, 0x90,0x90,0xbd,0x90,0x03,0x90,0xb9,0x90, /* 30 */ + 0x90,0x90,0x90,0x51,0x5e,0x24,0x90,0x90, 0x90,0x90,0x90,0x58,0x59,0x90,0x90,0x90, /* 40 */ + 0x52,0x90,0x90,0x90,0xa0,0x90,0x90,0x02, 0xd2,0x90,0x79,0x26,0x3a,0x0f,0xcf,0xb4, /* 50 */ + 0xf3,0x90,0x90,0x50,0x90,0x75,0xb1,0x90, 0xd1,0x47,0x90,0x90,0x90,0x90,0x90,0x90, /* 60 */ + 0xc6,0x90,0x90,0x90,0x90,0x90,0xbc,0x90, 0x90,0x90,0x90,0x90,0x53,0x41,0x90,0x90, /* 70 */ + 0x90,0x90,0x90,0x90,0x90,0x90,0x04,0x90, 0x90,0x90,0x90,0x2c,0x90,0xbf,0x90,0x90, /* 80 */ + 0x90,0x90,0xe8,0x90,0x90,0x78,0x90,0xbb, 0x90,0x90,0x1f,0x2b,0x87,0x90,0x4b,0x56, /* 90 */ + 0x36,0x33,0x90,0x90,0x90,0x9c,0xc3,0x90, 0x90,0x81,0x90,0xe9,0x90,0xfa,0x90,0x90, /* A0 */ + 0x90,0x72,0x90,0xa2,0x90,0x90,0xc7,0x90, 0x90,0x92,0x90,0x90,0x88,0x90,0x90,0x90, /* B0 */ + 0x3b,0x90,0x0c,0x90,0x80,0x90,0x90,0x90, 0x90,0x2e,0x90,0x90,0x90,0x57,0x90,0x8e, /* C0 */ + 0x07,0x90,0xa3,0x90,0x90,0x90,0x3d,0x90, 0xfe,0x90,0x90,0xfc,0xea,0x90,0x38,0x90, /* D0 */ + 0x3c,0xf6,0x90,0x90,0x90,0x18,0x90,0x90, 0xb8,0x90,0x90,0x90,0x2a,0x5d,0x5b,0x90, /* E0 */ + 0x90,0x43,0x32,0x90,0x90,0x90,0xeb,0x90, 0x90,0x90,0x90,0x90,0x83,0x89,0x90,0x90, /* F0 */ + }; + public static void M92Init() + { + int i1, i2, n1, n2; + byte[] bb1; + Machine.bRom = true; + EmuTimer.setvector = setvector_callback; + pf_master_control = new ushort[4]; + M92.pf_layer = new M92.pf_layer_info[3]; + for (i1 = 0; i1 < 3; i1++) + { + pf_layer[i1].control = new ushort[4]; + } + Generic.paletteram16_set = new ushort[0x800]; + Generic.spriteram16_set = new ushort[0x400]; + Generic.buffered_spriteram16_set = new ushort[0x400]; + m92_vram_data = new ushort[0x8000]; + m92_spritecontrol = new ushort[8]; + bb1 = Machine.GetRom("maincpu.rom"); + //Memory.mainrom = new byte[0x190000]; + //Array.Copy(bb1, Memory.mainrom, bb1.Length); + byte[] temp_mainrom = new byte[0x190000]; + Array.Copy(bb1, temp_mainrom, bb1.Length); + Memory.Set_mainrom(temp_mainrom); + + Memory.Set_audiorom(Machine.GetRom("soundcpu.rom")); + Iremga20.iremrom = Machine.GetRom("irem.rom"); + Memory.Set_mainram(new byte[0x10000]); + Memory.Set_audioram(new byte[0x4000]); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + n1 = gfx1romLength; + gfx11rom_set = new byte[n1 * 2]; + for (i1 = 0; i1 < n1; i1++) + { + gfx11rom[i1 * 2] = (byte)(gfx1rom[i1] >> 4); + gfx11rom[i1 * 2 + 1] = (byte)(gfx1rom[i1] & 0x0f); + } + gfx2rom_set = Machine.GetRom("gfx2.rom"); + n2 = gfx2romLength; + gfx21rom_set = new byte[n2 * 2]; + for (i2 = 0; i2 < n2; i2++) + { + gfx21rom[i2 * 2] = (byte)(gfx2rom[i2] >> 4); + gfx21rom[i2 * 2 + 1] = (byte)(gfx2rom[i2] & 0x0f); + } + eeprom_set = Machine.GetRom("eeprom.rom"); + m92_game_kludge = 0; + m92_irq_vectorbase = 0x80; + m92_sprite_buffer_busy = 1; + bankaddress = 0xa0000; + sound_status = 0; + dsw = 0xffbf; + switch (Machine.sName) + { + case "lethalth": + case "thndblst": + bankaddress = 0; + m92_irq_vectorbase = 0x20; + break; + case "majtitl2": + case "majtitl2a": + case "majtitl2b": + case "majtitl2j": + case "skingame": + case "skingame2": + m92_game_kludge = 2; + dsw = 0xfd9f; + break; + case "rtypeleo": + case "rtypeleoj": + m92_irq_vectorbase = 0x20; + break; + case "nbbatman": + case "lnbbatmanu": + case "leaguemn": + dsw = 0xff9f; + break; + case "ssoldier": + case "psoldier": + dsw = 0xff9f; + sound_status = 0x80; + m92_irq_vectorbase = 0x20; + break; + } + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || gfx11rom == null || gfx21rom == null) + { + Machine.bRom = false; + } + } + public static void machine_start_m92() + { + setvector_param = 0; + setvector_callback(); + scanline_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_m92_scanline_interrupt, false); + } + public static void machine_reset_m92() + { + m92_scanline_param = 0; + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + } + public static void m92_scanline_interrupt() + { + int scanline = m92_scanline_param; + if (scanline == m92_raster_irq_position) + { + Video.video_screen_update_partial(scanline); + Cpuexec.cpu[0].cpunum_set_input_line_and_vector(0, 0, LineState.HOLD_LINE, (m92_irq_vectorbase + 8) / 4); + } + else if (scanline == 0xf8) + { + Video.video_screen_update_partial(scanline); + Cpuexec.cpu[0].cpunum_set_input_line_and_vector(0, 0, LineState.HOLD_LINE, (m92_irq_vectorbase + 0) / 4); + } + if (++scanline >= Video.screenstate.height) + { + scanline = 0; + } + m92_scanline_param = scanline; + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + } + public static byte m92_eeprom_r(int offset) + { + return eeprom[offset]; + } + public static ushort m92_eeprom_r2(int offset) + { + return (ushort)(0xff00 | eeprom[offset]); + } + public static void m92_eeprom_w(int offset, byte data) + { + eeprom[offset] = data; + } + public static void m92_coincounter_w(byte data) + { + + } + public static void m92_bankswitch_w(byte data) + { + //if (ACCESSING_BITS_0_7) + { + bankaddress = 0x100000 + ((data & 0x7) * 0x10000); + //set_m92_bank(machine); + } + } + public static byte m92_sprite_busy_r() + { + return m92_sprite_buffer_busy; + } + public static void setvector_callback() + { + List lsvec = new List(); + foreach (vec v1 in Cpuint.lvec) + { + if (Attotime.attotime_compare(v1.time, EmuTimer.global_basetime) < 0) + { + lsvec.Add(v1); + } + else if (Attotime.attotime_compare(v1.time, EmuTimer.global_basetime) == 0) + { + setvector_param = v1.vector; + lsvec.Add(v1); + break; + } + } + foreach (vec v1 in lsvec) + { + Cpuint.lvec.Remove(v1); + } + switch (setvector_param) + { + case 0: + irqvector = 0; + break; + case 1: + irqvector |= 0x2; + break; + case 2: + irqvector &= 0xfd; + break; + case 3: + irqvector |= 0x1; + break; + case 4: + irqvector &= 0xfe; + break; + } + if ((irqvector & 0x2) != 0) + { + Cpuint.interrupt_vector[1, 0] = 0x18; + } + else if ((irqvector & 0x1) != 0) + { + Cpuint.interrupt_vector[1, 0] = 0x19; + } + if (irqvector == 0) + { + Cpuint.cpunum_set_input_line(1, 0, LineState.CLEAR_LINE); + } + else + { + Cpuint.cpunum_set_input_line(1, 0, LineState.ASSERT_LINE); + } + } + public static void m92_soundlatch_w(ushort data) + { + Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); + setvector_param = 3; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + Sound.soundlatch_w((ushort)(data & 0xff)); + } + public static ushort m92_sound_status_r() + { + return sound_status; + } + public static ushort m92_soundlatch_r() + { + return (ushort)(Sound.soundlatch_r() | 0xff00); + } + public static void m92_sound_irq_ack_w() + { + Cpuint.lvec.Add(new vec(4, EmuTimer.get_current_time())); + setvector_param = 4; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + public static void m92_sound_status_w(ushort data) + { + sound_status = data; + Cpuexec.cpu[0].cpunum_set_input_line_and_vector(0, 0, LineState.HOLD_LINE, (m92_irq_vectorbase + 12) / 4); + } + public static void sound_irq(int state) + { + if (state != 0) + { + Cpuint.lvec.Add(new vec(1, EmuTimer.get_current_time())); + setvector_param = 1; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + else + { + Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time())); + setvector_param = 2; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + } + public static void m92_sprite_interrupt() + { + Cpuexec.cpu[0].cpunum_set_input_line_and_vector(0, 0, LineState.HOLD_LINE, (m92_irq_vectorbase + 4) / 4); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/M92.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/M92.cs.meta new file mode 100644 index 00000000..8a8f86d7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/M92.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42f2c7ef6a90c884a943001d9abb3181 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory.cs new file mode 100644 index 00000000..b9c420b2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory.cs @@ -0,0 +1,511 @@ +namespace MAME.Core +{ + public unsafe partial class M92 + { + public static ushort ushort0, ushort1, ushort2, dsw; + public static ushort ushort0_old, ushort1_old, ushort2_old; + public static byte N0ReadOpByte(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0xfffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte N0ReadByte_m92(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0x9ffff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0xa0000 && address <= 0xbffff) + { + int offset = address - 0xa0000; + result = Memory.mainrom[bankaddress + offset]; + } + else if (address >= 0xc0000 && address <= 0xcffff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0xd0000 && address <= 0xdffff) + { + int offset = (address - 0xd0000) / 2; + if (address % 2 == 0) + { + result = (byte)(m92_vram_data[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (byte)m92_vram_data[offset]; + } + } + else if (address >= 0xe0000 && address <= 0xeffff) + { + int offset = address - 0xe0000; + result = Memory.mainram[offset]; + } + else if (address >= 0xf8000 && address <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + result = (byte)Generic.spriteram16[offset]; + } + else if (address >= 0xf8800 && address <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + result = (byte)m92_paletteram_r(offset); + } + else if (address >= 0xffff0 && address <= 0xfffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static ushort N0ReadWord_m92(int address) + { + address &= 0xfffff; + ushort result = 0; + if (address >= 0 && address + 1 <= 0x9ffff) + { + 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); + } + else if (address >= 0xc0000 && address + 1 <= 0xcffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + else if (address >= 0xd0000 && address + 1 <= 0xdffff) + { + int offset = (address - 0xd0000) / 2; + result = m92_vram_data[offset]; + } + else if (address >= 0xe0000 && address + 1 <= 0xeffff) + { + int offset = address - 0xe0000; + result = (ushort)(Memory.mainram[offset] + Memory.mainram[offset + 1] * 0x100); + } + else if (address >= 0xf8000 && address + 1 <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + result = Generic.spriteram16[offset]; + } + else if (address >= 0xf8800 && address + 1 <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + result = m92_paletteram_r(offset); + } + else if (address >= 0xffff0 && address + 1 <= 0xfffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + return result; + } + public static void N0WriteByte_m92(int address, byte value) + { + address &= 0xfffff; + if (address >= 0xd0000 && address <= 0xdffff) + { + int offset = (address - 0xd0000) / 2; + if (address % 2 == 0) + { + m92_vram_data[offset] = (ushort)((value << 8) | (m92_vram_data[offset] & 0xff)); + } + else if (address % 2 == 1) + { + m92_vram_data[offset] = (ushort)((m92_vram_data[offset] & 0xff00) | value); + } + m92_vram_w(offset); + } + else if (address >= 0xe0000 && address <= 0xeffff) + { + int offset = address - 0xe0000; + Memory.mainram[offset] = value; + } + else if (address >= 0xf8000 && address <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xf8800 && address <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + m92_paletteram_w(offset, value); + } + else if (address >= 0xf9000 && address <= 0xf900f) + { + int offset = (address - 0xf9000) / 2; + if (address % 2 == 0) + { + m92_spritecontrol_w1(offset, value); + } + else if (address % 2 == 1) + { + m92_spritecontrol_w2(offset, value); + } + } + else if (address >= 0xf9800 && address <= 0xf9801) + { + if (address % 2 == 1) + { + m92_videocontrol_w(value); + } + } + } + public static void N0WriteWord_m92(int address, ushort value) + { + address &= 0xfffff; + if (address >= 0xd0000 && address + 1 <= 0xdffff) + { + int offset = (address - 0xd0000) / 2; + m92_vram_data[offset] = value; + m92_vram_w(offset); + } + else if (address >= 0xe0000 && address + 1 <= 0xeffff) + { + int offset = address - 0xe0000; + Memory.mainram[offset] = (byte)value; + Memory.mainram[offset + 1] = (byte)(value >> 8); + } + else if (address >= 0xf8000 && address + 1 <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xf8800 && address + 1 <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + m92_paletteram_w(offset, value); + } + else if (address >= 0xf9000 && address + 1 <= 0xf900f) + { + int offset = (address - 0xf9000) / 2; + m92_spritecontrol_w(offset, value); + } + else if (address >= 0xf9800 && address + 1 <= 0xf9801) + { + m92_videocontrol_w((byte)value); + } + } + public static byte N0ReadIOByte_m92(int address) + { + byte result = 0; + if (address >= 0x00 && address <= 0x01) + { + if (address == 0x00) + { + result = (byte)ushort0; + } + else if (address == 0x01) + { + result = (byte)(ushort0 >> 8); + } + } + else if (address >= 0x02 && address <= 0x03) + { + result = (byte)ushort1; + } + else if (address >= 0x04 && address <= 0x05) + { + result = (byte)dsw; + } + else if (address >= 0x06 && address <= 0x07) + { + result = (byte)ushort2; + } + else if (address >= 0x08 && address <= 0x09) + { + result = (byte)m92_sound_status_r(); + } + return result; + } + public static ushort N0ReadIOWord_m92(int address) + { + ushort result = 0; + if (address >= 0x00 && address + 1 <= 0x01) + { + result = ushort0; + } + else if (address >= 0x02 && address + 1 <= 0x03) + { + result = ushort1; + result = (ushort)(result | (m92_sprite_busy_r() * 0x80)); + } + else if (address >= 0x04 && address + 1 <= 0x05) + { + result = dsw; + } + else if (address >= 0x06 && address + 1 <= 0x07) + { + result = ushort2; + } + else if (address >= 0x08 && address + 1 <= 0x09) + { + result = m92_sound_status_r(); + } + return result; + } + public static void N0WriteIOByte_m92(int address, byte value) + { + if (address >= 0x00 && address <= 0x01) + { + m92_soundlatch_w(value); + } + else if (address >= 0x02 && address <= 0x03) + { + m92_coincounter_w(value); + } + else if (address >= 0x20 && address <= 0x21) + { + m92_bankswitch_w(value); + } + else if (address >= 0x40 && address <= 0x43) + { + + } + else if (address >= 0x80 && address <= 0x87) + { + int offset = (address - 0x80) / 2; + if (address % 2 == 0) + { + m92_pf1_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_pf1_control_w1(offset, value); + } + } + else if (address >= 0x88 && address <= 0x8f) + { + int offset = (address - 0x88) / 2; + if (address % 2 == 0) + { + m92_pf2_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_pf2_control_w1(offset, value); + } + } + else if (address >= 0x90 && address <= 0x97) + { + int offset = (address - 0x90) / 2; + if (address % 2 == 0) + { + m92_pf3_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_pf3_control_w1(offset, value); + } + } + else if (address >= 0x98 && address <= 0x9f) + { + int offset = (address - 0x98) / 2; + if (address % 2 == 0) + { + m92_master_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_master_control_w1(offset, value); + } + } + } + public static void N0WriteIOWord_m92(int address, ushort value) + { + if (address >= 0x00 && address + 1 <= 0x01) + { + m92_soundlatch_w(value); + } + else if (address >= 0x02 && address + 1 <= 0x03) + { + m92_coincounter_w((byte)value); + } + else if (address >= 0x20 && address + 1 <= 0x21) + { + m92_bankswitch_w((byte)value); + } + else if (address >= 0x40 && address + 1 <= 0x43) + { + + } + else if (address >= 0x80 && address + 1 <= 0x87) + { + int offset = (address - 0x80) / 2; + m92_pf1_control_w(offset, value); + } + else if (address >= 0x88 && address + 1 <= 0x8f) + { + int offset = (address - 0x88) / 2; + m92_pf2_control_w(offset, value); + } + else if (address >= 0x90 && address + 1 <= 0x97) + { + int offset = (address - 0x90) / 2; + m92_pf3_control_w(offset, value); + } + else if (address >= 0x98 && address + 1 <= 0x9f) + { + int offset = (address - 0x98) / 2; + m92_master_control_w(offset, value); + } + } + public static byte N1ReadOpByte(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0x1ffff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xffff0 && address <= 0xfffff) + { + int offset = address - 0xe0000; + result = Memory.audiorom[offset]; + } + return result; + } + public static byte N1ReadByte(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0x1ffff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xa0000 && address <= 0xa3fff) + { + int offset = address - 0xa0000; + result = Memory.audioram[offset]; + } + else if (address >= 0xa8000 && address <= 0xa803f) + { + int offset = (address - 0xa8000) / 2; + result = (byte)Iremga20.irem_ga20_r(offset); + } + else if (address >= 0xa8042 && address <= 0xa8043) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0xa8044 && address <= 0xa8045) + { + result = (byte)m92_soundlatch_r(); + } + else if (address >= 0xffff0 && address <= 0xfffff) + { + int offset = address - 0xe0000; + result = Memory.mainrom[offset]; + } + return result; + } + public static ushort N1ReadWord(int address) + { + address &= 0xfffff; + ushort result = 0; + if (address >= 0 && address + 1 <= 0x1ffff) + { + result = (ushort)(Memory.audiorom[address] + Memory.audiorom[address + 1] * 0x100); + } + else if (address >= 0xa0000 && address + 1 <= 0xa3fff) + { + int offset = address - 0xa0000; + result = (ushort)(Memory.audioram[offset] + Memory.audioram[offset + 1] * 0x100); + } + else if (address >= 0xa8000 && address + 1 <= 0xa803f) + { + int offset = (address - 0xa8000) / 2; + result = Iremga20.irem_ga20_r(offset); + } + else if (address >= 0xa8042 && address + 1 <= 0xa8043) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0xa8044 && address + 1 <= 0xa8045) + { + result = m92_soundlatch_r(); + } + else if (address >= 0xffff0 && address + 1 <= 0xfffff) + { + int offset = address - 0xe0000; + result = (ushort)(Memory.mainrom[offset] + Memory.mainrom[offset + 1] * 0x100); + } + return result; + } + public static void N1WriteByte(int address, byte value) + { + address &= 0xfffff; + if (address >= 0x9ff00 && address <= 0x9ffff) + { + + } + else if (address >= 0xa0000 && address <= 0xa3fff) + { + int offset = address - 0xa0000; + Memory.audioram[offset] = value; + } + else if (address >= 0xa8000 && address <= 0xa803f) + { + int offset = (address - 0xa8000) / 2; + Iremga20.irem_ga20_w(offset, value); + } + else if (address >= 0xa8040 && address <= 0xa8041) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address >= 0xa8042 && address <= 0xa8043) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address >= 0xa8044 && address <= 0xa8045) + { + m92_sound_irq_ack_w(); + } + else if (address >= 0xa8046 && address <= 0xa8047) + { + m92_sound_status_w(value); + } + } + public static void N1WriteWord(int address, ushort value) + { + address &= 0xfffff; + if (address >= 0x9ff00 && address + 1 <= 0x9ffff) + { + + } + else if (address >= 0xa0000 && address + 1 <= 0xa3fff) + { + int offset = address - 0xa0000; + Memory.audioram[offset] = (byte)value; + Memory.audioram[offset + 1] = (byte)(value >> 8); + } + else if (address >= 0xa8000 && address + 1 <= 0xa803f) + { + int offset = (address - 0xa8000) / 2; + Iremga20.irem_ga20_w(offset, value); + } + else if (address >= 0xa8040 && address + 1 <= 0xa8041) + { + YM2151.ym2151_register_port_0_w((byte)value); + } + else if (address >= 0xa8042 && address + 1 <= 0xa8043) + { + YM2151.ym2151_data_port_0_w((byte)value); + } + else if (address >= 0xa8044 && address + 1 <= 0xa8045) + { + m92_sound_irq_ack_w(); + } + else if (address >= 0xa8046 && address + 1 <= 0xa8047) + { + m92_sound_status_w(value); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory.cs.meta new file mode 100644 index 00000000..507cc16c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d139aed743b48294eabdfa8d53b151d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory2.cs new file mode 100644 index 00000000..c74080a4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory2.cs @@ -0,0 +1,321 @@ +namespace MAME.Core +{ + public unsafe partial class M92 + { + public static byte N0ReadByte_lethalth(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0 && address <= 0x7ffff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x80000 && address <= 0x8ffff) + { + int offset = (address - 0x80000) / 2; + if (address % 2 == 0) + { + result = (byte)(m92_vram_data[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (byte)m92_vram_data[offset]; + } + } + else if (address >= 0xe0000 && address <= 0xeffff) + { + int offset = address - 0xe0000; + result = Memory.mainram[offset]; + } + else if (address >= 0xf8000 && address <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + result = (byte)Generic.spriteram16[offset]; + } + else if (address >= 0xf8800 && address <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + result = (byte)m92_paletteram_r(offset); + } + else if (address >= 0xffff0 && address <= 0xfffff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static ushort N0ReadWord_lethalth(int address) + { + address &= 0xfffff; + ushort result = 0; + if (address >= 0 && address + 1 <= 0x7ffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + else if (address >= 0x80000 && address + 1 <= 0x8ffff) + { + int offset = (address - 0x80000) / 2; + result = m92_vram_data[offset]; + } + else if (address >= 0xe0000 && address + 1 <= 0xeffff) + { + int offset = address - 0xe0000; + result = (ushort)(Memory.mainram[offset] + Memory.mainram[offset + 1] * 0x100); + } + else if (address >= 0xf8000 && address + 1 <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + result = Generic.spriteram16[offset]; + } + else if (address >= 0xf8800 && address + 1 <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + result = m92_paletteram_r(offset); + } + else if (address >= 0xffff0 && address + 1 <= 0xfffff) + { + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); + } + return result; + } + public static void N0WriteByte_lethalth(int address, byte value) + { + address &= 0xfffff; + if (address >= 0x80000 && address <= 0x8ffff) + { + int offset = (address - 0x80000) / 2; + if (address % 2 == 0) + { + m92_vram_data[offset] = (ushort)((value << 8) | (m92_vram_data[offset] & 0xff)); + } + else if (address % 2 == 1) + { + m92_vram_data[offset] = (ushort)((m92_vram_data[offset] & 0xff00) | value); + } + m92_vram_w(offset); + } + else if (address >= 0xe0000 && address <= 0xeffff) + { + int offset = address - 0xe0000; + Memory.mainram[offset] = value; + } + else if (address >= 0xf8000 && address <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xf8800 && address <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + m92_paletteram_w(offset, value); + } + else if (address >= 0xf9000 && address <= 0xf900f) + { + int offset = (address - 0xf9000) / 2; + if (address % 2 == 0) + { + m92_spritecontrol_w1(offset, value); + } + else if (address % 2 == 1) + { + m92_spritecontrol_w2(offset, value); + } + } + else if (address >= 0xf9800 && address <= 0xf9801) + { + if (address % 2 == 1) + { + m92_videocontrol_w(value); + } + } + } + public static void N0WriteWord_lethalth(int address, ushort value) + { + address &= 0xfffff; + if (address >= 0x80000 && address + 1 <= 0x8ffff) + { + int offset = (address - 0x80000) / 2; + m92_vram_data[offset] = value; + m92_vram_w(offset); + } + else if (address >= 0xe0000 && address + 1 <= 0xeffff) + { + int offset = address - 0xe0000; + Memory.mainram[offset] = (byte)value; + Memory.mainram[offset + 1] = (byte)(value >> 8); + } + else if (address >= 0xf8000 && address + 1 <= 0xf87ff) + { + int offset = (address - 0xf8000) / 2; + Generic.spriteram16[offset] = value; + } + else if (address >= 0xf8800 && address + 1 <= 0xf8fff) + { + int offset = (address - 0xf8800) / 2; + m92_paletteram_w(offset, value); + } + else if (address >= 0xf9000 && address + 1 <= 0xf900f) + { + int offset = (address - 0xf9000) / 2; + m92_spritecontrol_w(offset, value); + } + else if (address >= 0xf9800 && address + 1 <= 0xf9801) + { + m92_videocontrol_w((byte)value); + } + } + public static void N0WriteIOByte_lethalth(int address, byte value) + { + if (address >= 0x00 && address <= 0x01) + { + m92_soundlatch_w(value); + } + else if (address >= 0x02 && address <= 0x03) + { + m92_coincounter_w(value); + } + else if (address >= 0x40 && address <= 0x43) + { + + } + else if (address >= 0x80 && address <= 0x87) + { + int offset = (address - 0x80) / 2; + if (address % 2 == 0) + { + m92_pf1_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_pf1_control_w1(offset, value); + } + } + else if (address >= 0x88 && address <= 0x8f) + { + int offset = (address - 0x88) / 2; + if (address % 2 == 0) + { + m92_pf2_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_pf2_control_w1(offset, value); + } + } + else if (address >= 0x90 && address <= 0x97) + { + int offset = (address - 0x90) / 2; + if (address % 2 == 0) + { + m92_pf3_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_pf3_control_w1(offset, value); + } + } + else if (address >= 0x98 && address <= 0x9f) + { + int offset = (address - 0x98) / 2; + if (address % 2 == 0) + { + m92_master_control_w2(offset, value); + } + else if (address % 2 == 1) + { + m92_master_control_w1(offset, value); + } + } + } + public static void N0WriteIOWord_lethalth(int address, ushort value) + { + if (address >= 0x00 && address + 1 <= 0x01) + { + m92_soundlatch_w(value); + } + else if (address >= 0x02 && address + 1 <= 0x03) + { + m92_coincounter_w((byte)value); + } + else if (address >= 0x40 && address + 1 <= 0x43) + { + + } + else if (address >= 0x80 && address + 1 <= 0x87) + { + int offset = (address - 0x80) / 2; + m92_pf1_control_w(offset, value); + } + else if (address >= 0x88 && address + 1 <= 0x8f) + { + int offset = (address - 0x88) / 2; + m92_pf2_control_w(offset, value); + } + else if (address >= 0x90 && address + 1 <= 0x97) + { + int offset = (address - 0x90) / 2; + m92_pf3_control_w(offset, value); + } + else if (address >= 0x98 && address + 1 <= 0x9f) + { + int offset = (address - 0x98) / 2; + m92_master_control_w(offset, value); + } + } + public static byte N0ReadByte_majtitl2(int address) + { + address &= 0xfffff; + byte result = 0; + if (address >= 0xf0000 && address <= 0xf3fff) + { + int offset = (address - 0xf0000) / 2; + result = m92_eeprom_r(offset); + } + else + { + result = N0ReadByte_m92(address); + } + return result; + } + public static ushort N0ReadWord_majtitl2(int address) + { + address &= 0xfffff; + ushort result = 0; + if (address >= 0xf0000 && address + 1 <= 0xf3fff) + { + int offset = (address - 0xf0000) / 2; + result = m92_eeprom_r2(offset); + } + else + { + result = N0ReadWord_m92(address); + } + return result; + } + public static void N0WriteByte_majtitl2(int address, byte value) + { + address &= 0xfffff; + if (address >= 0xf0000 && address <= 0xf3fff) + { + int offset = (address - 0xf0000) / 2; + m92_eeprom_w(offset, value); + } + else + { + N0WriteByte_m92(address, value); + } + } + public static void N0WriteWord_majtitl2(int address, ushort value) + { + address &= 0xfffff; + if (address >= 0xf0000 && address + 1 <= 0xf3fff) + { + int offset = (address - 0xf0000) / 2; + m92_eeprom_w(offset, (byte)value); + } + else + { + N0WriteWord_m92(address, value); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory2.cs.meta new file mode 100644 index 00000000..30a4b45c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7504ab0974ce5fb4eaaff3ce636d7eee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/State.cs new file mode 100644 index 00000000..1b705cd5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/State.cs @@ -0,0 +1,163 @@ +using cpu.nec; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class M92 + { + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + writer.Write(dsw); + writer.Write(irqvector); + writer.Write(sound_status); + writer.Write(bankaddress); + writer.Write(m92_irq_vectorbase); + writer.Write(m92_raster_irq_position); + writer.Write(m92_scanline_param); + writer.Write(setvector_param); + writer.Write(m92_sprite_buffer_busy); + for (i = 0; i < 4; i++) + { + writer.Write(pf_master_control[i]); + } + writer.Write(m92_sprite_list); + for (i = 0; i < 0x8000; i++) + { + writer.Write(m92_vram_data[i]); + } + for (i = 0; i < 8; i++) + { + writer.Write(m92_spritecontrol[i]); + } + writer.Write(m92_game_kludge); + writer.Write(m92_palette_bank); + for (i = 0; i < 3; i++) + { + writer.Write(pf_layer[i].vram_base); + } + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + writer.Write(pf_layer[i].control[j]); + } + } + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x400; i++) + { + writer.Write(Generic.spriteram16[i]); + } + for (i = 0; i < 0x400; i++) + { + writer.Write(Generic.buffered_spriteram16[i]); + } + for (i = 0; i < 0x801; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x10000); + Nec.nn1[0].SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x4000); + Nec.nn1[1].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + Cpuint.SaveStateBinary_v(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + Iremga20.SaveStateBinary(writer); + writer.Write(Sound.latched_value[0]); + writer.Write(Sound.utempdata[0]); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.iremga20stream.output_sampindex); + writer.Write(Sound.iremga20stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + dsw = reader.ReadUInt16(); + irqvector = reader.ReadByte(); + sound_status = reader.ReadUInt16(); + bankaddress = reader.ReadInt32(); + m92_irq_vectorbase = reader.ReadByte(); + m92_raster_irq_position = reader.ReadInt32(); + m92_scanline_param = reader.ReadInt32(); + setvector_param = reader.ReadInt32(); + m92_sprite_buffer_busy = reader.ReadByte(); + for (i = 0; i < 4; i++) + { + pf_master_control[i] = reader.ReadUInt16(); + } + m92_sprite_list = reader.ReadInt32(); + for (i = 0; i < 0x8000; i++) + { + m92_vram_data[i] = reader.ReadUInt16(); + } + for (i = 0; i < 8; i++) + { + m92_spritecontrol[i] = reader.ReadUInt16(); + } + m92_game_kludge = reader.ReadInt32(); + m92_palette_bank = reader.ReadInt32(); + for (i = 0; i < 3; i++) + { + pf_layer[i].vram_base = reader.ReadUInt16(); + } + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + pf_layer[i].control[j] = reader.ReadUInt16(); + } + } + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x400; i++) + { + Generic.spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x400; i++) + { + Generic.buffered_spriteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x801; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x10000)); + Nec.nn1[0].LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x4000)); + Nec.nn1[1].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + Cpuint.LoadStateBinary_v(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + Iremga20.LoadStateBinary(reader); + Sound.latched_value[0] = reader.ReadUInt16(); + Sound.utempdata[0] = reader.ReadUInt16(); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.iremga20stream.output_sampindex = reader.ReadInt32(); + Sound.iremga20stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/State.cs.meta new file mode 100644 index 00000000..c5e5bbb7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e008cb2e11a05c04596d21a4ce10796d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Tilemap.cs new file mode 100644 index 00000000..c092a85b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Tilemap.cs @@ -0,0 +1,284 @@ +using System; + +namespace MAME.Core +{ + public partial class M92 + { + public static void tilemap_init() + { + int i, j, k; + for (i = 0; i < 3; i++) + { + M92.pf_layer[i].tmap = new Tmap(); + M92.pf_layer[i].tmap.laynum = i; + M92.pf_layer[i].tmap.rows = 64; + M92.pf_layer[i].tmap.cols = 64; + M92.pf_layer[i].tmap.tilewidth = 8; + M92.pf_layer[i].tmap.tileheight = 8; + M92.pf_layer[i].tmap.width = 0x200; + M92.pf_layer[i].tmap.height = 0x200; + M92.pf_layer[i].tmap.enable = true; + M92.pf_layer[i].tmap.all_tiles_dirty = true; + M92.pf_layer[i].tmap.pixmap = new ushort[0x200 * 0x200]; + M92.pf_layer[i].tmap.flagsmap = new byte[0x200, 0x200]; + M92.pf_layer[i].tmap.tileflags = new byte[0x40, 0x40]; + M92.pf_layer[i].tmap.total_elements = M92.gfx11romLength / 0x40; + M92.pf_layer[i].tmap.pen_data_set = new byte[0x40]; + M92.pf_layer[i].tmap.pen_to_flags = new byte[3, 0x10]; + M92.pf_layer[i].tmap.scrollrows = 512; + M92.pf_layer[i].tmap.scrollcols = 1; + M92.pf_layer[i].tmap.rowscroll = new int[M92.pf_layer[i].tmap.scrollrows]; + M92.pf_layer[i].tmap.colscroll = new int[M92.pf_layer[i].tmap.scrollcols]; + M92.pf_layer[i].tmap.tilemap_draw_instance3 = M92.pf_layer[i].tmap.tilemap_draw_instanceM92; + M92.pf_layer[i].tmap.tile_update3 = M92.pf_layer[i].tmap.tile_updateM92; + + M92.pf_layer[i].wide_tmap = new Tmap(); + M92.pf_layer[i].wide_tmap.laynum = i; + M92.pf_layer[i].wide_tmap.rows = 64; + M92.pf_layer[i].wide_tmap.cols = 128; + M92.pf_layer[i].wide_tmap.tilewidth = 8; + M92.pf_layer[i].wide_tmap.tileheight = 8; + M92.pf_layer[i].wide_tmap.width = 0x400; + M92.pf_layer[i].wide_tmap.height = 0x200; + M92.pf_layer[i].wide_tmap.enable = true; + M92.pf_layer[i].wide_tmap.all_tiles_dirty = true; + M92.pf_layer[i].wide_tmap.pixmap = new ushort[0x200 * 0x400]; + M92.pf_layer[i].wide_tmap.flagsmap = new byte[0x200, 0x400]; + M92.pf_layer[i].wide_tmap.tileflags = new byte[0x40, 0x80]; + M92.pf_layer[i].wide_tmap.total_elements = M92.gfx11romLength / 0x40; + M92.pf_layer[i].wide_tmap.pen_data_set = new byte[0x40]; + M92.pf_layer[i].wide_tmap.pen_to_flags = new byte[3, 0x10]; + M92.pf_layer[i].wide_tmap.scrollrows = 512; + M92.pf_layer[i].wide_tmap.scrollcols = 1; + M92.pf_layer[i].wide_tmap.rowscroll = new int[M92.pf_layer[i].tmap.scrollrows]; + M92.pf_layer[i].wide_tmap.colscroll = new int[M92.pf_layer[i].tmap.scrollcols]; + M92.pf_layer[i].wide_tmap.tilemap_draw_instance3 = M92.pf_layer[i].wide_tmap.tilemap_draw_instanceM92; + M92.pf_layer[i].wide_tmap.tile_update3 = M92.pf_layer[i].wide_tmap.tile_updateM92; + } + for (i = 0; i < 2; i++) + { + for (j = 0; j < 3; j++) + { + pf_layer[i].tmap.pen_to_flags[j, 0] = 0; + pf_layer[i].wide_tmap.pen_to_flags[j, 0] = 0; + } + for (k = 1; k < 0x10; k++) + { + pf_layer[i].tmap.pen_to_flags[0, k] = 0x20; + pf_layer[i].wide_tmap.pen_to_flags[0, k] = 0x20; + } + for (k = 1; k < 8; k++) + { + pf_layer[i].tmap.pen_to_flags[1, k] = 0x20; + pf_layer[i].wide_tmap.pen_to_flags[1, k] = 0x20; + } + for (k = 8; k < 0x10; k++) + { + pf_layer[i].tmap.pen_to_flags[1, k] = 0x10; + pf_layer[i].wide_tmap.pen_to_flags[1, k] = 0x10; + } + for (k = 1; k < 0x10; k++) + { + pf_layer[i].tmap.pen_to_flags[2, k] = 0x10; + pf_layer[i].wide_tmap.pen_to_flags[2, k] = 0x10; + } + } + for (k = 0; k < 0x10; k++) + { + pf_layer[2].tmap.pen_to_flags[0, k] = 0x20; + pf_layer[2].wide_tmap.pen_to_flags[0, k] = 0x20; + } + for (k = 0; k < 8; k++) + { + pf_layer[2].tmap.pen_to_flags[1, k] = 0x20; + pf_layer[2].wide_tmap.pen_to_flags[1, k] = 0x20; + } + for (k = 8; k < 0x10; k++) + { + pf_layer[2].tmap.pen_to_flags[1, k] = 0x10; + pf_layer[2].wide_tmap.pen_to_flags[1, k] = 0x10; + } + pf_layer[2].tmap.pen_to_flags[2, 0] = 0x20; + pf_layer[2].wide_tmap.pen_to_flags[2, 0] = 0x20; + for (k = 1; k < 0x10; k++) + { + pf_layer[2].tmap.pen_to_flags[2, k] = 0x10; + pf_layer[2].wide_tmap.pen_to_flags[2, k] = 0x10; + } + } + } + public unsafe partial class Tmap + { + public void tilemap_draw_instanceM92(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + continue; + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x200 + xpos + x_start, x_end - x_start); + if (priority != 0) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = pixmap[offsety2 * width + i - xpos]; + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tile_updateM92(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int tile, attrib, code; + int pen_data_offset, palette_base, group; + tile_index = 2 * (row * cols + col) + M92.pf_layer[laynum].vram_base; + attrib = M92.m92_vram_data[tile_index + 1]; + tile = M92.m92_vram_data[tile_index] + ((attrib & 0x8000) << 1); + code = tile % total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x10 * (attrib & 0x7f); + if ((attrib & 0x100) != 0) + { + group = 2; + } + else if ((attrib & 0x80) != 0) + { + group = 1; + } + else + { + group = 0; + } + flags = ((attrib >> 9) & 3) ^ (attributes & 0x03); + tileflags[row, col] = tile_drawM92(M92.gfx11rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public byte tile_drawM92(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % 0x200) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % 0x200, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Tilemap.cs.meta new file mode 100644 index 00000000..3c80a873 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3bd391135d06b24cb86185f71752148 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Video.cs new file mode 100644 index 00000000..71543a2c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Video.cs @@ -0,0 +1,450 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class M92 + { + public static ushort[] pf_master_control; + public static int m92_sprite_list; + public static ushort[] m92_vram_data; + public static ushort[] m92_spritecontrol; + public static int m92_game_kludge; + private static ushort[] uuB800; + public static int m92_palette_bank; + public struct pf_layer_info + { + public Tmap tmap; + public Tmap wide_tmap; + public ushort vram_base; + public ushort[] control; + }; + public static pf_layer_info[] pf_layer; + public static void spritebuffer_callback() + { + m92_sprite_buffer_busy = 1; + if (m92_game_kludge != 2) + { + m92_sprite_interrupt(); + } + } + public static void m92_spritecontrol_w1(int offset, byte data) + { + m92_spritecontrol[offset] = (ushort)((data << 8) | (m92_spritecontrol[offset] & 0xff)); + /*if (offset == 2) + { + if ((data & 0xff) == 8) + { + m92_sprite_list = (((0x100 - m92_spritecontrol[0]) & 0xff) * 4); + } + else + { + m92_sprite_list = 0x400; + } + }*/ + if (offset == 4) + { + Generic.buffer_spriteram16_w(); + m92_sprite_buffer_busy = 0; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_spritebuffer_callback, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); + } + } + public static void m92_spritecontrol_w2(int offset, byte data) + { + m92_spritecontrol[offset] = (ushort)((m92_spritecontrol[offset] & 0xff00) | data); + if (offset == 2) + { + if ((data & 0xff) == 8) + { + m92_sprite_list = (((0x100 - m92_spritecontrol[0]) & 0xff) * 4); + } + else + { + m92_sprite_list = 0x400; + } + } + if (offset == 4) + { + Generic.buffer_spriteram16_w(); + m92_sprite_buffer_busy = 0; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_spritebuffer_callback, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); + } + } + public static void m92_spritecontrol_w(int offset, ushort data) + { + m92_spritecontrol[offset] = data; + if (offset == 2) + { + if ((data & 0xff) == 8) + { + m92_sprite_list = (((0x100 - m92_spritecontrol[0]) & 0xff) * 4); + } + else + { + m92_sprite_list = 0x400; + } + } + if (offset == 4) + { + Generic.buffer_spriteram16_w(); + m92_sprite_buffer_busy = 0; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_spritebuffer_callback, true); + EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); + } + } + public static void m92_videocontrol_w(byte data) + { + //if (ACCESSING_BITS_0_7) + { + m92_palette_bank = (data >> 1) & 1; + } + } + public static ushort m92_paletteram_r(int offset) + { + return Generic.paletteram16[offset + 0x400 * m92_palette_bank]; + } + public static void m92_paletteram_w(int offset, ushort data) + { + Generic.paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 0x400 * m92_palette_bank, data); + } + public static void m92_vram_w(int offset) + { + int laynum; + //COMBINE_DATA(&m92_vram_data[offset]); + for (laynum = 0; laynum < 3; laynum++) + { + if ((offset & 0x6000) == pf_layer[laynum].vram_base) + { + pf_layer[laynum].tmap.tilemap_mark_tile_dirty(((offset & 0x1fff) / 2) / 0x40, ((offset & 0x1fff) / 2) % 0x40);//tilemap_mark_tile_dirty((offset & 0x1fff) / 2); + pf_layer[laynum].wide_tmap.tilemap_mark_tile_dirty(((offset & 0x3fff) / 2) / 0x80, ((offset & 0x3fff) / 2) % 0x80); + } + if ((offset & 0x6000) == pf_layer[laynum].vram_base + 0x2000) + { + pf_layer[laynum].wide_tmap.tilemap_mark_tile_dirty(((offset & 0x3fff) / 2) / 0x80, ((offset & 0x3fff) / 2) % 0x80); + } + } + } + public static void m92_pf1_control_w1(int offset, byte data) + { + pf_layer[0].control[offset] = (ushort)((data << 8) | (pf_layer[0].control[offset] & 0xff)); + } + public static void m92_pf1_control_w2(int offset, byte data) + { + pf_layer[0].control[offset] = (ushort)((pf_layer[0].control[offset] & 0xff00) | data); + } + public static void m92_pf1_control_w(int offset, ushort data) + { + pf_layer[0].control[offset] = data; + } + public static void m92_pf2_control_w1(int offset, byte data) + { + pf_layer[1].control[offset] = (ushort)((data << 8) | (pf_layer[1].control[offset] & 0xff)); + } + public static void m92_pf2_control_w2(int offset, byte data) + { + pf_layer[1].control[offset] = (ushort)((pf_layer[1].control[offset] & 0xff00) | data); + } + public static void m92_pf2_control_w(int offset, ushort data) + { + pf_layer[1].control[offset] = data; + } + public static void m92_pf3_control_w1(int offset, byte data) + { + pf_layer[2].control[offset] = (ushort)((data << 8) | (pf_layer[2].control[offset] & 0xff)); + } + public static void m92_pf3_control_w2(int offset, byte data) + { + pf_layer[2].control[offset] = (ushort)((pf_layer[2].control[offset] & 0xff00) | data); + } + public static void m92_pf3_control_w(int offset, ushort data) + { + pf_layer[2].control[offset] = data; + } + public static void m92_master_control_w1(int offset, byte data) + { + ushort old = pf_master_control[offset]; + pf_master_control[offset] = (ushort)((data << 8) | (pf_master_control[offset] & 0xff)); + switch (offset) + { + case 0: + case 1: + case 2: + pf_layer[offset].vram_base = (ushort)((pf_master_control[offset] & 3) * 0x2000); + if ((pf_master_control[offset] & 0x04) != 0) + { + pf_layer[offset].tmap.enable = false; + pf_layer[offset].wide_tmap.enable = ((~pf_master_control[offset] >> 4) & 1) != 0 ? true : false; + } + else + { + pf_layer[offset].tmap.enable = ((~pf_master_control[offset] >> 4) & 1) != 0 ? true : false; + pf_layer[offset].wide_tmap.enable = false; + } + if (((old ^ pf_master_control[offset]) & 0x07) != 0) + { + pf_layer[offset].tmap.all_tiles_dirty = true; + pf_layer[offset].wide_tmap.all_tiles_dirty = true; + } + break; + case 3: + m92_raster_irq_position = pf_master_control[3] - 128; + break; + } + } + public static void m92_master_control_w2(int offset, byte data) + { + ushort old = pf_master_control[offset]; + pf_master_control[offset] = (ushort)((pf_master_control[offset] & 0xff00) | data); + switch (offset) + { + case 0: + case 1: + case 2: + pf_layer[offset].vram_base = (ushort)((pf_master_control[offset] & 3) * 0x2000); + if ((pf_master_control[offset] & 0x04) != 0) + { + pf_layer[offset].tmap.enable = false; + pf_layer[offset].wide_tmap.enable = ((~pf_master_control[offset] >> 4) & 1) != 0 ? true : false; + } + else + { + pf_layer[offset].tmap.enable = ((~pf_master_control[offset] >> 4) & 1) != 0 ? true : false; + pf_layer[offset].wide_tmap.enable = false; + } + if (((old ^ pf_master_control[offset]) & 0x07) != 0) + { + pf_layer[offset].tmap.all_tiles_dirty = true; + pf_layer[offset].wide_tmap.all_tiles_dirty = true; + } + break; + case 3: + m92_raster_irq_position = pf_master_control[3] - 128; + break; + } + } + public static void m92_master_control_w(int offset, ushort data) + { + ushort old = pf_master_control[offset]; + //COMBINE_DATA(&pf_master_control[offset]); + pf_master_control[offset] = data; + switch (offset) + { + case 0: + case 1: + case 2: + pf_layer[offset].vram_base = (ushort)((pf_master_control[offset] & 3) * 0x2000); + if ((pf_master_control[offset] & 0x04) != 0) + { + pf_layer[offset].tmap.enable = false; + pf_layer[offset].wide_tmap.enable = ((~pf_master_control[offset] >> 4) & 1) != 0 ? true : false; + } + else + { + pf_layer[offset].tmap.enable = ((~pf_master_control[offset] >> 4) & 1) != 0 ? true : false; + pf_layer[offset].wide_tmap.enable = false; + } + if (((old ^ pf_master_control[offset]) & 0x07) != 0) + { + pf_layer[offset].tmap.all_tiles_dirty = true; + pf_layer[offset].wide_tmap.all_tiles_dirty = true; + } + break; + case 3: + m92_raster_irq_position = pf_master_control[3] - 128; + break; + } + } + public static void video_start_m92() + { + int i; + int laynum; + uuB800 = new ushort[0x200 * 0x200]; + for (i = 0; i < 0x40000; i++) + { + uuB800[i] = 0x800; + } + for (laynum = 0; laynum < 3; laynum++) + { + pf_layer[laynum].tmap.tilemap_set_scrolldx(2 * laynum, -2 * laynum + 8); + pf_layer[laynum].tmap.tilemap_set_scrolldy(-128, -128); + pf_layer[laynum].wide_tmap.tilemap_set_scrolldx(2 * laynum - 256, -2 * laynum + 8 - 256); + pf_layer[laynum].wide_tmap.tilemap_set_scrolldy(-128, -128); + } + } + public static void draw_sprites(RECT cliprect) + { + int offs, k; + for (k = 0; k < 8; k++) + { + for (offs = 0; offs < m92_sprite_list;) + { + int x, y, sprite, colour, fx, fy, x_multi, y_multi, i, j, s_ptr, pri_back, pri_sprite; + y = Generic.buffered_spriteram16[offs + 0] & 0x1ff; + x = Generic.buffered_spriteram16[offs + 3] & 0x1ff; + if ((Generic.buffered_spriteram16[offs + 2] & 0x0080) != 0) + { + pri_back = 0; + } + else + { + pri_back = 2; + } + sprite = Generic.buffered_spriteram16[offs + 1]; + colour = Generic.buffered_spriteram16[offs + 2] & 0x007f; + pri_sprite = (Generic.buffered_spriteram16[offs + 0] & 0xe000) >> 13; + fx = (Generic.buffered_spriteram16[offs + 2] >> 8) & 1; + fy = (Generic.buffered_spriteram16[offs + 2] >> 9) & 1; + y_multi = (Generic.buffered_spriteram16[offs + 0] >> 9) & 3; + x_multi = (Generic.buffered_spriteram16[offs + 0] >> 11) & 3; + y_multi = 1 << y_multi; + x_multi = 1 << x_multi; + offs += 4 * x_multi; + if (pri_sprite != k) + { + continue; + } + x = x - 16; + y = 384 - 16 - y; + if (fx != 0) + { + x += 16 * (x_multi - 1); + } + for (j = 0; j < x_multi; j++) + { + s_ptr = 8 * j; + if (fy == 0) + { + s_ptr += y_multi - 1; + } + x &= 0x1ff; + for (i = 0; i < y_multi; i++) + { + if (Generic.flip_screen_get() != 0) + { + int i1 = 1; + /*pdrawgfx(bitmap,machine->gfx[1], + sprite + s_ptr, + colour, + !fx,!fy, + 464-x,240-(y-i*16), + cliprect,TRANSPARENCY_PEN,0,pri_back); + + pdrawgfx(bitmap,machine->gfx[1], + sprite + s_ptr, + colour, + !fx,!fy, + 464-x+512,240-(y-i*16), + cliprect,TRANSPARENCY_PEN,0,pri_back);*/ + + } + else + { + /*pdrawgfx(bitmap,machine->gfx[1], + sprite + s_ptr, + colour, + fx,fy, + x,y-i*16, + cliprect,TRANSPARENCY_PEN,0,pri_back); + + pdrawgfx(bitmap,machine->gfx[1], + sprite + s_ptr, + colour, + fx,fy, + x-512,y-i*16, + cliprect,TRANSPARENCY_PEN,0,pri_back);*/ + Drawgfx.common_drawgfx_m92(gfx21rom, sprite + s_ptr, colour, fx, fy, x, y - i * 16, cliprect, (uint)(pri_back | (1 << 31))); + Drawgfx.common_drawgfx_m92(gfx21rom, sprite + s_ptr, colour, fx, fy, x - 512, y - i * 16, cliprect, (uint)(pri_back | (1 << 31))); + } + if (fy != 0) + { + s_ptr++; + } + else + { + s_ptr--; + } + } + if (fx != 0) + { + x -= 16; + } + else + { + x += 16; + } + } + } + } + } + public static void m92_update_scroll_positions() + { + int laynum; + int i; + for (laynum = 0; laynum < 3; laynum++) + { + if ((pf_master_control[laynum] & 0x40) != 0) + { + int scrolldata_offset = (0xf400 + 0x400 * laynum) / 2; + pf_layer[laynum].tmap.tilemap_set_scroll_rows(512); + pf_layer[laynum].wide_tmap.tilemap_set_scroll_rows(512); + for (i = 0; i < 512; i++) + { + pf_layer[laynum].tmap.tilemap_set_scrollx(i, m92_vram_data[scrolldata_offset + i]); + pf_layer[laynum].wide_tmap.tilemap_set_scrollx(i, m92_vram_data[scrolldata_offset + i]); + } + } + else + { + pf_layer[laynum].tmap.tilemap_set_scroll_rows(1); + pf_layer[laynum].wide_tmap.tilemap_set_scroll_rows(1); + pf_layer[laynum].tmap.tilemap_set_scrollx(0, pf_layer[laynum].control[2]); + pf_layer[laynum].wide_tmap.tilemap_set_scrollx(0, pf_layer[laynum].control[2]); + } + pf_layer[laynum].tmap.tilemap_set_scrolly(0, pf_layer[laynum].control[0]); + pf_layer[laynum].wide_tmap.tilemap_set_scrolly(0, pf_layer[laynum].control[0]); + } + } + public static void m92_screenrefresh(RECT cliprect) + { + Array.Copy(Tilemap.bb00, 0, Tilemap.priority_bitmap, 0x200 * cliprect.min_y, 0x200 * (cliprect.max_y - cliprect.min_y + 1)); + if (((~pf_master_control[2] >> 4) & 1) != 0) + { + pf_layer[2].wide_tmap.tilemap_draw_primask(cliprect, 0x20, 0); + pf_layer[2].tmap.tilemap_draw_primask(cliprect, 0x20, 0); + pf_layer[2].wide_tmap.tilemap_draw_primask(cliprect, 0x10, 1); + pf_layer[2].tmap.tilemap_draw_primask(cliprect, 0x10, 1); + } + else + { + Array.Copy(uuB800, 0, Video.bitmapbase[Video.curbitmap], 0x200 * cliprect.min_y, 0x200 * (cliprect.max_y - cliprect.min_y + 1)); + } + pf_layer[1].wide_tmap.tilemap_draw_primask(cliprect, 0x20, 0); + pf_layer[1].tmap.tilemap_draw_primask(cliprect, 0x20, 0); + pf_layer[1].wide_tmap.tilemap_draw_primask(cliprect, 0x10, 1); + pf_layer[1].tmap.tilemap_draw_primask(cliprect, 0x10, 1); + pf_layer[0].wide_tmap.tilemap_draw_primask(cliprect, 0x20, 0); + pf_layer[0].tmap.tilemap_draw_primask(cliprect, 0x20, 0); + pf_layer[0].wide_tmap.tilemap_draw_primask(cliprect, 0x10, 1); + pf_layer[0].tmap.tilemap_draw_primask(cliprect, 0x10, 1); + draw_sprites(cliprect); + } + public static void video_update_m92() + { + m92_update_scroll_positions(); + m92_screenrefresh(Video.new_clip); + if ((dsw & 0x100) != 0) + { + Generic.flip_screen_set(0); + } + else + { + Generic.flip_screen_set(1); + } + } + public static void video_eof_m92() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Video.cs.meta new file mode 100644 index 00000000..3a081d98 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/m92/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 585629a27df817744b72bc28aa9df911 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1.meta new file mode 100644 index 00000000..61694c8d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 361240c4e9569d9499a9c6fbf891cb2e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Drawgfx.cs new file mode 100644 index 00000000..7abed2f8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Drawgfx.cs @@ -0,0 +1,114 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_na(int sizex, int sizey, int tx, int ty, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + sizex - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x200) + { + ex = 0x200 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + sizey - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x200) + { + ey = 0x200 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = sizex; + int sh = sizey; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 0x10 * color; + blockmove_8toN_transpen_pri16(tx, ty, code, sw, sh, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx); + } + private unsafe static void setpixelcolorNa(int offsety, int offsetx, int n) + { + if (Tilemap.priority_bitmap[offsety, offsetx] != 0x1f && Tilemap.priority_bitmap[offsety, offsetx] <= Namcos1.namcos1_pri) + { + Video.bitmapbase_Ptrs[Video.curbitmap][offsety * 0x200 + offsetx] = (ushort)n; + } + Tilemap.priority_bitmap[offsety, offsetx] = 0x1f; + } + public static void blockmove_8toN_transpen_pri16(int tx, int ty, int code, int srcwidth, int srcheight, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsety, int offsetx) + { + int xdir, ydir; + int src_offset; + int iwidth, iheight; + int col; + src_offset = code * 0x400 + tx + ty * 0x20; + if (flipy != 0) + { + offsety += dstheight - 1; + src_offset += (srcheight - dstheight - topskip) * 0x20; + ydir = -1; + } + else + { + src_offset += topskip * 0x20; + ydir = 1; + } + if (flipx != 0) + { + offsetx += dstwidth - 1; + src_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + src_offset += leftskip; + xdir = 1; + } + for (iheight = 0; iheight < dstheight; iheight++) + { + for (iwidth = 0; iwidth < dstwidth; iwidth++) + { + col = Namcos1.gfx3rom[src_offset + iheight * 0x20 + iwidth]; + if (col != 0x0f) + { + setpixelcolorNa(offsety + iheight * ydir, offsetx + iwidth * xdir, colorbase + col); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Drawgfx.cs.meta new file mode 100644 index 00000000..ea93b5b0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f2acdfcad96440843bb1f57c280fcb73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Input.cs new file mode 100644 index 00000000..56a2d1bb --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Input.cs @@ -0,0 +1,771 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class Namcos1 + { + public static void loop_inputports_ns1_3b() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + byte0 &= unchecked((byte)~0x80); + } + else + { + byte0 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + byte1 &= unchecked((byte)~0x80); + } + else + { + byte1 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte0 &= unchecked((byte)~0x01); + } + else + { + byte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte0 &= unchecked((byte)~0x02); + } + else + { + byte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte0 &= unchecked((byte)~0x04); + } + else + { + byte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte0 &= unchecked((byte)~0x08); + } + else + { + byte0 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte0 &= unchecked((byte)~0x10); + } + else + { + byte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte0 &= unchecked((byte)~0x20); + } + else + { + byte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + byte0 &= unchecked((byte)~0x40); + } + else + { + byte0 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + byte1 &= unchecked((byte)~0x01); + } + else + { + byte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + byte1 &= unchecked((byte)~0x02); + } + else + { + byte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + byte1 &= unchecked((byte)~0x04); + } + else + { + byte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + byte1 &= unchecked((byte)~0x08); + } + else + { + byte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte1 &= unchecked((byte)~0x10); + } + else + { + byte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + byte1 &= unchecked((byte)~0x20); + } + else + { + byte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + byte1 &= unchecked((byte)~0x40); + } + else + { + byte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + byte2 &= unchecked((byte)~0x40); + } + else + { + byte2 |= 0x40; + } + } + public static void loop_inputports_ns1_quester() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + byte0 &= unchecked((byte)~0x80); + } + else + { + byte0 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + byte1 &= unchecked((byte)~0x80); + } + else + { + byte1 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte0 &= unchecked((byte)~0x10); + } + else + { + byte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte0 &= unchecked((byte)~0x20); + } + else + { + byte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + byte0 &= unchecked((byte)~0x40); + } + else + { + byte0 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte1 &= unchecked((byte)~0x10); + } + else + { + byte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + byte1 &= unchecked((byte)~0x20); + } + else + { + byte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + byte1 &= unchecked((byte)~0x40); + } + else + { + byte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + byte2 &= unchecked((byte)~0x40); + } + else + { + byte2 |= 0x40; + } + Inptport.frame_update_analog_field_quester_p0(Inptport.analog_p0); + Inptport.frame_update_analog_field_quester_p1(Inptport.analog_p1); + } + public static void loop_inputports_ns1_berabohm() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + byte0 &= unchecked((byte)~0x80); + } + else + { + byte0 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + byte1 &= unchecked((byte)~0x80); + } + else + { + byte1 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte0 &= unchecked((byte)~0x01); + } + else + { + byte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte0 &= unchecked((byte)~0x02); + } + else + { + byte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte0 &= unchecked((byte)~0x04); + } + else + { + byte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte0 &= unchecked((byte)~0x08); + } + else + { + byte0 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte01 |= 0x01; + } + else + { + byte01 &= unchecked((byte)~0x01); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte01 |= 0x02; + } + else + { + byte01 &= unchecked((byte)~0x02); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + byte01 |= 0x04; + } + else + { + byte01 &= unchecked((byte)~0x04); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + byte00 |= 0x01; + } + else + { + byte00 &= unchecked((byte)~0x01); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + byte00 |= 0x02; + } + else + { + byte00 &= unchecked((byte)~0x02); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + byte00 |= 0x04; + } + else + { + byte00 &= unchecked((byte)~0x04); + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + byte1 &= unchecked((byte)~0x01); + } + else + { + byte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + byte1 &= unchecked((byte)~0x02); + } + else + { + byte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + byte1 &= unchecked((byte)~0x04); + } + else + { + byte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + byte1 &= unchecked((byte)~0x08); + } + else + { + byte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte03 |= 0x01; + } + else + { + byte03 &= unchecked((byte)~0x01); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + byte03 |= 0x02; + } + else + { + byte03 &= unchecked((byte)~0x02); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + byte03 |= 0x04; + } + else + { + byte03 &= unchecked((byte)~0x04); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + byte02 |= 0x01; + } + else + { + byte02 &= unchecked((byte)~0x01); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + byte02 |= 0x02; + } + else + { + byte02 &= unchecked((byte)~0x02); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + byte02 |= 0x04; + } + else + { + byte02 &= unchecked((byte)~0x04); + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + byte2 &= unchecked((byte)~0x40); + } + else + { + byte2 |= 0x40; + } + } + public static void loop_inputports_ns1_faceoff() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + byte0 &= unchecked((byte)~0x80); + } + else + { + byte0 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + byte1 &= unchecked((byte)~0x80); + } + else + { + byte1 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte00 &= unchecked((byte)~0x01); + } + else + { + byte00 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte00 &= unchecked((byte)~0x02); + } + else + { + byte00 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte00 &= unchecked((byte)~0x04); + } + else + { + byte00 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte00 &= unchecked((byte)~0x08); + } + else + { + byte00 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte00 &= unchecked((byte)~0x10); + } + else + { + byte00 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte01 &= unchecked((byte)~0x10); + } + else + { + byte01 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + byte01 &= unchecked((byte)~0x01); + } + else + { + byte01 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + byte01 &= unchecked((byte)~0x02); + } + else + { + byte01 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + byte01 &= unchecked((byte)~0x04); + } + else + { + byte01 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + byte01 &= unchecked((byte)~0x08); + } + else + { + byte01 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + byte2 &= unchecked((byte)~0x40); + } + else + { + byte2 |= 0x40; + } + } + public static void loop_inputports_ns1_tankfrce4() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte00 &= unchecked((byte)~0x01); + } + else + { + byte00 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte00 &= unchecked((byte)~0x02); + } + else + { + byte00 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte00 &= unchecked((byte)~0x04); + } + else + { + byte00 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte00 &= unchecked((byte)~0x08); + } + else + { + byte00 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte00 &= unchecked((byte)~0x10); + } + else + { + byte00 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + byte02 &= unchecked((byte)~0x01); + } + else + { + byte02 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + byte02 &= unchecked((byte)~0x02); + } + else + { + byte02 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + byte02 &= unchecked((byte)~0x04); + } + else + { + byte02 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + byte02 &= unchecked((byte)~0x08); + } + else + { + byte02 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte02 &= unchecked((byte)~0x10); + } + else + { + byte02 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.R)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + if (Keyboard.IsPressed(Key.T)) + { + byte2 &= unchecked((byte)~0x40); + } + else + { + byte2 |= 0x40; + }*/ + } + public static void record_port() + { + if (byte0 != byte0_old || byte1 != byte1_old || byte2 != byte2_old) + { + byte0_old = byte0; + byte1_old = byte1; + byte2_old = byte2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(byte0); + Mame.bwRecord.Write(byte1); + Mame.bwRecord.Write(byte2); + } + } + public static void replay_port() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + byte0_old = Mame.brRecord.ReadByte(); + byte1_old = Mame.brRecord.ReadByte(); + byte2_old = Mame.brRecord.ReadByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + byte0 = byte0_old; + byte1 = byte1_old; + byte2 = byte2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Input.cs.meta new file mode 100644 index 00000000..18564da2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c37c712dafd91554ea91bfdf52ffe482 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Machine.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Machine.cs new file mode 100644 index 00000000..cbdaf4cb --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Machine.cs @@ -0,0 +1,450 @@ +using System; + +namespace MAME.Core +{ + public partial class Namcos1 + { + public static byte[] namcos1_paletteram; + public static byte[] s1ram, namcos1_triram; + public static int audiocpurom_offset, mcurom_offset; + public static int key_id, key_reg, key_rng, key_swap4_arg, key_swap4, key_bottom4, key_top4; + public static uint key_quotient, key_reminder, key_numerator_high_word; + public static byte[] key; + public static int mcu_patch_data; + public static int namcos1_reset = 0; + public static int wdog; + public static int[,] cus117_offset; + public static int[,] user1rom_offset; + public static Func key_r; + public static Action key_w; + public class namcos1_specific + { + public int key_id; + public int key_reg1; + public int key_reg2; + public int key_reg3; + public int key_reg4; + public int key_reg5; + public int key_reg6; + public namcos1_specific(int i1, int i2, int i3, int i4, int i5, int i6, int i7) + { + key_id = i1; + key_reg1 = i2; + key_reg2 = i3; + key_reg3 = i4; + key_reg4 = i5; + key_reg5 = i6; + key_reg6 = i7; + } + }; + public static void namcos1_3dcs_w(int offset) + { + if ((offset & 1) != 0) + { + //popmessage("LEFT"); + } + else + { + //popmessage("RIGHT"); + } + } + public static byte no_key_r(int offset) + { + return 0; + } + public static void no_key_w(int offset, byte data) + { + + } + public static byte key_type1_r(int offset) + { + if (offset < 3) + { + int d = key[0]; + int n = (key[1] << 8) | key[2]; + int q, r; + if (d != 0) + { + q = n / d; + r = n % d; + } + else + { + q = 0xffff; + r = 0x00; + } + if (offset == 0) + return (byte)r; + if (offset == 1) + return (byte)(q >> 8); + if (offset == 2) + return (byte)(q & 0xff); + } + else if (offset == 3) + return (byte)key_id; + return 0; + } + public static void key_type1_w(int offset, byte data) + { + if (offset < 4) + key[offset] = data; + } + public static byte key_type2_r(int offset) + { + key_numerator_high_word = 0; + if (offset < 4) + { + if (offset == 0) + return (byte)(key_reminder >> 8); + if (offset == 1) + return (byte)(key_reminder & 0xff); + if (offset == 2) + return (byte)(key_quotient >> 8); + if (offset == 3) + return (byte)(key_quotient & 0xff); + } + else if (offset == 4) + return (byte)key_id; + return 0; + } + public static void key_type2_w(int offset, byte data) + { + if (offset < 5) + { + key[offset] = data; + if (offset == 3) + { + uint d = (uint)((key[0] << 8) | key[1]); + uint n = (uint)((key_numerator_high_word << 16) | (uint)(key[2] << 8) | key[3]); + if (d != 0) + { + key_quotient = n / d; + key_reminder = n % d; + } + else + { + key_quotient = 0xffff; + key_reminder = 0x0000; + } + key_numerator_high_word = (uint)((key[2] << 8) | key[3]); + } + } + } + public static byte key_type3_r(int offset) + { + int op; + op = (offset & 0x70) >> 4; + if (op == key_reg) + return (byte)key_id; + if (op == key_rng) + return 0;// (byte)mame_rand(machine); + if (op == key_swap4) + return (byte)((key[key_swap4_arg] << 4) | (key[key_swap4_arg] >> 4)); + if (op == key_bottom4) + return (byte)((offset << 4) | (key[key_swap4_arg] & 0x0f)); + if (op == key_top4) + return (byte)((offset << 4) | (key[key_swap4_arg] >> 4)); + return 0; + } + public static void key_type3_w(int offset, byte data) + { + key[(offset & 0x70) >> 4] = data; + } + public static void namcos1_sound_bankswitch_w(byte data) + { + int bank = (data & 0x70) >> 4; + audiocpurom_offset = 0x4000 * bank; + } + public static void namcos1_cpu_control_w(byte data) + { + if (((data & 1) ^ namcos1_reset) != 0) + { + mcu_patch_data = 0; + namcos1_reset = data & 1; + } + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, ((data & 1) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Cpuint.cpunum_set_input_line(2, (int)LineState.INPUT_LINE_RESET, ((data & 1) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + Cpuint.cpunum_set_input_line(3, (int)LineState.INPUT_LINE_RESET, ((data & 1) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + } + public static void namcos1_watchdog_w() + { + wdog |= 1 << Cpuexec.activecpu; + if (wdog == 7 || (namcos1_reset == 0)) + { + wdog = 0; + Generic.watchdog_reset_w(); + } + } + public static byte soundram_r(int offset) + { + if (offset < 0x1000) + { + offset &= 0x3ff; + return Namco.namcos1_cus30_r(offset); + } + else + { + offset &= 0x7ff; + return namcos1_triram[offset]; + } + } + public static void soundram_w(int offset, byte data) + { + if (offset < 0x1000) + { + offset &= 0x3ff; + Namco.namcos1_cus30_w(offset, data); + } + else + { + offset &= 0x7ff; + namcos1_triram[offset] = data; + } + } + public static void namcos1_bankswitch(int cpu, int offset, byte data) + { + int reg = (offset >> 9) & 0x7; + if ((offset & 1) != 0) + { + cus117_offset[cpu, reg] = (cus117_offset[cpu, reg] & 0x600000) | (data * 0x2000); + } + else + { + cus117_offset[cpu, reg] = (cus117_offset[cpu, reg] & 0x1fe000) | ((data & 0x03) * 0x200000); + } + if (cus117_offset[cpu, reg] >= 0x400000 && cus117_offset[cpu, reg] <= 0x7fffff) + { + user1rom_offset[cpu, reg] = cus117_offset[cpu, reg] - 0x400000; + } + } + public static void namcos1_bankswitch_w(int offset, byte data) + { + namcos1_bankswitch(Cpuexec.activecpu, offset, data); + } + public static void namcos1_subcpu_bank_w(byte data) + { + cus117_offset[1, 7] = 0x600000 | (data * 0x2000); + user1rom_offset[1, 7] = cus117_offset[1, 7] - 0x400000; + } + public static void machine_reset_namcos1() + { + cus117_offset[0, 0] = 0x0180 * 0x2000; + cus117_offset[0, 1] = 0x0180 * 0x2000; + cus117_offset[0, 7] = 0x03ff * 0x2000; + cus117_offset[1, 0] = 0x0180 * 0x2000; + cus117_offset[1, 7] = 0x03ff * 0x2000; + user1rom_offset[0, 7] = cus117_offset[0, 7] - 0x400000; + user1rom_offset[1, 7] = cus117_offset[1, 7] - 0x400000; + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, LineState.ASSERT_LINE); + Cpuint.cpunum_set_input_line(2, (int)LineState.INPUT_LINE_RESET, LineState.ASSERT_LINE); + Cpuint.cpunum_set_input_line(3, (int)LineState.INPUT_LINE_RESET, LineState.ASSERT_LINE); + mcu_patch_data = 0; + namcos1_reset = 0; + namcos1_init_DACs(); + int i, j; + for (i = 0; i < 8; i++) + { + key[i] = 0; + } + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + { + cus117_offset[i, j] = 0; + } + } + wdog = 0; + } + public static void namcos1_mcu_bankswitch_w(byte data) + { + int addr; + switch (data & 0xfc) + { + case 0xf8: + addr = 0x00000; + data ^= 2; + break; + case 0xf4: + addr = 0x20000; + break; + case 0xec: + addr = 0x40000; + break; + case 0xdc: + addr = 0x60000; + break; + case 0xbc: + addr = 0x80000; + break; + case 0x7c: + addr = 0xa0000; + break; + default: + addr = 0x00000; + break; + } + addr += (data & 3) * 0x8000; + mcurom_offset = addr; + } + public static void namcos1_mcu_patch_w(byte data) + { + if (mcu_patch_data == 0xa6) + return; + mcu_patch_data = data; + namcos1_triram[0] = data; + } + public static void namcos1_driver_init(namcos1_specific specific) + { + key_id = specific.key_id; + key_reg = specific.key_reg1; + key_rng = specific.key_reg2; + key_swap4_arg = specific.key_reg3; + key_swap4 = specific.key_reg4; + key_bottom4 = specific.key_reg5; + key_top4 = specific.key_reg6; + s1ram = new byte[0x8000]; + namcos1_triram = new byte[0x800]; + namcos1_paletteram = new byte[0x8000]; + } + public static void driver_init() + { + switch (Machine.sName) + { + case "shadowld": + case "youkaidk2": + case "youkaidk1": + key_r = no_key_r; + key_w = no_key_w; + namcos1_driver_init(new namcos1_specific(0, 0, 0, 0, 0, 0, 0)); + break; + case "dspirit": + case "dspirit2": + case "dspirit1": + key_r = key_type1_r; + key_w = key_type1_w; + namcos1_driver_init(new namcos1_specific(0x36, 0, 0, 0, 0, 0, 0)); + break; + case "blazer": + key_r = key_type1_r; + key_w = key_type1_w; + namcos1_driver_init(new namcos1_specific(0x13, 0, 0, 0, 0, 0, 0)); + break; + case "quester": + case "questers": + key_r = no_key_r; + key_w = no_key_w; + namcos1_driver_init(new namcos1_specific(0, 0, 0, 0, 0, 0, 0)); + //quester_paddle_r + break; + case "pacmania": + case "pacmaniao": + case "pacmaniaj": + key_r = key_type2_r; + key_w = key_type2_w; + namcos1_driver_init(new namcos1_specific(0x12, 0, 0, 0, 0, 0, 0)); + break; + case "galaga88": + case "galaga88a": + case "galaga88j": + key_r = key_type2_r; + key_w = key_type2_w; + namcos1_driver_init(new namcos1_specific(0x31, 0, 0, 0, 0, 0, 0)); + break; + case "ws": + key_r = key_type2_r; + key_w = key_type2_w; + namcos1_driver_init(new namcos1_specific(0x07, 0, 0, 0, 0, 0, 0)); + break; + case "berabohm": + case "berabohmb": + key_r = no_key_r; + key_w = no_key_w; + namcos1_driver_init(new namcos1_specific(0, 0, 0, 0, 0, 0, 0)); + //berabohm_buttons_r + break; + case "mmaze": + key_r = key_type2_r; + key_w = key_type2_w; + namcos1_driver_init(new namcos1_specific(0x25, 0, 0, 0, 0, 0, 0)); + break; + case "bakutotu": + key_r = key_type2_r; + key_w = key_type2_w; + namcos1_driver_init(new namcos1_specific(0x22, 0, 0, 0, 0, 0, 0)); + break; + case "wldcourt": + key_r = key_type1_r; + key_w = key_type1_w; + namcos1_driver_init(new namcos1_specific(0x35, 0, 0, 0, 0, 0, 0)); + break; + case "splatter": + case "splatter2": + case "splatterj": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(181, 3, 4, -1, -1, -1, -1)); + break; + case "faceoff": + key_r = no_key_r; + key_w = no_key_w; + namcos1_driver_init(new namcos1_specific(0, 0, 0, 0, 0, 0, 0)); + //faceoff_inputs_r + break; + case "rompers": + case "romperso": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(182, 7, -1, -1, -1, -1, -1)); + break; + case "blastoff": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(183, 0, 7, 3, 5, -1, -1)); + break; + case "ws89": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(184, 2, -1, -1, -1, -1, -1)); + break; + case "dangseed": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(308, 6, -1, 5, -1, 0, 4)); + break; + case "ws90": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(310, 4, -1, 7, -1, 3, -1)); + break; + case "pistoldm": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(309, 1, 2, 0, -1, 4, -1)); + break; + case "boxyboy": + case "soukobdx": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(311, 2, 3, 0, -1, 4, -1)); + break; + case "puzlclub": + key_r = key_type1_r; + key_w = key_type1_w; + namcos1_driver_init(new namcos1_specific(0x35, 0, 0, 0, 0, 0, 0)); + break; + case "tankfrce": + case "tankfrcej": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(185, 5, -1, 1, -1, 2, -1)); + break; + case "tankfrce4": + key_r = key_type3_r; + key_w = key_type3_w; + namcos1_driver_init(new namcos1_specific(185, 5, -1, 1, -1, 2, -1)); + //tankfrc4_input_r + break; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Machine.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Machine.cs.meta new file mode 100644 index 00000000..4b33871c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Machine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb332df6f2e352e4cad34a5a96ac5544 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory.cs new file mode 100644 index 00000000..d1fe7a01 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory.cs @@ -0,0 +1,537 @@ +using cpu.m6800; + +namespace MAME.Core +{ + public unsafe partial class Namcos1 + { + public static byte byte0, byte1, byte2, byte00, byte01, byte02, byte03; + public static byte byte0_old, byte1_old, byte2_old; + public static byte strobe; + public static int input_count, strobe_count; + public static int stored_input0, stored_input1; + public static byte N0ReadOpByte(ushort address) + { + int reg, offset; + byte result; + if (address >= 0x0000 && address <= 0xffff) + { + reg = address / 0x2000; + offset = address & 0x1fff; + result = user1rom[user1rom_offset[0, reg] + offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N1ReadOpByte(ushort address) + { + int reg, offset; + byte result; + if (address >= 0x0000 && address <= 0xffff) + { + reg = address / 0x2000; + offset = address & 0x1fff; + result = user1rom[user1rom_offset[1, reg] + offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N2ReadOpByte(ushort address) + { + int offset; + byte result = 0; + if (address >= 0xc000 && address <= 0xffff) + { + offset = address & 0x3fff; + result = audiorom[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N3ReadOpByte(ushort address) + { + int offset; + byte result; + if (address >= 0x4000 && address <= 0xbfff) + { + offset = address - 0x4000; + result = voicerom[mcurom_offset + offset]; + } + else if (address >= 0xf000 && address <= 0xffff) + { + offset = address & 0xfff; + result = mcurom[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N0ReadMemory(ushort address) + { + byte result; + int offset; + int reg; + reg = address / 0x2000; + offset = address & 0x1fff; + if (cus117_offset[0, reg] == 0) + { + result = user1rom[user1rom_offset[0, reg] + offset]; + } + else if (cus117_offset[0, reg] >= 0x2e0000 && cus117_offset[0, reg] <= 0x2e7fff) + { + result = namcos1_paletteram[cus117_offset[0, reg] - 0x2e0000 + offset]; + } + else if (cus117_offset[0, reg] >= 0x2f0000 && cus117_offset[0, reg] <= 0x2f7fff) + { + result = namcos1_videoram_r(cus117_offset[0, reg] - 0x2f0000 + offset); + } + else if (cus117_offset[0, reg] == 0x2f8000) + { + result = key_r(offset); + } + else if (cus117_offset[0, reg] == 0x2fc000) + { + result = namcos1_spriteram_r(offset); + } + else if (cus117_offset[0, reg] == 0x2fe000) + { + result = soundram_r(offset); + } + else if (cus117_offset[0, reg] >= 0x300000 && cus117_offset[0, reg] <= 0x307fff) + { + result = s1ram[cus117_offset[0, reg] - 0x300000 + offset]; + } + else if (cus117_offset[0, reg] >= 0x400000 && cus117_offset[0, reg] <= 0x7fffff) + { + result = user1rom[cus117_offset[0, reg] - 0x400000 + offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N1ReadMemory(ushort address) + { + byte result; + int offset; + int reg; + reg = address / 0x2000; + offset = address & 0x1fff; + if (cus117_offset[1, reg] >= 0x2e0000 && cus117_offset[1, reg] <= 0x2e7fff) + { + result = namcos1_paletteram[cus117_offset[1, reg] - 0x2e0000 + offset]; + } + else if (cus117_offset[1, reg] >= 0x2f0000 && cus117_offset[1, reg] <= 0x2f7fff) + { + result = namcos1_videoram_r(cus117_offset[1, reg] - 0x2f0000 + offset); + } + else if (cus117_offset[1, reg] == 0x2f8000) + { + result = key_r(offset); + } + else if (cus117_offset[1, reg] == 0x2fc000) + { + result = namcos1_spriteram_r(offset); + } + else if (cus117_offset[1, reg] == 0x2fe000) + { + result = soundram_r(offset); + } + else if (cus117_offset[1, reg] >= 0x300000 && cus117_offset[1, reg] <= 0x307fff) + { + result = s1ram[cus117_offset[1, reg] - 0x300000 + offset]; + } + else if (cus117_offset[1, reg] >= 0x400000 && cus117_offset[1, reg] <= 0x7fffff) + { + result = user1rom[cus117_offset[1, reg] - 0x400000 + offset]; + } + else if (cus117_offset[0, reg] == 0) + { + result = user1rom[user1rom_offset[1, reg] + offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N2ReadMemory(ushort address) + { + byte result; + int offset; + if (address >= 0x0000 && address <= 0x3fff) + { + offset = address & 0x3fff; + result = audiorom[audiocpurom_offset + offset]; + } + else if (address >= 0x4000 && address <= 0x4001) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0x5000 && address <= 0x53ff) + { + offset = address & 0x3ff; + result = Namco.namcos1_cus30_r(offset); + } + else if (address >= 0x7000 && address <= 0x77ff) + { + offset = address & 0x7ff; + result = namcos1_triram[offset]; + } + else if (address >= 0x8000 && address <= 0x9fff) + { + offset = address & 0x1fff; + result = bank_ram20[offset]; + } + else if (address >= 0xc000 && address <= 0xffff) + { + offset = address & 0x3fff; + result = audiorom[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N3ReadMemory(ushort address) + { + byte result; + int offset; + if (address >= 0x0000 && address <= 0x001f) + { + offset = address & 0x1f; + result = M6800.m1.hd63701_internal_registers_r(offset); + } + else if (address >= 0x0080 && address <= 0x00ff) + { + offset = address & 0x7f; + result = bank_ram30[offset]; + } + else if (address >= 0x1000 && address <= 0x1003) + { + offset = address & 0x03; + result = dsw_r(offset); + } + else if (address == 0x1400) + { + result = byte0; + } + else if (address == 0x1401) + { + result = byte1; + } + else if (address >= 0x4000 && address <= 0xbfff) + { + offset = address - 0x4000; + result = voicerom[mcurom_offset + offset]; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + offset = address & 0x7ff; + result = namcos1_triram[offset]; + } + else if (address >= 0xc800 && address <= 0xcfff) + { + offset = address & 0x7ff; + result = Generic.generic_nvram[offset]; + } + else if (address >= 0xf000 && address <= 0xffff) + { + offset = address & 0xfff; + result = mcurom[offset]; + } + else + { + result = 0; + } + return result; + } + public static byte N3ReadIO(ushort address) + { + byte result; + if (address == 0x100) + { + result = byte2; + } + else if (address == 0x101) + { + result = 0; + } + else + { + result = 0; + } + return result; + } + public static void N0WriteMemory(ushort address, byte data) + { + int offset; + int reg; + reg = address / 0x2000; + offset = address & 0x1fff; + if (cus117_offset[0, reg] == 0) + { + if (address >= 0x0000 && address <= 0xdfff) + { + user1rom[user1rom_offset[0, reg] + offset] = data; + } + if (address >= 0xe000 && address <= 0xefff) + { + namcos1_bankswitch_w(offset, data); + } + else if (address == 0xf000) + { + namcos1_cpu_control_w(data); + } + else if (address == 0xf200) + { + namcos1_watchdog_w(); + } + else if (address == 0xf600) + { + irq_ack_w(0); + } + else if (address == 0xf800) + { + firq_ack_w(0); + } + else if (address == 0xfa00) + { + namcos1_sub_firq_w(); + } + else if (address >= 0xfc00 && address <= 0xfc01) + { + namcos1_subcpu_bank_w(data); + } + else + { + int i1 = 1; + } + } + else if (cus117_offset[0, reg] == 0x2c0000) + { + namcos1_3dcs_w(offset); + } + else if (cus117_offset[0, reg] >= 0x2e0000 && cus117_offset[0, reg] <= 0x2e7fff) + { + namcos1_paletteram_w(cus117_offset[0, reg] - 0x2e0000 + offset, data); + } + else if (cus117_offset[0, reg] >= 0x2f0000 && cus117_offset[0, reg] <= 0x2f7fff) + { + namcos1_videoram_w(cus117_offset[0, reg] - 0x2f0000 + offset, data); + } + else if (cus117_offset[0, reg] == 0x2f8000) + { + key_w(offset, data); + } + else if (cus117_offset[0, reg] == 0x2fc000) + { + namcos1_spriteram_w(offset, data); + } + else if (cus117_offset[0, reg] == 0x2fe000) + { + soundram_w(offset, data); + } + else if (cus117_offset[0, reg] >= 0x300000 && cus117_offset[0, reg] <= 0x307fff) + { + s1ram[cus117_offset[0, reg] - 0x300000 + offset] = data; + } + else + { + int i1 = 1; + } + } + public static void N1WriteMemory(ushort address, byte data) + { + int offset; + int reg; + reg = address / 0x2000; + offset = address & 0x1fff; + if (cus117_offset[1, reg] == 0x2c0000) + { + namcos1_3dcs_w(offset); + } + else if (cus117_offset[1, reg] >= 0x2e0000 && cus117_offset[1, reg] <= 0x2e7fff) + { + namcos1_paletteram_w(cus117_offset[1, reg] - 0x2e0000 + offset, data); + } + else if (cus117_offset[1, reg] >= 0x2f0000 && cus117_offset[1, reg] <= 0x2f7fff) + { + namcos1_videoram_w(cus117_offset[1, reg] - 0x2f0000 + offset, data); + } + else if (cus117_offset[1, reg] == 0x2f8000) + { + key_w(offset, data); + } + else if (cus117_offset[1, reg] == 0x2fc000) + { + namcos1_spriteram_w(offset, data); + } + else if (cus117_offset[1, reg] == 0x2fe000) + { + soundram_w(offset, data); + } + else if (cus117_offset[1, reg] >= 0x300000 && cus117_offset[1, reg] <= 0x307fff) + { + s1ram[cus117_offset[1, reg] - 0x300000 + offset] = data; + } + else if (cus117_offset[0, reg] == 0) + { + if (address >= 0x0000 && address <= 0xdfff) + { + user1rom[user1rom_offset[1, reg] + offset] = data; + } + else if (address >= 0xe000 && address <= 0xefff) + { + namcos1_bankswitch_w(offset, data); + } + else if (address == 0xf000) + { + int i1 = 1; + } + else if (address == 0xf200) + { + namcos1_watchdog_w(); + } + else if (address == 0xf600) + { + irq_ack_w(1); + } + else if (address == 0xf800) + { + firq_ack_w(1); + } + else if (address == 0xfa00) + { + int i1 = 1; + } + else if (address >= 0xfc00 && address <= 0xfc01) + { + int i1 = 1; + } + else + { + int i1 = 1; + } + } + else + { + int i1 = 1; + } + } + public static void N2WriteMemory(ushort address, byte data) + { + int offset; + if (address == 0x4000) + { + YM2151.ym2151_register_port_0_w(data); + } + else if (address == 0x4001) + { + YM2151.ym2151_data_port_0_w(data); + } + else if (address >= 0x5000 && address <= 0x53ff) + { + offset = address & 0x3ff; + Namco.namcos1_cus30_w(offset, data); + } + else if (address >= 0x7000 && address <= 0x77ff) + { + offset = address & 0x7ff; + namcos1_triram[offset] = data; + } + else if (address >= 0x8000 && address <= 0x9fff) + { + offset = address & 0x1fff; + bank_ram20[offset] = data; + } + else if (address >= 0xc000 && address <= 0xc001) + { + namcos1_sound_bankswitch_w(data); + } + else if (address == 0xd001) + { + namcos1_watchdog_w(); + } + else if (address == 0xe000) + { + irq_ack_w(2); + } + else + { + int i1 = 1; + } + } + public static void N3WriteMemory(ushort address, byte data) + { + int offset; + if (address >= 0x0000 && address <= 0x001f) + { + offset = address & 0x1f; + M6800.m1.hd63701_internal_registers_w(offset, data); + } + else if (address >= 0x0080 && address <= 0x00ff) + { + offset = address & 0x7f; + bank_ram30[offset] = data; + } + else if (address == 0xc000) + { + namcos1_mcu_patch_w(data); + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + offset = address & 0x7ff; + namcos1_triram[offset] = data; + } + else if (address >= 0xc800 && address <= 0xcfff) + { + offset = address & 0x7ff; + Generic.generic_nvram[offset] = data; + } + else if (address == 0xd000) + { + namcos1_dac0_w(data); + } + else if (address == 0xd400) + { + namcos1_dac1_w(data); + } + else if (address == 0xd800) + { + namcos1_mcu_bankswitch_w(data); + } + else if (address == 0xf000) + { + irq_ack_w(3); + } + else + { + int i1 = 1; + } + } + public static void N3WriteIO(ushort address, byte data) + { + if (address == 0x100) + { + namcos1_coin_w(data); + } + else if (address == 0x101) + { + namcos1_dac_gain_w(data); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory.cs.meta new file mode 100644 index 00000000..5009dabf --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60f7ff357487a9e41b306652f99180ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory2.cs new file mode 100644 index 00000000..4c85f151 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory2.cs @@ -0,0 +1,147 @@ +namespace MAME.Core +{ + public partial class Namcos1 + { + public static byte N3ReadMemory_quester(ushort address) + { + byte result; + if (address == 0x1400) + { + if ((strobe & 0x20) == 0) + result = (byte)((uint)(byte0 & 0x90) | (uint)(strobe & 0x40) | (Inptport.input_port_read_direct(Inptport.analog_p0) & 0x0f)); + else + result = (byte)((uint)(byte0 & 0x90) | (uint)(strobe & 0x40) | (Inptport.input_port_read_direct(Inptport.analog_p1) & 0x0f)); + strobe ^= 0x40; + } + else if (address == 0x1401) + { + if ((strobe & 0x20) == 0) + result = (byte)((uint)(byte1 & 0x90) | 0x00 | (Inptport.input_port_read_direct(Inptport.analog_p0) >> 4)); + else + result = (byte)((uint)(byte1 & 0x90) | 0x20 | (Inptport.input_port_read_direct(Inptport.analog_p1) >> 4)); + if ((strobe & 0x40) == 0) + strobe ^= 0x20; + } + else + { + result = N3ReadMemory(address); + } + return result; + } + public static byte N3ReadMemory_berabohm(ushort address) + { + byte result; + if (address == 0x1400) + { + int inp = input_count; + if (inp == 4) + { + result = byte0; + } + else + { + if (inp == 0) + { + result = byte00; + } + else if (inp == 1) + { + result = byte01; + } + else if (inp == 2) + { + result = byte02; + } + else if (inp == 3) + { + result = byte03; + } + else + { + result = 0; + } + if ((result & 1) != 0) + { + result = 0x7f; + } + else if ((result & 2) != 0) + { + result = 0x48; + } + else if ((result & 4) != 0) + { + result = 0x40; + } + } + } + else if (address == 0x1401) + { + result = (byte)(byte1 & 0x8f); + if (++strobe_count > 4) + { + strobe_count = 0; + strobe ^= 0x40; + if (strobe == 0) + { + input_count = (input_count + 1) % 5; + if (input_count == 3) + { + result |= 0x10; + } + } + } + result |= strobe; + } + else + { + result = N3ReadMemory(address); + } + return result; + } + public static byte N3ReadMemory_faceoff(ushort address) + { + byte result; + if (address == 0x1400) + { + result = (byte)((byte0 & 0x80) | stored_input0); + } + else if (address == 0x1401) + { + result = (byte)(byte1 & 0x80); + if (++strobe_count > 8) + { + strobe_count = 0; + result |= (byte)input_count; + switch (input_count) + { + case 0: + stored_input0 = byte00 & 0x1f; + stored_input1 = (byte03 & 0x07) << 3; + break; + case 3: + stored_input0 = byte02 & 0x1f; + break; + case 4: + stored_input0 = byte01 & 0x1f; + stored_input1 = byte03 & 0x18; + break; + default: + stored_input0 = 0x1f; + stored_input1 = 0x1f; + break; + } + input_count = (input_count + 1) & 7; + } + else + { + result |= (byte)(0x40 | stored_input1); + } + } + else + { + result = N3ReadMemory(address); + } + return result; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory2.cs.meta new file mode 100644 index 00000000..48bdfa3c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e9581d59e661b04fbca2ba18a86344d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Namcos1.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Namcos1.cs new file mode 100644 index 00000000..ecc90f54 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Namcos1.cs @@ -0,0 +1,295 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Namcos1 + { + public static int dac0_value, dac1_value, dac0_gain, dac1_gain; + //public static byte[] /*gfx1rom,*/ /*gfx2rom,*/ gfx3rom, user1rom, mcurom; + //public static byte[] audiorom, voicerom, bank_ram20, bank_ram30; + public static int namcos1_pri; + public static byte dipsw; + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + + #region //指针化 gfx3rom + static byte[] gfx3rom_src; + static GCHandle gfx3rom_handle; + public static byte* gfx3rom; + public static int gfx3romLength; + public static bool gfx3rom_IsNull => gfx3rom == null; + public static byte[] gfx3rom_set + { + set + { + gfx3rom_handle.ReleaseGCHandle(); + gfx3rom_src = value; + gfx3romLength = value.Length; + gfx3rom_src.GetObjectPtr(ref gfx3rom_handle, ref gfx3rom); + } + } + #endregion + + #region //指针化 user1rom + static byte[] user1rom_src; + static GCHandle user1rom_handle; + public static byte* user1rom; + public static int user1romLength; + public static bool user1rom_IsNull => user1rom == null; + public static byte[] user1rom_set + { + set + { + user1rom_handle.ReleaseGCHandle(); + if (value == null) + return; + user1rom_src = value; + user1romLength = value.Length; + user1rom_src.GetObjectPtr(ref user1rom_handle, ref user1rom); + } + } + #endregion + + #region //指针化 mcurom + static byte[] mcurom_src; + static GCHandle mcurom_handle; + public static byte* mcurom; + public static int mcuromLength; + public static bool mcurom_IsNull => mcurom == null; + public static byte[] mcurom_set + { + set + { + mcurom_handle.ReleaseGCHandle(); + mcurom_src = value; + mcuromLength = value.Length; + mcurom_src.GetObjectPtr(ref mcurom_handle, ref mcurom); + } + } + #endregion + + + #region //指针化 audiorom + static byte[] audiorom_src; + static GCHandle audiorom_handle; + public static byte* audiorom; + public static int audioromLength; + public static bool audiorom_IsNull => audiorom == null; + public static byte[] audiorom_set + { + set + { + audiorom_handle.ReleaseGCHandle(); + audiorom_src = value; + audioromLength = value.Length; + audiorom_src.GetObjectPtr(ref audiorom_handle, ref audiorom); + } + } + #endregion + + #region //指针化 voicerom + static byte[] voicerom_src; + static GCHandle voicerom_handle; + public static byte* voicerom; + public static int voiceromLength; + public static bool voicerom_IsNull => voicerom == null; + public static byte[] voicerom_set + { + set + { + voicerom_handle.ReleaseGCHandle(); + if (value == null) + return; + voicerom_src = value; + voiceromLength = value.Length; + voicerom_src.GetObjectPtr(ref voicerom_handle, ref voicerom); + } + } + #endregion + + #region //指针化 bank_ram20 + static byte[] bank_ram20_src; + static GCHandle bank_ram20_handle; + public static byte* bank_ram20; + public static int bank_ram20Length; + public static bool bank_ram20_IsNull => bank_ram20 == null; + public static byte[] bank_ram20_set + { + set + { + bank_ram20_handle.ReleaseGCHandle(); + bank_ram20_src = value; + bank_ram20Length = value.Length; + bank_ram20_src.GetObjectPtr(ref bank_ram20_handle, ref bank_ram20); + } + } + #endregion + + + #region //指针化 bank_ram30 + static byte[] bank_ram30_src; + static GCHandle bank_ram30_handle; + public static byte* bank_ram30; + public static int bank_ram30Length; + public static bool bank_ram30_IsNull => bank_ram30 == null; + public static byte[] bank_ram30_set + { + set + { + bank_ram30_handle.ReleaseGCHandle(); + bank_ram30_src = value; + bank_ram30Length = value.Length; + bank_ram30_src.GetObjectPtr(ref bank_ram30_handle, ref bank_ram30); + } + } + #endregion + + public static byte[] ByteTo2byte(byte[] bb1) + { + byte[] bb2 = null; + int i1, n1; + if (bb1 != null) + { + n1 = bb1.Length; + bb2 = new byte[n1 * 2]; + for (i1 = 0; i1 < n1; i1++) + { + bb2[i1 * 2] = (byte)(bb1[i1] >> 4); + bb2[i1 * 2 + 1] = (byte)(bb1[i1] & 0x0f); + } + } + return bb2; + } + public static void Namcos1Init() + { + Machine.bRom = true; + user1rom_offset = new int[2, 8]; + audiorom_set = Machine.GetRom("audiocpu.rom"); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + gfx2rom_set = Machine.GetRom("gfx2.rom"); + gfx3rom_set = ByteTo2byte(Machine.GetRom("gfx3.rom")); + user1rom_set = Machine.GetRom("user1.rom"); + mcurom_set = MameMainMotion.resource.mcu; + voicerom_set = new byte[0xc0000]; + //byte[] bb1 = Machine.GetRom("voice.rom"); + //AxiArray.Copy(bb1, voicerom, bb1.Length); + voicerom_set = Machine.GetRom("voice.rom"); + bank_ram20_set = new byte[0x2000]; + bank_ram30_set = new byte[0x80]; + Namco.namco_wavedata = new byte[0x400]; + Generic.generic_nvram_set = new byte[0x800]; + cus117_offset = new int[2, 8]; + key = new byte[8]; + if (audiorom == null || gfx1rom == null || gfx2rom == null || gfx3rom == null || user1rom == null || voicerom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + switch (Machine.sName) + { + case "quester": + case "questers": + dipsw = 0xfb; + break; + default: + dipsw = 0xff; + break; + } + } + } + public static void namcos1_sub_firq_w() + { + Cpuint.cpunum_set_input_line(1, 1, LineState.ASSERT_LINE); + } + public static void irq_ack_w(int cpunum) + { + Cpuint.cpunum_set_input_line(cpunum, 0, LineState.CLEAR_LINE); + } + public static void firq_ack_w(int cpunum) + { + Cpuint.cpunum_set_input_line(cpunum, 1, LineState.CLEAR_LINE); + } + public static byte dsw_r(int offset) + { + int ret = dipsw;// 0xff;// input_port_read(machine, "DIPSW"); + if ((offset & 2) == 0) + { + ret >>= 4; + } + return (byte)(0xf0 | ret); + } + public static void namcos1_coin_w(byte data) + { + Generic.coin_lockout_global_w(~data & 1); + Generic.coin_counter_w(0, data & 2); + Generic.coin_counter_w(1, data & 4); + } + public static void namcos1_update_DACs() + { + DAC.dac_signed_data_16_w(0, (ushort)(0x8000 + (dac0_value * dac0_gain) + (dac1_value * dac1_gain))); + } + public static void namcos1_init_DACs() + { + dac0_value = 0; + dac1_value = 0; + dac0_gain = 0x80; + dac1_gain = 0x80; + } + public static void namcos1_dac_gain_w(byte data) + { + int value; + value = (data & 1) | ((data >> 1) & 2); + dac0_gain = 0x20 * (value + 1); + value = (data >> 3) & 3; + dac1_gain = 0x20 * (value + 1); + namcos1_update_DACs(); + } + public static void namcos1_dac0_w(byte data) + { + dac0_value = data - 0x80; + namcos1_update_DACs(); + } + public static void namcos1_dac1_w(byte data) + { + dac1_value = data - 0x80; + namcos1_update_DACs(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Namcos1.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Namcos1.cs.meta new file mode 100644 index 00000000..362dff3d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Namcos1.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce46ac99a1e89194cb0b93c6cd7d3316 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/State.cs new file mode 100644 index 00000000..e708ee12 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/State.cs @@ -0,0 +1,144 @@ +using cpu.m6800; +using cpu.m6809; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Namcos1 + { + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + writer.Write(dipsw); + for (i = 0; i < 0x2000; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(bank_ram20, 0, 0x2000); + writer.Write(bank_ram30, 0, 0x80); + writer.Write(namcos1_videoram, 0, 0x8000); + writer.Write(namcos1_cus116, 0, 0x10); + writer.Write(namcos1_spriteram, 0, 0x1000); + writer.Write(namcos1_playfield_control, 0, 0x20); + writer.Write(copy_sprites); + writer.Write(s1ram, 0, 0x8000); + writer.Write(namcos1_triram, 0, 0x800); + writer.Write(namcos1_paletteram, 0, 0x8000); + writer.Write(key, 0, 8); + writer.Write(audiocpurom_offset); + writer.Write(mcu_patch_data); + writer.Write(mcurom_offset); + writer.Write(namcos1_reset); + writer.Write(wdog); + writer.Write(dac0_value); + writer.Write(dac1_value); + writer.Write(dac0_gain); + writer.Write(dac1_gain); + writer.Write(Generic.generic_nvram, 0, 0x800); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + { + writer.Write(cus117_offset[i, j]); + } + } + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + { + writer.Write(user1rom_offset[i, j]); + } + } + for (i = 0; i < 3; i++) + { + M6809.mm1[i].SaveStateBinary(writer); + } + M6800.m1.SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + Namco.SaveStateBinary(writer); + DAC.SaveStateBinary(writer); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(Sound.namcostream.output_sampindex); + writer.Write(Sound.namcostream.output_base_sampindex); + writer.Write(Sound.dacstream.output_sampindex); + writer.Write(Sound.dacstream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + dipsw = reader.ReadByte(); + for (i = 0; i < 0x2000; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + bank_ram20_set = reader.ReadBytes(0x2000); + bank_ram30_set = reader.ReadBytes(0x80); + namcos1_videoram = reader.ReadBytes(0x8000); + namcos1_cus116 = reader.ReadBytes(0x10); + namcos1_spriteram = reader.ReadBytes(0x1000); + namcos1_playfield_control = reader.ReadBytes(0x20); + copy_sprites = reader.ReadInt32(); + s1ram = reader.ReadBytes(0x8000); + namcos1_triram = reader.ReadBytes(0x800); + namcos1_paletteram = reader.ReadBytes(0x8000); + key = reader.ReadBytes(8); + audiocpurom_offset = reader.ReadInt32(); + mcu_patch_data = reader.ReadInt32(); + mcurom_offset = reader.ReadInt32(); + namcos1_reset = reader.ReadInt32(); + wdog = reader.ReadInt32(); + dac0_value = reader.ReadInt32(); + dac1_value = reader.ReadInt32(); + dac0_gain = reader.ReadInt32(); + dac1_gain = reader.ReadInt32(); + Generic.generic_nvram_set = reader.ReadBytes(0x800); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + { + cus117_offset[i, j] = reader.ReadInt32(); + } + } + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + { + user1rom_offset[i, j] = reader.ReadInt32(); + } + } + for (i = 0; i < 3; i++) + { + M6809.mm1[i].LoadStateBinary(reader); + } + M6800.m1.LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + Namco.LoadStateBinary(reader); + DAC.LoadStateBinary(reader); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + Sound.namcostream.output_sampindex = reader.ReadInt32(); + Sound.namcostream.output_base_sampindex = reader.ReadInt32(); + Sound.dacstream.output_sampindex = reader.ReadInt32(); + Sound.dacstream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/State.cs.meta new file mode 100644 index 00000000..0b223ff9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41b81aba7fa84d642bbc9bf63771984f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Tilemap.cs new file mode 100644 index 00000000..0f7f86a0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Tilemap.cs @@ -0,0 +1,269 @@ +using System; + +namespace MAME.Core +{ + public partial class Namcos1 + { + public static Tmap[] ttmap; + public static void tilemap_init() + { + int i; + ttmap = new Tmap[6]; + ttmap[0] = new Tmap(); + ttmap[0].rows = 64; + ttmap[0].cols = 64; + ttmap[0].videoram_offset = 0x0000; + ttmap[1] = new Tmap(); + ttmap[1].rows = 64; + ttmap[1].cols = 64; + ttmap[1].videoram_offset = 0x2000; + ttmap[2] = new Tmap(); + ttmap[2].rows = 64; + ttmap[2].cols = 64; + ttmap[2].videoram_offset = 0x4000; + ttmap[3] = new Tmap(); + ttmap[3].rows = 32; + ttmap[3].cols = 64; + ttmap[3].videoram_offset = 0x6000; + ttmap[4] = new Tmap(); + ttmap[4].rows = 28; + ttmap[4].cols = 36; + ttmap[4].videoram_offset = 0x7010; + ttmap[5] = new Tmap(); + ttmap[5].rows = 28; + ttmap[5].cols = 36; + ttmap[5].videoram_offset = 0x7810; + for (i = 0; i < 6; i++) + { + ttmap[i].tilewidth = 8; + ttmap[i].tileheight = 8; + ttmap[i].width = ttmap[i].cols * ttmap[i].tilewidth; + ttmap[i].height = ttmap[i].rows * ttmap[i].tileheight; + ttmap[i].enable = true; + ttmap[i].all_tiles_dirty = true; + ttmap[i].scrollrows = 1; + ttmap[i].scrollcols = 1; + ttmap[i].rowscroll = new int[ttmap[i].scrollrows]; + ttmap[i].colscroll = new int[ttmap[i].scrollcols]; + ttmap[i].pixmap = new ushort[0x200 * 0x200]; + ttmap[i].flagsmap = new byte[0x200, 0x200]; + ttmap[i].tileflags = new byte[0x40, 0x40]; + ttmap[i].tile_update3 = ttmap[i].tile_updateNa; + ttmap[i].tilemap_draw_instance3 = ttmap[i].tilemap_draw_instanceNa; + } + } + public static void tilemap_set_flip(byte attributes) + { + foreach (Tmap t1 in ttmap) + { + if (t1.attributes != attributes) + { + t1.attributes = attributes; + } + } + } + } + public unsafe partial class Tmap + { + public void tile_updateNa(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int code, tile_index, col2, row2; + byte flags; + if ((attributes & Tilemap.TILEMAP_FLIPX) != 0) + { + col2 = (cols - 1) - col; + } + else + { + col2 = col; + } + if ((attributes & Tilemap.TILEMAP_FLIPY) != 0) + { + row2 = (rows - 1) - row; + } + else + { + row2 = row; + } + tile_index = (row2 * cols + col2) << 1; + code = Namcos1.namcos1_videoram[videoram_offset + tile_index + 1] + ((Namcos1.namcos1_videoram[videoram_offset + tile_index] & 0x3f) << 8); + flags = (byte)(attributes & 0x03); + tileflags[row, col] = tile_drawNa(code * 0x40, x0, y0, 0x800, flags); + tileflags[row, col] = tile_apply_bitmaskNa(code << 3, x0, y0, flags); + } + public byte tile_drawNa(int pendata_offset, int x0, int y0, int palette_base, byte flags) + { + int height = tileheight; + int width = tilewidth; + int dx0 = 1, dy0 = 1; + int tx, ty; + int offset1 = pendata_offset; + int offsety1; + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += height - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += width - 1; + dx0 = -1; + } + for (ty = 0; ty < height; ty++) + { + int xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < width; tx++) + { + byte pen; + pen = Namcos1.gfx2rom[offset1]; + offset1++; + pixmap[offsety1 * 0x200 + x0 + xoffs] = (ushort)(0x800 + pen); + flagsmap[offsety1, x0 + xoffs] = Tilemap.TILEMAP_PIXEL_LAYER0; + xoffs += dx0; + } + } + return 0; + } + public byte tile_apply_bitmaskNa(int maskdata_offset, int x0, int y0, byte flags) + { + int height = tileheight; + int width = tilewidth; + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int bitoffs = 0; + int tx, ty; + int offsety1; + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += height - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += width - 1; + dx0 = -1; + } + for (ty = 0; ty < height; ty++) + { + int xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < width; tx++) + { + byte map = flagsmap[offsety1, x0 + xoffs]; + if ((Namcos1.gfx1rom[maskdata_offset + bitoffs / 8] & (0x80 >> (bitoffs & 7))) == 0) + { + map = flagsmap[offsety1, x0 + xoffs] = Tilemap.TILEMAP_PIXEL_TRANSPARENT; + } + andmask &= map; + ormask |= map; + xoffs += dx0; + bitoffs++; + } + } + return (byte)(andmask ^ ormask); + } + public unsafe void tilemap_draw_instanceNa(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + cur_trans = trans_t.WHOLLY_TRANSPARENT; + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_updateNa(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + continue; + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = (ushort)(pixmap[offsety2 * 0x200 + i - xpos] + palette_offset); + Tilemap.priority_bitmap[offsety2 + ypos, i] = priority; + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = (ushort)(pixmap[offsety2 * 0x200 + i - xpos] + palette_offset); + Tilemap.priority_bitmap[offsety2 + ypos, i] = priority; + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Tilemap.cs.meta new file mode 100644 index 00000000..1ef7ac35 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30bbe39e0510f634e904b9ed9529d139 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Video.cs new file mode 100644 index 00000000..a3f4c902 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Video.cs @@ -0,0 +1,246 @@ +using System; + +namespace MAME.Core +{ + public partial class Namcos1 + { + public static byte[] namcos1_videoram; + public static byte[] namcos1_cus116; + public static byte[] namcos1_spriteram; + public static byte[] namcos1_playfield_control; + private static ushort[] uu2000; + public static int flip_screen_x, flip_screen_y; + public static int copy_sprites; + public static void video_start_namcos1() + { + int i; + namcos1_videoram = new byte[0x8000]; + namcos1_cus116 = new byte[0x10]; + namcos1_spriteram = new byte[0x1000]; + namcos1_playfield_control = new byte[0x20]; + Array.Clear(namcos1_videoram, 0, 0x8000); + Array.Clear(namcos1_paletteram, 0, 0x8000); + Array.Clear(namcos1_cus116, 0, 0x10); + Array.Clear(namcos1_playfield_control, 0, 0x20); + uu2000 = new ushort[0x200 * 0x200]; + for (i = 0; i < 0x40000; i++) + { + uu2000[i] = 0x2000; + } + ttmap[4].tilemap_set_scrolldx(73, 512 - 73); + ttmap[5].tilemap_set_scrolldx(73, 512 - 73); + ttmap[4].tilemap_set_scrolldy(0x10, 0x110); + ttmap[5].tilemap_set_scrolldy(0x10, 0x110); + for (i = 0; i < 0x2000; i++) + { + Palette.palette_entry_set_color1(i, Palette.make_rgb(0, 0, 0)); + } + copy_sprites = 0; + } + public static byte namcos1_videoram_r(int offset) + { + return namcos1_videoram[offset]; + } + public static void namcos1_videoram_w(int offset, byte data) + { + namcos1_videoram[offset] = data; + if (offset < 0x7000) + { + int layer = offset >> 13; + int num = (offset & 0x1fff) >> 1; + int row, col; + //row = num / Tilemap.ttmap[layer].cols; + //col = num % Tilemap.ttmap[layer].cols; + //Tilemap.tilemap_mark_tile_dirty(Tilemap.ttmap[layer], row, col); + //row = num / Tmap.ttmap[layer].cols; + //col = num % Tmap.ttmap[layer].cols; + ttmap[layer].get_row_col(num, out row, out col); + ttmap[layer].tilemap_mark_tile_dirty(row, col); + } + else + { + int layer = (offset >> 11 & 1) + 4; + int num = ((offset & 0x7ff) - 0x10) >> 1; + int row, col; + if (num >= 0 && num < 0x3f0) + { + //row = num / Tilemap.ttmap[layer].cols; + //col = num % Tilemap.ttmap[layer].cols; + //Tilemap.tilemap_mark_tile_dirty(Tilemap.ttmap[layer], row, col); + //row = num / Tmap.ttmap[layer].cols; + //col = num % Tmap.ttmap[layer].cols; + ttmap[layer].get_row_col(num, out row, out col); + ttmap[layer].tilemap_mark_tile_dirty(row, col); + } + } + } + public static void namcos1_paletteram_w(int offset, byte data) + { + if (namcos1_paletteram[offset] == data) + return; + if ((offset & 0x1800) != 0x1800) + { + int r, g, b; + int color = ((offset & 0x6000) >> 2) | (offset & 0x7ff); + namcos1_paletteram[offset] = data; + offset &= ~0x1800; + r = namcos1_paletteram[offset]; + g = namcos1_paletteram[offset + 0x0800]; + b = namcos1_paletteram[offset + 0x1000]; + Palette.palette_entry_set_color1(color, Palette.make_rgb(r, g, b)); + } + else + { + int i, j; + namcos1_cus116[offset & 0x0f] = data; + for (i = 0x1800; i < 0x8000; i += 0x2000) + { + offset = (offset & 0x0f) | i; + for (j = 0; j < 0x80; j++, offset += 0x10) + { + namcos1_paletteram[offset] = data; + } + } + } + } + public static byte namcos1_spriteram_r(int offset) + { + if (offset < 0x1000) + return namcos1_spriteram[offset]; + else + return namcos1_playfield_control[offset & 0x1f]; + } + public static void namcos1_spriteram_w(int offset, byte data) + { + if (offset < 0x1000) + { + namcos1_spriteram[offset] = data; + if (offset == 0x0ff2) + { + copy_sprites = 1; + } + } + else + { + namcos1_playfield_control[offset & 0x1f] = data; + } + } + public static void draw_sprites(int iBitmap, RECT cliprect) + { + int source_offset; + int sprite_xoffs = namcos1_spriteram[0x800 + 0x07f5] + ((namcos1_spriteram[0x800 + 0x07f4] & 1) << 8); + int sprite_yoffs = namcos1_spriteram[0x800 + 0x07f7]; + for (source_offset = 0xfe0; source_offset >= 0x800; source_offset -= 0x10) + { + int[] sprite_size = new int[] { 16, 8, 32, 4 }; + int attr1 = namcos1_spriteram[source_offset + 10]; + int attr2 = namcos1_spriteram[source_offset + 14]; + int color = namcos1_spriteram[source_offset + 12]; + int flipx = (attr1 & 0x20) >> 5; + int flipy = (attr2 & 0x01); + int sizex = sprite_size[(attr1 & 0xc0) >> 6]; + int sizey = sprite_size[(attr2 & 0x06) >> 1]; + int tx = (attr1 & 0x18) & (~(sizex - 1)); + int ty = (attr2 & 0x18) & (~(sizey - 1)); + int sx = namcos1_spriteram[source_offset + 13] + ((color & 0x01) << 8); + int sy = -namcos1_spriteram[source_offset + 15] - sizey; + int sprite = namcos1_spriteram[source_offset + 11]; + int sprite_bank = attr1 & 7; + int priority = (namcos1_spriteram[source_offset + 14] & 0xe0) >> 5; + namcos1_pri = priority; + sprite += sprite_bank * 256; + color = color >> 1; + sx += sprite_xoffs; + sy -= sprite_yoffs; + if (Video.flip_screen_get()) + { + sx = -sx - sizex; + sy = -sy - sizey; + flipx ^= 1; + flipy ^= 1; + } + sy++; + Drawgfx.common_drawgfx_na(sizex, sizey, tx, ty, sprite, color, flipx, flipy, sx & 0x1ff, ((sy + 16) & 0xff) - 16, cliprect); + } + } + public static void video_update_namcos1() + { + int i, j, scrollx, scrolly; + byte priority; + RECT new_clip = new RECT(); + new_clip.min_x = 0x49; + new_clip.max_x = 0x168; + new_clip.min_y = 0x10; + new_clip.max_y = 0xef; + Video.flip_screen_set_no_update((namcos1_spriteram[0x800 + 0x07f6] & 1) != 0); + tilemap_set_flip(Video.flip_screen_get() ? (byte)(Tilemap.TILEMAP_FLIPY | Tilemap.TILEMAP_FLIPX) : (byte)0); + Array.Copy(uu2000, Video.bitmapbase[Video.curbitmap], 0x40000); + i = ((namcos1_cus116[0] << 8) | namcos1_cus116[1]) - 1; + if (new_clip.min_x < i) + new_clip.min_x = i; + i = ((namcos1_cus116[2] << 8) | namcos1_cus116[3]) - 1 - 1; + if (new_clip.max_x > i) + new_clip.max_x = i; + i = ((namcos1_cus116[4] << 8) | namcos1_cus116[5]) - 0x11; + if (new_clip.min_y < i) + new_clip.min_y = i; + i = ((namcos1_cus116[6] << 8) | namcos1_cus116[7]) - 0x11 - 1; + if (new_clip.max_y > i) + new_clip.max_y = i; + if (new_clip.max_x < new_clip.min_x || new_clip.max_y < new_clip.min_y) + return; + for (i = 0; i < 6; i++) + { + ttmap[i].tilemap_set_palette_offset((namcos1_playfield_control[i + 24] & 7) * 256); + } + for (i = 0; i < 4; i++) + { + int[] disp_x = new int[] { 25, 27, 28, 29 }; + j = i << 2; + scrollx = (namcos1_playfield_control[j + 1] + (namcos1_playfield_control[j + 0] << 8)) - disp_x[i]; + scrolly = (namcos1_playfield_control[j + 3] + (namcos1_playfield_control[j + 2] << 8)) + 8; + if (Video.flip_screen_get()) + { + scrollx = -scrollx; + scrolly = -scrolly; + } + ttmap[i].tilemap_set_scrollx(0, scrollx); + ttmap[i].tilemap_set_scrolly(0, scrolly); + } + Array.Clear(Tilemap.priority_bitmap, 0, 0x40000); + for (i = 0; i < 0x200; i++) + { + for (j = 0; j < 0x200; j++) + { + Tilemap.priority_bitmap[i, j] = 0; + } + } + for (priority = 0; priority < 8; priority++) + { + for (i = 0; i < 6; i++) + { + if (namcos1_playfield_control[16 + i] == priority) + { + ttmap[i].tilemap_draw_primask(new_clip, 0x10, priority); + } + } + } + draw_sprites(Video.curbitmap, new_clip); + } + public static void video_eof_namcos1() + { + if (copy_sprites != 0) + { + int i, j; + for (i = 0; i < 0x800; i += 16) + { + for (j = 10; j < 16; j++) + { + namcos1_spriteram[0x800 + i + j] = namcos1_spriteram[0x800 + i + j - 6]; + } + } + copy_sprites = 0; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Video.cs.meta new file mode 100644 index 00000000..294a28ae --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 781b72e8b91b92647b4b57b2f012f695 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/cus64-64a1.mcu b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/cus64-64a1.mcu new file mode 100644 index 00000000..48e314f0 Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/cus64-64a1.mcu differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/cus64-64a1.mcu.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/cus64-64a1.mcu.meta new file mode 100644 index 00000000..57fc582d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/namcos1/cus64-64a1.mcu.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6793b9185cc34804ea2a1ee7bd3493a5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo.meta new file mode 100644 index 00000000..86ea3e3b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e2c4f04d8355d4d4f85f762df7dffc3c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/000-lo.lo b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/000-lo.lo new file mode 100644 index 00000000..af71e079 Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/000-lo.lo differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/000-lo.lo.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/000-lo.lo.meta new file mode 100644 index 00000000..f4bd3b1b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/000-lo.lo.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1bcc1d36d41f42041a4611cdd2dc1a9e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Input.cs new file mode 100644 index 00000000..f8ff4e80 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Input.cs @@ -0,0 +1,342 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class Neogeo + { + public static void loop_inputports_neogeo_standard() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short3 &= ~0x0001; + } + else + { + short3 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short3 &= ~0x0002; + } + else + { + short3 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + short2 &= ~0x0400; + } + else + { + short2 |= 0x0400; + } + + + //if (Keyboard.IsPressed(Corekey.D)) + if (Keyboard.IsPressed(MotionKey.P1_RIGHT)) + { + short0 &= ~0x0800; + } + else + { + short0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short0 &= ~0x1000; + } + else + { + short0 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short0 &= ~0x2000; + } + else + { + short0 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short0 &= ~0x4000; + } + else + { + short0 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + short0 &= unchecked((short)~0x8000); + } + else + { + short0 |= unchecked((short)0x8000); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short1 &= ~0x0800; + } + else + { + short1 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short1 &= ~0x0400; + } + else + { + short1 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short1 &= ~0x0200; + } + else + { + short1 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short1 &= ~0x0100; + } + else + { + short1 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short1 &= ~0x2000; + } + else + { + short1 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short1 &= ~0x4000; + } + else + { + short1 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + short1 &= unchecked((short)~0x8000); + } + else + { + short1 |= unchecked((short)0x8000); + } + + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + short3 &= ~0x0004; + } + else + { + short3 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + short4 &= ~0x0080; + } + else + { + short4 |= 0x0080; + } + } + public static void loop_inputports_neogeo_irrmaze() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short3 &= ~0x0001; + } + else + { + short3 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short3 &= ~0x0002; + } + else + { + short3 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + short2 &= ~0x0400; + } + else + { + short2 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short1 &= ~0x1000; + } + else + { + short1 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short1 &= ~0x2000; + } + else + { + short1 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short1 &= ~0x4000; + } + else + { + short1 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short1 &= unchecked((short)~0x8000); + } + else + { + short1 |= unchecked((short)0x8000); + } + Inptport.frame_update_analog_field_irrmaze_p0(Inptport.analog_p0); + Inptport.frame_update_analog_field_irrmaze_p1(Inptport.analog_p1); + } + public static void record_port() + { + if (short0 != short0_old || short1 != short1_old || short2 != short2_old || short3 != short3_old || short4 != short4_old) + { + short0_old = short0; + short1_old = short1; + short2_old = short2; + short3_old = short3; + short4_old = short4; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(short0); + Mame.bwRecord.Write(short1); + Mame.bwRecord.Write(short2); + Mame.bwRecord.Write(short3); + Mame.bwRecord.Write(short4); + } + } + public static void replay_port() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + short0_old = Mame.brRecord.ReadInt16(); + short1_old = Mame.brRecord.ReadInt16(); + short2_old = Mame.brRecord.ReadInt16(); + short3_old = Mame.brRecord.ReadInt16(); + short4_old = Mame.brRecord.ReadInt16(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + short0 = short0_old; + short1 = short1_old; + short2 = short2_old; + short3 = short3_old; + short4 = short4_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Input.cs.meta new file mode 100644 index 00000000..97be90c2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51ec03aa32f53be46b6d2b28994cc2b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs new file mode 100644 index 00000000..36810907 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs @@ -0,0 +1,2109 @@ +using cpu.m68000; + +namespace MAME.Core +{ + public unsafe partial class Neogeo + { + public static short short0, short1, short2, short3, short4, short5, short6; + public static short short0_old, short1_old, short2_old, short3_old, short4_old, short5_old, short6_old; + public static sbyte MReadOpByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x000000 && address <= 0x00007f) + { + if (main_cpu_vector_table_source == 0) + { + result = (sbyte)mainbiosrom[address]; + } + else if (main_cpu_vector_table_source == 1) + { + result = (sbyte)Memory.mainrom[address]; + } + } + else if (address >= 0x000080 && address <= 0x0fffff) + { + result = (sbyte)Memory.mainrom[address]; + } + else if (address >= 0x100000 && address <= 0x1fffff) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + else if (address >= 0x200000 && address <= 0x2fffff) + { + result = (sbyte)Memory.mainrom[main_cpu_bank_address + (address - 0x200000)]; + } + else if (address >= 0xc00000 && address <= 0xcfffff) + { + result = (sbyte)mainbiosrom[address & 0x1ffff]; + } + else + { + result = 0; + } + return result; + } + public static sbyte MReadByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x000000 && address <= 0x00007f) + { + if (main_cpu_vector_table_source == 0) + { + result = (sbyte)mainbiosrom[address]; + } + else if (main_cpu_vector_table_source == 1) + { + result = (sbyte)Memory.mainrom[address]; + } + } + else if (address >= 0x000080 && address <= 0x0fffff) + { + result = (sbyte)Memory.mainrom[address]; + } + else if (address >= 0x100000 && address <= 0x1fffff) + { + result = (sbyte)Memory.mainram[address & 0xffff]; + } + else if (address >= 0x200000 && address <= 0x2fffff) + { + result = (sbyte)Memory.mainrom[main_cpu_bank_address + (address - 0x200000)]; + } + /*else if (address >= 0x300000 && address <= 0x300001) + { + if (address == 0x300000) + { + result = (sbyte)(short0 >> 8); + } + else if (address == 0x300001) + { + result = (sbyte)dsw; + } + } + else if (address >= 0x300080 && address <= 0x300081) + { + if (address == 0x300080) + { + result = (sbyte)(short4 >> 8); + } + else if (address == 0x300081) + { + result = (sbyte)short4; + } + }*/ + else if (address >= 0x300000 && address <= 0x31ffff) + { + int add = address & 0x81; + if (add == 0x00) + { + result = (sbyte)(short0 >> 8); + } + else if (add == 0x01) + { + result = (sbyte)dsw; + } + else if (add == 0x80) + { + result = (sbyte)(short4 >> 8); + } + else if (add == 0x81) + { + result = (sbyte)short4; + } + } + else if (address >= 0x320000 && address <= 0x33ffff) + { + if ((address & 0x01) == 0) + { + result = (sbyte)((short3 >> 8) | get_audio_result()); + } + else if ((address & 0x01) == 1) + { + result = (sbyte)((ushort)short3 | ((get_calendar_status() & 0x03) << 6)); + } + } + else if (address >= 0x340000 && address <= 0x35ffff) + { + if ((address & 0x01) == 0) + { + result = (sbyte)(short1 >> 8); + } + else if ((address & 0x01) == 1) + { + result = (sbyte)short1; + } + } + else if (address >= 0x380000 && address <= 0x39ffff) + { + if ((address & 0x01) == 0) + { + result = (sbyte)(short2 >> 8); + } + else if ((address & 0x01) == 1) + { + result = (sbyte)short2; + } + } + else if (address >= 0x3c0000 && address <= 0x3dffff) + { + if ((address & 0x01) == 0) + { + result = (sbyte)(neogeo_video_register_r((address & 0x07) >> 1) >> 8); + } + else if ((address & 0x01) == 1) + { + int i1 = 1; + } + } + else if (address >= 0x400000 && address <= 0x7fffff) + { + int i1 = 1; + //result = palettes[palette_bank][(address &0x1fff) >> 1]; + } + else if (address >= 0xc00000 && address <= 0xcfffff) + { + result = (sbyte)mainbiosrom[address & 0x1ffff]; + } + else if (address >= 0xd00000 && address <= 0xdfffff) + { + result = (sbyte)mainram2[address & 0xffff]; + } + else + { + int i1 = 1; + } + return result; + } + public static short MReadOpWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x000000 && address + 1 <= 0x00007f) + { + if (main_cpu_vector_table_source == 0) + { + result = (short)(mainbiosrom[address] * 0x100 + mainbiosrom[address + 1]); + } + else if (main_cpu_vector_table_source == 1) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + } + else if (address >= 0x000080 && address + 1 <= 0x0fffff) + { + if (address >= 0x142B9 && address <= 0x142C9) + { + //m68000Form.iStatus = 1; + } + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x1fffff) + { + result = (short)(Memory.mainram[address & 0xffff] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + 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]); + } + else if (address >= 0xc00000 && address + 1 <= 0xcfffff) + { + result = (short)(mainbiosrom[address & 0x1ffff] * 0x100 + mainbiosrom[(address & 0x1ffff) + 1]); + } + else + { + result = 0; + } + return result; + } + public static short MReadWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x000000 && address + 1 <= 0x00007f) + { + if (main_cpu_vector_table_source == 0) + { + result = (short)(mainbiosrom[address] * 0x100 + mainbiosrom[address + 1]); + } + else if (main_cpu_vector_table_source == 1) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + } + else if (address >= 0x000080 && address + 1 <= 0x0fffff) + { + if (address >= 0x142B9 && address <= 0x142C9) + { + //m68000Form.iStatus = 1; + } + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x1fffff) + { + if (address == 0x101410) + { + int i1 = 1; + } + result = (short)(Memory.mainram[address & 0xffff] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); + } + 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]); + } + /*else if (address >= 0x300000 && address <= 0x300001) + { + result = (short)((ushort)short0 | dsw); + } + else if (address >= 0x300080 && address <= 0x300081) + { + result = short4; + }*/ + else if (address >= 0x300000 && address <= 0x31ffff) + { + int add = address & 0x81; + if (add >= 0x00 && add + 1 <= 0x01) + { + result = (short)((ushort)short0 | dsw); + } + else if (add >= 0x80 && add + 1 <= 0x81) + { + result = short4; + } + } + else if (address >= 0x320000 && address <= 0x33ffff) + { + result = (short)((ushort)short3 | (ushort)((get_calendar_status() & 0x03) << 6) | (get_audio_result() << 8)); + } + else if (address >= 0x340000 && address <= 0x35ffff) + { + result = short1; + } + else if (address >= 0x380000 && address <= 0x39ffff) + { + result = short2; + } + else if (address >= 0x3c0000 && address + 1 <= 0x3dffff) + { + result = (short)neogeo_video_register_r((address & 0x07) >> 1); + } + else if (address >= 0x400000 && address + 1 <= 0x7fffff) + { + result = (short)palettes[palette_bank, (address & 0x1fff) >> 1]; + } + else if (address >= 0xc00000 && address + 1 <= 0xcfffff) + { + result = (short)(mainbiosrom[address & 0x1ffff] * 0x100 + mainbiosrom[(address & 0x1ffff) + 1]); + } + else if (address >= 0xd00000 && address + 1 <= 0xdfffff) + { + result = (short)(mainram2[address & 0xffff] * 0x100 + mainram2[(address & 0xffff) + 1]); + } + else + { + int i1 = 1; + } + return result; + } + public static int MReadOpLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 < 0x00007f) + { + if (main_cpu_vector_table_source == 0) + { + result = mainbiosrom[address] * 0x1000000 + mainbiosrom[address + 1] * 0x10000 + mainbiosrom[address + 2] * 0x100 + mainbiosrom[address + 3]; + } + 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]; + } + } + else if (address >= 0x000080 && address + 3 <= 0x0fffff) + { + if (address >= 0x1387a && address <= 0x1387a) + { + //m68000Form.iStatus = 1; + } + 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) + { + result = Memory.mainram[address & 0xffff] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]; + } + 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]; + } + else if (address >= 0xc00000 && address + 3 <= 0xcfffff) + { + result = mainbiosrom[address & 0x1ffff] * 0x1000000 + mainbiosrom[(address & 0x1ffff) + 1] * 0x10000 + mainbiosrom[(address & 0x1ffff) + 2] * 0x100 + mainbiosrom[(address & 0x1ffff) + 3]; + } + else + { + result = 0; + } + return result; + } + public static int MReadLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x000000 && address + 3 <= 0x00007f) + { + if (main_cpu_vector_table_source == 0) + { + result = mainbiosrom[address] * 0x1000000 + mainbiosrom[address + 1] * 0x10000 + mainbiosrom[address + 2] * 0x100 + mainbiosrom[address + 3]; + } + 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]; + } + } + else if (address >= 0x000080 && address + 3 <= 0x0fffff) + { + if (address >= 0x1387a && address <= 0x1387a) + { + //m68000Form.iStatus = 1; + } + 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) + { + result = Memory.mainram[address & 0xffff] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]; + } + 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]; + } + else if (address >= 0x300000 && address <= 0x31ffff) + { + result = 0; + } + else if (address >= 0x320000 && address <= 0x33ffff) + { + result = 0; + } + else if (address >= 0x340000 && address <= 0x35ffff) + { + result = 0; + } + else if (address >= 0x380000 && address <= 0x39ffff) + { + result = 0; + } + else if (address >= 0x3c0000 && address + 3 <= 0x3dffff) + { + int i1 = 1; + //result =neogeo_video_register_r((address &0x07) >> 1, mem_mask); + } + else if (address >= 0x400000 && address + 3 <= 0x7fffff) + { + result = palettes[palette_bank, (address & 0x1fff) / 2] * 0x10000 + palettes[palette_bank, ((address & 0x1fff) / 2) + 1]; + } + else if (address >= 0xc00000 && address + 3 <= 0xcfffff) + { + result = mainbiosrom[address & 0x1ffff] * 0x1000000 + mainbiosrom[(address & 0x1ffff) + 1] * 0x10000 + mainbiosrom[(address & 0x1ffff) + 2] * 0x100 + mainbiosrom[(address & 0x1ffff) + 3]; + } + else if (address >= 0xd00000 && address + 3 <= 0xdfffff) + { + result = mainram2[address & 0xffff] * 0x1000000 + mainram2[(address & 0xffff) + 1] * 0x10000 + mainram2[(address & 0xffff) + 2] * 0x100 + mainram2[(address & 0xffff) + 3]; + } + else + { + int i1 = 1; + } + return result; + } + public static void MWriteByte(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x100000 && address <= 0x1fffff) + { + if (address == 0x100d0b && value == 0x06)//&&MC68000.m1.TotalExecutedCycles>0x3F6FC8C) + { + ulong l1 = MC68000.m1.TotalExecutedCycles; + int i2 = 1; + //m68000Form.iStatus = 1; + } + Memory.mainram[address & 0xffff] = (byte)value; + } + else if (address >= 0x2ffff0 && address <= 0x2fffff) + { + main_cpu_bank_select_w(value); + } + else if (address >= 0x300000 && address <= 0x31ffff) + { + if ((address & 0x01) == 0) + { + int i1 = 1; + } + else if ((address & 0x01) == 1) + { + watchdog_w(); + } + } + else if (address >= 0x320000 && address <= 0x33ffff) + { + if ((address & 0x01) == 0) + { + audio_command_w((byte)value); + } + else if ((address & 0x01) == 1) + { + int i1 = 1; + } + } + else if (address >= 0x380000 && address <= 0x39ffff) + { + io_control_w((address & 0x7f) >> 1, (byte)value); + } + else if (address >= 0x3a0000 && address <= 0x3bffff) + { + if ((address & 0x01) == 1) + { + system_control_w((address & 0x1f) >> 1); + } + } + else if (address >= 0x3c0000 && address <= 0x3dffff) + { + if ((address & 0x01) == 0) + { + neogeo_video_register_w((address & 0x0f) >> 1, (ushort)((value << 8) | (byte)value)); + } + else if ((address & 0x01) == 1) + { + int i1 = 1; + } + } + else if (address >= 0x400000 && address <= 0x7fffff) + { + int i1 = 1; + //neogeo_paletteram_w((address - 0x400000) >> 1, data, mem_mask); + } + else if (address >= 0xd00000 && address <= 0xdfffff) + { + save_ram_w(address & 0xffff, (byte)value); + } + else + { + int i1 = 1; + } + } + public static void MWriteWord(int address, short value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 1 <= 0x1fffff) + { + if (address == 0x1007c4 && value == unchecked((short)0xb102)) + { + int i1 = 1; + } + Memory.mainram[address & 0xffff] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)value; + } + else if (address >= 0x2ffff0 && address <= 0x2fffff) + { + main_cpu_bank_select_w(value); + } + else if (address >= 0x300000 && address <= 0x31ffff) + { + int i1 = 1; + //watchdog_w(); + } + else if (address >= 0x320000 && address <= 0x33ffff) + { + audio_command_w((byte)(value >> 8)); + } + else if (address >= 0x380000 && address <= 0x39ffff) + { + io_control_w((address & 0x7f) >> 1, (byte)value); + } + else if (address >= 0x3a0000 && address <= 0x3bffff) + { + system_control_w((address & 0x1f) >> 1); + } + else if (address >= 0x3c0000 && address <= 0x3dffff) + { + neogeo_video_register_w((address & 0x0f) >> 1, (ushort)value); + } + else if (address >= 0x400000 && address <= 0x7fffff) + { + neogeo_paletteram_w((address & 0x1fff) >> 1, (ushort)value); + } + else if (address >= 0xd00000 && address + 1 <= 0xdfffff) + { + save_ram_w(address & 0xffff, (byte)(value >> 8)); + save_ram_w((address & 0xffff) + 1, (byte)value); + } + else + { + int i1 = 1; + } + } + public static void MWriteLong(int address, int value) + { + address &= 0xffffff; + if (address >= 0x100000 && address + 3 <= 0x1fffff) + { + if (address == 0x1051e4 && value == 0x00130070) + { + int i1 = 1; + } + Memory.mainram[address & 0xffff] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)value; + } + else if (address >= 0x2ffff0 && address <= 0x2fffff) + { + main_cpu_bank_select_w(value); + } + else if (address >= 0x300000 && address <= 0x31ffff) + { + int i1 = 1; + //watchdog_w(); + } + else if (address >= 0x320000 && address <= 0x33ffff) + { + int i1 = 1; + //audio_command_w + } + else if (address >= 0x380000 && address <= 0x39ffff) + { + int i1 = 1; + //io_control_w((address & 0x7f) >> 1, value); + } + else if (address >= 0x3a0000 && address <= 0x3bffff) + { + //system_control_w((address &0x1f) >> 1, mem_mask); + int i1 = 1; + } + else if (address >= 0x3c0000 && address + 3 <= 0x3dffff) + { + neogeo_video_register_w((address & 0x0f) >> 1, (ushort)(value >> 16)); + neogeo_video_register_w(((address & 0x0f) >> 1) + 1, (ushort)value); + } + else if (address >= 0x400000 && address + 3 <= 0x7fffff) + { + neogeo_paletteram_w((address & 0x1fff) >> 1, (ushort)(value >> 16)); + neogeo_paletteram_w(((address & 0x1fff) >> 1) + 1, (ushort)value); + } + else if (address >= 0xd00000 && address + 3 <= 0xdfffff) + { + save_ram_w(address & 0xffff, (byte)(value >> 24)); + save_ram_w((address & 0xffff) + 1, (byte)(value >> 16)); + save_ram_w((address & 0xffff) + 2, (byte)(value >> 8)); + save_ram_w((address & 0xffff) + 3, (byte)value); + } + else + { + int i1 = 1; + } + } + public static sbyte MReadByte_fatfury2(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x200000 && address <= 0x2fffff) + { + int offset = (address - 0x200000) / 2; + result = (sbyte)fatfury2_protection_16_r(offset); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_fatfury2(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x200000 && address + 1 <= 0x2fffff) + { + int offset = (address - 0x200000) / 2; + result = (short)fatfury2_protection_16_r(offset); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_fatfury2(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x200000 && address + 3 <= 0x2fffff) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_fatfury2(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x200000 && address <= 0x2fffff) + { + int offset = (address - 0x200000) / 2; + fatfury2_protection_16_w(offset); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_fatfury2(int address, short value) + { + address &= 0xffffff; + if (address >= 0x200000 && address + 1 <= 0x2fffff) + { + int offset = (address - 0x200000) / 2; + fatfury2_protection_16_w(offset); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_fatfury2(int address, int value) + { + address &= 0xffffff; + if (address >= 0x200000 && address + 3 <= 0x2fffff) + { + int i1 = 1; + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_irrmaze(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x300000 && address <= 0x300001) + { + if (address == 0x300000) + { + result = (sbyte)dsw; + } + else if (address == 0x300001) + { + if ((controller_select & 0x01) == 0) + { + result = (sbyte)(Inptport.input_port_read_direct(Inptport.analog_p0) ^ 0xff); + } + else if ((controller_select & 0x01) == 1) + { + result = (sbyte)(Inptport.input_port_read_direct(Inptport.analog_p1) ^ 0xff); + } + } + } + else + { + result = MReadByte(address); + } + return result; + } + public static void MWriteWord_kof98(int address, short value) + { + address &= 0xffffff; + if (address >= 0x20aaaa && address + 1 <= 0x20aaab) + { + kof98_prot_w(value); + } + else + { + MWriteWord(address, value); + } + } + public static sbyte MReadByte_kof99(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + result = (sbyte)prot_9a37_r(); + } + else if (address >= 0x2ffff8 && address <= 0x2ffffb) + { + result = (sbyte)sma_random_r(); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_kof99(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2fe446 && address + 1 <= 0x2fe447) + { + result = (short)prot_9a37_r(); + } + else if (address >= 0x2ffff8 && address + 1 <= 0x2ffffb) + { + result = (short)sma_random_r(); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_kof99(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + result = 0; + } + else if (address >= 0x2ffff8 && address <= 0x2ffffb) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_kof99(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address <= 0x2ffff1) + { + kof99_bankswitch_w(value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_kof99(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address + 1 <= 0x2ffff1) + { + kof99_bankswitch_w(value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_kof99(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address <= 0x2ffff1) + { + int i1 = 1; + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_garou(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + result = (sbyte)prot_9a37_r(); + } + else if (address >= 0x2fffcc && address <= 0x2fffcd) + { + result = (sbyte)sma_random_r(); + } + else if (address >= 0x2ffff0 && address <= 0x2ffff1) + { + result = (sbyte)sma_random_r(); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_garou(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2fe446 && address + 1 <= 0x2fe447) + { + result = (short)prot_9a37_r(); + } + else if (address >= 0x2fffcc && address + 1 <= 0x2fffcd) + { + result = (short)sma_random_r(); + } + else if (address >= 0x2ffff0 && address + 1 <= 0x2ffff1) + { + result = (short)sma_random_r(); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_garou(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + result = 0; + } + else if (address >= 0x2fffcc && address <= 0x2fffcd) + { + result = 0; + } + else if (address >= 0x2ffff0 && address <= 0x2ffff1) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_garou(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2fffc0 && address <= 0x2fffc1) + { + garou_bankswitch_w(value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_garou(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2fffc0 && address + 1 <= 0x2fffc1) + { + garou_bankswitch_w(value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_garou(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2fffc0 && address <= 0x2fffc1) + { + int i1 = 1; + } + else + { + MWriteLong(address, value); + } + } + public static void MWriteByte_garouh(int address, sbyte value) + { + if (address >= 0x2fffc0 && address <= 0x2fffc1) + { + garouh_bankswitch_w(value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_garouh(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2fffc0 && address + 1 <= 0x2fffc1) + { + garouh_bankswitch_w(value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_garouh(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2fffc0 && address <= 0x2fffc1) + { + int i1 = 1; + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_mslug3(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + result = (sbyte)prot_9a37_r(); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_mslug3(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2fe446 && address + 1 <= 0x2fe447) + { + result = (short)prot_9a37_r(); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_mslug3(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_mslug3(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2fffe4 && address <= 0x2fffe5) + { + mslug3_bankswitch_w(value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_mslug3(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2fffe4 && address + 1 <= 0x2fffe5) + { + mslug3_bankswitch_w(value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_mslug3(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2fffe4 && address <= 0x2fffe5) + { + int i1 = 1; + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_kof2000(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + if (address == 0x2fe446) + { + result = (sbyte)(prot_9a37_r() >> 8); + } + else if (address == 0x2fe447) + { + result = (sbyte)prot_9a37_r(); + } + } + else if (address >= 0x2fffd8 && address <= 0x2fffd9) + { + result = (sbyte)sma_random_r(); + } + else if (address >= 0x2fffda && address <= 0x2fffdb) + { + result = (sbyte)sma_random_r(); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_kof2000(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2fe446 && address + 1 <= 0x2fe447) + { + result = (short)prot_9a37_r(); + } + else if (address >= 0x2fffd8 && address + 1 <= 0x2fffd9) + { + result = (short)sma_random_r(); + } + else if (address >= 0x2fffda && address + 1 <= 0x2fffdb) + { + result = (short)sma_random_r(); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_kof2000(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2fe446 && address <= 0x2fe447) + { + result = 0; + } + else if (address >= 0x2fffd8 && address <= 0x2fffd9) + { + result = 0; + } + else if (address >= 0x2fffda && address <= 0x2fffdb) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_kof2000(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2fffec && address <= 0x2fffed) + { + kof2000_bankswitch_w(value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_kof2000(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2fffec && address + 1 <= 0x2fffed) + { + kof2000_bankswitch_w(value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_kof2000(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2fffec && address <= 0x2fffed) + { + kof2000_bankswitch_w(value); + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_pvc(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2fe000 && address <= 0x2fffff) + { + result = (sbyte)pvc_cartridge_ram[address - 0x2fe000]; + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_pvc(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2fe000 && address + 1 <= 0x2fffff) + { + result = (short)(pvc_cartridge_ram[address - 0x2fe000] * 0x100 + pvc_cartridge_ram[address - 0x2fe000 + 1]); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_pvc(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2fe000 && address + 3 <= 0x2fffff) + { + result = pvc_cartridge_ram[address - 0x2fe000] * 0x1000000 + pvc_cartridge_ram[address - 0x2fe000 + 1] * 0x10000 + pvc_cartridge_ram[address - 0x2fe000 + 2] * 0x100 + pvc_cartridge_ram[address - 0x2fe000 + 3]; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_pvc(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address <= 0x2fffff) + { + pvc_cartridge_ram[address - 0x2fe000] = (byte)value; + int offset = (address - 0x2fe000) / 2; + if (offset == 0xff0) + pvc_prot1(); + else if (offset >= 0xff4 && offset <= 0xff5) + pvc_prot2(); + else if (offset >= 0xff8) + pvc_write_bankswitch(); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_pvc(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address + 1 <= 0x2fffff) + { + pvc_cartridge_ram[address - 0x2fe000] = (byte)(value >> 8); + pvc_cartridge_ram[address - 0x2fe000 + 1] = (byte)(value); + int offset = (address - 0x2fe000) / 2; + if (offset == 0xff0) + pvc_prot1(); + else if (offset >= 0xff4 && offset <= 0xff5) + pvc_prot2(); + else if (offset >= 0xff8) + pvc_write_bankswitch(); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_pvc(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address + 3 <= 0x2fffff) + { + pvc_cartridge_ram[address - 0x2fe000] = (byte)(value >> 24); + pvc_cartridge_ram[address - 0x2fe000 + 1] = (byte)(value >> 16); + pvc_cartridge_ram[address - 0x2fe000 + 2] = (byte)(value >> 8); + pvc_cartridge_ram[address - 0x2fe000 + 3] = (byte)(value); + int offset = (address - 0x2fe000) / 2; + if (offset == 0xff0) + pvc_prot1(); + else if (offset >= 0xff4 && offset <= 0xff5) + pvc_prot2(); + else if (offset >= 0xff8) + pvc_write_bankswitch(); + + if (offset + 1 == 0xff0) + pvc_prot1(); + else if (offset + 1 >= 0xff4 && offset + 1 <= 0xff5) + pvc_prot2(); + else if (offset + 1 >= 0xff8) + pvc_write_bankswitch(); + } + else + { + MWriteLong(address, value); + } + } + public static void MWriteByte_cthd2003(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address <= 0x2ffff1) + { + cthd2003_bankswitch_w(value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_cthd2003(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address + 1 <= 0x2ffff1) + { + cthd2003_bankswitch_w(value); + } + else + { + MWriteWord(address, value); + } + } + public static sbyte MReadByte_ms5plus(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2ffff0 && address <= 0x2fffff) + { + result = (sbyte)mslug5_prot_r(); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_ms5plus(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2ffff0 && address + 1 <= 0x2fffff) + { + result = (short)mslug5_prot_r(); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_ms5plus(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2ffff0 && address + 3 <= 0x2fffff) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_ms5plus(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address <= 0x2fffff) + { + int offset = (address - 0x2ffff0) / 2; + ms5plus_bankswitch_w(offset, value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_ms5plus(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address + 1 <= 0x2fffff) + { + int offset = (address - 0x2ffff0) / 2; + ms5plus_bankswitch_w(offset, value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_ms5plus(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2ffff0 && address + 3 <= 0x2fffff) + { + int i1 = 1; + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_kog(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x0ffffe && address <= 0x0fffff) + { + if (address == 0x0ffffe) + { + result = unchecked((sbyte)0xff); + } + else + { + result = 0x01; + } + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_kog(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x0ffffe && address + 1 <= 0x0fffff) + { + result = unchecked((short)0xff01); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_kog(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x0ffffe && address <= 0x0fffff) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static sbyte MReadByte_kf2k3bl(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2fe000 && address <= 0x2fffff) + { + int offset = address - 0x2fe000; + result = (sbyte)(extra_ram[offset]); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_kf2k3bl(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2fe000 && address + 1 <= 0x2fffff) + { + int offset = address - 0x2fe000; + result = (short)(extra_ram[offset] * 0x100 + extra_ram[offset + 1]); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_kf2k3bl(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2fe000 && address + 3 <= 0x2fffff) + { + int offset = address - 0x2fe000; + result = extra_ram[offset] * 0x1000000 + extra_ram[offset + 1] * 0x10000 + extra_ram[offset + 2] * 0x100 + extra_ram[offset + 3]; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_kf2k3bl(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address <= 0x2fffff) + { + int offset = address - 0x2fe000; + extra_ram[offset] = (byte)value; + kof2003_w(offset / 2); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_kf2k3bl(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address + 1 <= 0x2fffff) + { + int offset = address - 0x2fe000; + extra_ram[offset] = (byte)(value >> 8); + extra_ram[offset + 1] = (byte)value; + kof2003_w(offset / 2); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_kf2k3bl(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address + 3 <= 0x2fffff) + { + int offset = address - 0x2fe000; + extra_ram[offset] = (byte)(value >> 24); + extra_ram[offset + 1] = (byte)(value >> 16); + extra_ram[offset + 2] = (byte)(value >> 8); + extra_ram[offset + 3] = (byte)value; + kof2003_w(offset / 2); + kof2003_w((offset + 2) / 2); + } + else + { + MWriteLong(address, value); + } + } + public static void MWriteByte_kf2k3pl(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address <= 0x2fffff) + { + int offset = address - 0x2fe000; + extra_ram[offset] = (byte)value; + kof2003p_w(offset / 2); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_kf2k3pl(int address, short value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address + 1 <= 0x2fffff) + { + int offset = address - 0x2fe000; + extra_ram[offset] = (byte)(value >> 8); + extra_ram[offset + 1] = (byte)value; + kof2003p_w(offset / 2); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_kf2k3pl(int address, int value) + { + address &= 0xffffff; + if (address >= 0x2fe000 && address + 3 <= 0x2fffff) + { + int offset = address - 0x2fe000; + extra_ram[offset] = (byte)(value >> 24); + extra_ram[offset + 1] = (byte)(value >> 16); + extra_ram[offset + 2] = (byte)(value >> 8); + extra_ram[offset + 3] = (byte)value; + kof2003p_w(offset / 2); + kof2003p_w((offset + 2) / 2); + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_sbp(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x00200 && address <= 0x001fff) + { + int offset = address - 0x200; + result = (sbyte)sbp_protection_r(offset); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_sbp(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x00200 && address + 1 <= 0x001fff) + { + int offset = address - 0x200; + result = (short)(sbp_protection_r(offset) * 0x100 + sbp_protection_r(offset + 1)); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_sbp(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x00200 && address + 3 <= 0x001fff) + { + int offset = address - 0x200; + result = sbp_protection_r(offset) * 0x1000000 + sbp_protection_r(offset + 1) * 0x10000 + sbp_protection_r(offset + 2) * 0x100 + sbp_protection_r(offset + 3); + } + else + { + result = MReadLong(address); + } + return result; + } + public static sbyte MReadByte_kof10th(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x2fe000 && address <= 0x2fffff) + { + int offset = address - 0x2fe000; + result = (sbyte)extra_ram[offset]; + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_kof10th(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x2fe000 && address + 1 <= 0x2fffff) + { + int offset = address - 0x2fe000; + result = (short)(extra_ram[offset] * 0x100 + extra_ram[offset + 1]); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_kof10th(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x2fe000 && address + 3 <= 0x2fffff) + { + int offset = address - 0x2fe000; + result = extra_ram[offset] * 0x1000000 + extra_ram[offset + 1] * 0x10000 + extra_ram[offset + 2] * 0x100 + extra_ram[offset + 3]; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_sbp(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x200 && address <= 0x1fff) + { + int offset = (address - 0x200) / 2; + sbp_protection_w(offset, value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_sbp(int address, short value) + { + address &= 0xffffff; + if (address >= 0x200 && address + 1 <= 0x1fff) + { + int offset = (address - 0x200) / 2; + sbp_protection_w(offset, value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_sbp(int address, int value) + { + address &= 0xffffff; + if (address >= 0x200 && address + 3 <= 0x1fff) + { + int offset = (address - 0x200) / 2; + sbp_protection_w(offset, (ushort)(value >> 16)); + sbp_protection_w(offset + 1, (byte)value); + } + else + { + MWriteLong(address, value); + } + } + public static void MWriteByte_kof10th(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x200000 && address <= 0x23ffff) + { + int offset = address - 0x200000; + kof10th_custom_w(offset, (byte)value); + } + else if (address >= 0x240000 && address <= 0x2fffff) + { + int offset = address - 0x240000; + kof10th_bankswitch_w(offset, (byte)value); + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_kof10th(int address, short value) + { + address &= 0xffffff; + if (address >= 0x200000 && address + 1 <= 0x23ffff) + { + int offset = address - 0x200000; + kof10th_custom_w(offset, (ushort)value); + } + else if (address >= 0x240000 && address + 1 <= 0x2fffff) + { + int offset = address - 0x240000; + kof10th_bankswitch_w(offset, (ushort)value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_kof10th(int address, int value) + { + address &= 0xffffff; + if (address >= 0x200000 && address + 3 <= 0x23ffff) + { + int i1 = 1; + } + else if (address >= 0x240000 && address + 3 <= 0x2fffff) + { + int offset = address - 0x240000; + kof10th_bankswitch_w(offset, (ushort)(value >> 16)); + kof10th_bankswitch_w(offset + 2, (ushort)value); + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_jockeygp(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x200000 && address <= 0x201fff) + { + int offset = address - 0x200000; + result = (sbyte)extra_ram[offset]; + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_jockeygp(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x200000 && address + 1 <= 0x201fff) + { + int offset = address - 0x200000; + result = (short)(extra_ram[offset] * 0x100 + extra_ram[offset + 1]); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_jockeygp(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x200000 && address + 3 <= 0x201fff) + { + int offset = address - 0x200000; + result = extra_ram[offset] * 0x1000000 + extra_ram[offset + 1] * 0x10000 + extra_ram[offset + 2] * 0x100 + extra_ram[offset + 3]; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_jockeygp(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x200000 && address <= 0x201fff) + { + int offset = address - 0x200000; + extra_ram[offset] = (byte)value; + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_jockeygp(int address, short value) + { + address &= 0xffffff; + if (address >= 0x200000 && address + 1 <= 0x201fff) + { + int offset = address - 0x200000; + extra_ram[offset] = (byte)(value >> 8); + extra_ram[offset + 1] = (byte)(value); + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_jockeygp(int address, int value) + { + address &= 0xffffff; + if (address >= 0x200000 && address + 3 <= 0x201fff) + { + int offset = address - 0x200000; + extra_ram[offset] = (byte)(value >> 24); + extra_ram[offset + 1] = (byte)(value >> 16); + extra_ram[offset + 2] = (byte)(value >> 8); + extra_ram[offset + 3] = (byte)(value); + } + else + { + MWriteLong(address, value); + } + } + public static sbyte MReadByte_vliner(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0x200000 && address <= 0x201fff) + { + int offset = address - 0x200000; + result = (sbyte)extra_ram[offset]; + } + else if (address >= 0x280000 && address <= 0x280001) + { + if (address == 0x280000) + { + result = (sbyte)(short5 >> 8); + } + else + { + result = (sbyte)(short5); + } + } + else if (address >= 0x2c0000 && address <= 0x2c0001) + { + if (address == 0x2c0000) + { + result = (sbyte)(short6 >> 8); + } + else + { + result = (sbyte)(short6); + } + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_vliner(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0x200000 && address + 1 <= 0x201fff) + { + int offset = address - 0x200000; + result = (short)(extra_ram[offset] * 0x100 + extra_ram[offset + 1]); + } + else if (address >= 0x280000 && address + 1 <= 0x280001) + { + result = short5; + } + else if (address >= 0x2c0000 && address + 1 <= 0x2c0001) + { + result = short6; + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_vliner(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0x200000 && address + 3 <= 0x201fff) + { + int offset = address - 0x200000; + result = extra_ram[offset] * 0x1000000 + extra_ram[offset + 1] * 0x10000 + extra_ram[offset + 2] * 0x100 + extra_ram[offset + 3]; + } + else if (address >= 0x280000 && address <= 0x280001) + { + result = 0; + } + else if (address >= 0x2c0000 && address <= 0x2c0001) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static sbyte MReadByte_(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0 && address <= 0) + { + result = 0; + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MReadWord_(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0 && address <= 0) + { + result = 0; + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MReadLong_(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0 && address <= 0) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MWriteByte_(int address, sbyte value) + { + if (address >= 0 && address <= 0) + { + + } + else + { + MWriteByte(address, value); + } + } + public static void MWriteWord_(int address, short value) + { + if (address >= 0 && address <= 0) + { + + } + else + { + MWriteWord(address, value); + } + } + public static void MWriteLong_(int address, int value) + { + if (address >= 0 && address <= 0) + { + + } + else + { + MWriteLong(address, value); + } + } + public static byte ZReadOp(ushort address) + { + byte result = 0; + if (address >= 0x0000 && address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + result = Memory.audiorom[audio_cpu_banks[3] * 0x4000 + address - 0x8000]; + } + else if (address >= 0xc000 && address <= 0xdfff) + { + result = Memory.audiorom[audio_cpu_banks[2] * 0x2000 + address - 0xc000]; + } + else if (address >= 0xe000 && address <= 0xefff) + { + result = Memory.audiorom[audio_cpu_banks[1] * 0x1000 + address - 0xe000]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + result = Memory.audiorom[audio_cpu_banks[0] * 0x800 + address - 0xf000]; + } + else if (address >= 0xf800 && address <= 0xffff) + { + result = Memory.audioram[address - 0xf800]; + } + return result; + } + public static byte ZReadMemory(ushort address) + { + byte result = 0; + if (address >= 0x0000 && address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + result = Memory.audiorom[audio_cpu_banks[3] * 0x4000 + address - 0x8000]; + } + else if (address >= 0xc000 && address <= 0xdfff) + { + result = Memory.audiorom[audio_cpu_banks[2] * 0x2000 + address - 0xc000]; + } + else if (address >= 0xe000 && address <= 0xefff) + { + result = Memory.audiorom[audio_cpu_banks[1] * 0x1000 + address - 0xe000]; + } + else if (address >= 0xf000 && address <= 0xf7ff) + { + result = Memory.audiorom[audio_cpu_banks[0] * 0x800 + address - 0xf000]; + } + else if (address >= 0xf800 && address <= 0xffff) + { + result = Memory.audioram[address - 0xf800]; + } + return result; + } + public static void ZWriteMemory(ushort address, byte value) + { + if (address >= 0xf800 && address <= 0xffff) + { + Memory.audioram[address - 0xf800] = value; + } + else + { + int i1 = 1; + } + } + public static byte ZReadHardware(ushort address) + { + byte result = 0; + int add1, add2; + address &= 0xffff; + add1 = address & 0xff; + if (add1 == 0) + { + result = audio_command_r(); + } + else if (add1 >= 0x04 && add1 <= 0x07) + { + result = YM2610.F2610.ym2610_read(add1 - 0x04); + } + else if (add1 >= 0x08 && add1 <= 0xfb) + { + add2 = add1 & 0x0f; + if (add2 >= 0x08 && add2 <= 0x0b) + { + audio_cpu_banks[add2 - 0x08] = (byte)(address >> 8); + } + else + { + int i1 = 1; + } + result = 0; + } + else + { + int i1 = 1; + } + return result; + } + public static void ZWriteHardware(ushort address, byte value) + { + int add1; + add1 = address & 0xff; + if (add1 == 0x00) + { + Sound.soundlatch_w(0); + } + else if (add1 >= 0x04 && add1 <= 0x07) + { + YM2610.F2610.ym2610_write(add1 - 0x04, value); + } + else if (add1 == 0x08) + { + audio_cpu_enable_nmi_w(0); + } + else if (add1 == 0x0c) + { + audio_result_w(value); + } + else if (add1 == 0x18) + { + audio_cpu_enable_nmi_w(0x10); + } + else + { + int i1 = 1; + } + } + public static int ZIRQCallback() + { + return 0; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs.meta new file mode 100644 index 00000000..d63f4cda --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20950b586563f774bb89e076c35f0348 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neogeo.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neogeo.cs new file mode 100644 index 00000000..a68c0eeb --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neogeo.cs @@ -0,0 +1,408 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Neogeo + { + private static int NEOGEO_HBEND = 0x01e;//30 /* this should really be 29.5 */ + private static int NEOGEO_HBSTART = 0x15e;//350 /* this should really be 349.5 */ + private static int NEOGEO_VTOTAL = 0x108;//264 + private static int NEOGEO_VBEND = 0x010; + private static int NEOGEO_VBSTART = 0x0f0;//240 + private static int NEOGEO_VBLANK_RELOAD_HPOS = 0x11f;//287 + private static byte display_position_interrupt_control; + private static uint display_counter; + private static int vblank_interrupt_pending; + private static int display_position_interrupt_pending; + private static int irq3_pending; + public static byte dsw; + public static EmuTimer.emu_timer display_position_interrupt_timer; + public static EmuTimer.emu_timer display_position_vblank_timer; + public static EmuTimer.emu_timer vblank_interrupt_timer; + private static byte controller_select; + public static int main_cpu_bank_address; + public static byte main_cpu_vector_table_source; + //public static byte audio_result; + public static byte[] audio_cpu_banks; + public static byte[] mainbiosrom, /*mainram2,*/ audiobiosrom, fixedrom, fixedbiosrom, zoomyrom, /*spritesrom,*/ pvc_cartridge_ram; + public static byte[] extra_ram = new byte[0x2000]; + public static uint fatfury2_prot_data; + public static ushort neogeo_rng; + private static byte save_ram_unlocked; + public static bool audio_cpu_nmi_enabled, audio_cpu_nmi_pending; + + + #region //指针化 mainram2 + static byte[] mainram2_src; + static GCHandle mainram2_handle; + public static byte* mainram2; + public static int mainram2Length; + public static bool mainram2_IsNull => mainram2 == null; + public static byte[] mainram2_set + { + set + { + mainram2_handle.ReleaseGCHandle(); + mainram2_src = value; + mainram2Length = value.Length; + mainram2_src.GetObjectPtr(ref mainram2_handle, ref mainram2); + } + } + #endregion + + #region //指针化 spritesrom + static byte[] spritesrom_src; + static GCHandle spritesrom_handle; + public static byte* spritesrom; + public static int spritesromLength; + public static bool spritesrom_IsNull => spritesrom == null; + public static byte[] spritesrom_set + { + set + { + spritesrom_handle.ReleaseGCHandle(); + if (value == null) + return; + spritesrom_src = value; + spritesromLength = value.Length; + spritesrom_src.GetObjectPtr(ref spritesrom_handle, ref spritesrom); + } + } + #endregion + + public static void NeogeoInit() + { + audio_cpu_banks = new byte[4]; + pvc_cartridge_ram = new byte[0x2000]; + Memory.Set_mainram(new byte[0x10000]); + mainram2_set = new byte[0x10000]; + Memory.Set_audioram(new byte[0x800]); + Machine.bRom = true; + dsw = 0xff; + fixedbiosrom = MameMainMotion.resource.sfix; + zoomyrom = MameMainMotion.resource._000_lo; + audiobiosrom = MameMainMotion.resource.sm1; + mainbiosrom = MameMainMotion.resource.mainbios; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + fixedrom = Machine.GetRom("fixed.rom"); + FM.ymsndrom = Machine.GetRom("ymsnd.rom"); + YMDeltat.ymsnddeltatrom = Machine.GetRom("ymsnddeltat.rom"); + spritesrom_set = Machine.GetRom("sprites.rom"); + if (fixedbiosrom == null || zoomyrom == null || audiobiosrom == null || mainbiosrom == null || Memory.mainrom_IsNull || Memory.audiorom_IsNull || fixedrom == null || FM.ymsndrom == null || spritesrom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + switch (Machine.sName) + { + case "irrmaze": + case "kizuna4p": + mainbiosrom = Machine.GetRom("mainbios.rom"); + break; + case "kof99": + case "kof99h": + case "kof99e": + case "kof99k": + case "garou": + case "garouh": + case "mslug3": + case "mslug3h": + case "mslug4": + case "mslug4h": + case "ms4plus": + case "ganryu": + case "s1945p": + case "preisle2": + case "bangbead": + case "nitd": + case "zupapa": + case "sengoku3": + case "rotd": + case "rotdh": + case "pnyaa": + case "mslug5": + case "mslug5h": + case "ms5plus": + case "samsho5": + case "samsho5h": + case "samsho5b": + case "samsh5sp": + case "samsh5sph": + case "samsh5spho": + case "jockeygp": + case "jockeygpa": + neogeo_fixed_layer_bank_type = 1; + break; + case "kof2000": + case "kof2000n": + case "matrim": + case "matrimbl": + case "svc": + case "kof2003": + case "kof2003h": + neogeo_fixed_layer_bank_type = 2; + break; + default: + neogeo_fixed_layer_bank_type = 0; + break; + } + } + } + private static void adjust_display_position_interrupt_timer() + { + if ((display_counter + 1) != 0) + { + Atime period = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / 6000000), display_counter + 1); + EmuTimer.timer_adjust_periodic(display_position_interrupt_timer, period, Attotime.ATTOTIME_NEVER); + } + } + private static void update_interrupts() + { + int level = 0; + if (vblank_interrupt_pending != 0) + { + level = 1; + } + if (display_position_interrupt_pending != 0) + { + level = 2; + } + if (irq3_pending != 0) + { + level = 3; + } + if (level == 1) + { + Cpuint.cpunum_set_input_line(0, 1, LineState.ASSERT_LINE); + } + else if (level == 2) + { + Cpuint.cpunum_set_input_line(0, 2, LineState.ASSERT_LINE); + } + else if (level == 3) + { + Cpuint.cpunum_set_input_line(0, 3, LineState.ASSERT_LINE); + } + else + { + Cpuint.cpunum_set_input_line(0, 7, LineState.CLEAR_LINE); + } + } + public static void display_position_interrupt_callback() + { + if ((display_position_interrupt_control & 0x10) != 0) + { + display_position_interrupt_pending = 1; + update_interrupts(); + } + if ((display_position_interrupt_control & 0x80) != 0) + { + adjust_display_position_interrupt_timer(); + } + } + public static void display_position_vblank_callback() + { + if ((display_position_interrupt_control & 0x40) != 0) + { + adjust_display_position_interrupt_timer(); + } + EmuTimer.timer_adjust_periodic(display_position_vblank_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), Attotime.ATTOTIME_NEVER); + } + public static void vblank_interrupt_callback() + { + calendar_clock(); + vblank_interrupt_pending = 1; + update_interrupts(); + EmuTimer.timer_adjust_periodic(vblank_interrupt_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, 0), Attotime.ATTOTIME_NEVER); + } + public static void audio_cpu_irq(int assert) + { + Cpuint.cpunum_set_input_line(1, 0, assert != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + private static void select_controller(byte data) + { + controller_select = data; + } + public static void io_control_w(int offset, byte data) + { + switch (offset) + { + case 0x00: select_controller(data); break; + // case 0x18: set_output_latch(data & 0x00ff); break; + // case 0x20: set_output_data(data & 0x00ff); break; + case 0x28: Pd4900a.pd4990a_control_16_w(data); break; + // case 0x30: break; // coin counters + // case 0x31: break; // coin counters + // case 0x32: break; // coin lockout + // case 0x33: break; // coui lockout + default: + break; + } + } + private static void calendar_init() + { + //DateTime time = DateTime.Now; + DateTime time = DateTime.Parse("1970-1-1"); + Pd4900a.pd4990a.seconds = ((time.Second / 10) << 4) + (time.Second % 10); + Pd4900a.pd4990a.minutes = ((time.Minute / 10) << 4) + (time.Minute % 10); + Pd4900a.pd4990a.hours = ((time.Hour / 10) << 4) + (time.Hour % 10); + Pd4900a.pd4990a.days = ((time.Day / 10) << 4) + (time.Day % 10); + Pd4900a.pd4990a.month = time.Month; + Pd4900a.pd4990a.year = ((((time.Year - 1900) % 100) / 10) << 4) + ((time.Year - 1900) % 10); + Pd4900a.pd4990a.weekday = (int)time.DayOfWeek; + } + public static void calendar_clock() + { + Pd4900a.pd4990a_addretrace(); + } + public static uint get_calendar_status() + { + uint i1 = (uint)((Pd4900a.outputbit << 1) | Pd4900a.testbit); + return i1; + } + public static void save_ram_w(int offset, byte data) + { + if (save_ram_unlocked != 0) + mainram2[offset] = data; + } + public static void audio_cpu_check_nmi() + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, (audio_cpu_nmi_enabled && audio_cpu_nmi_pending) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void audio_cpu_enable_nmi_w(int offset) + { + audio_cpu_nmi_enabled = (offset & 0x10) == 0; + audio_cpu_check_nmi(); + } + public static void audio_command_w(byte data) + { + Sound.soundlatch_w(data); + audio_cpu_nmi_pending = true; + audio_cpu_check_nmi(); + Cpuexec.cpu_boost_interleave(Attotime.ATTOTIME_ZERO, new Atime(0, (long)(50 * 1e12))); + } + public static byte audio_command_r() + { + byte ret = (byte)Sound.soundlatch_r(); + audio_cpu_nmi_pending = false; + audio_cpu_check_nmi(); + return ret; + } + public static void audio_result_w(byte data) + { + Sound.soundlatch2_w(data); + } + public static byte get_audio_result() + { + return (byte)Sound.soundlatch2_r(); + } + public static void main_cpu_bank_select_w(int data) + { + int bank_address; + int len = Memory.mainromLength; + if ((len <= 0x100000) && ((data & 0x07) != 0)) + { + int i1 = 1; + } + else + { + bank_address = ((data & 0x07) + 1) * 0x100000; + if (bank_address >= len) + { + bank_address = 0x100000; + } + main_cpu_bank_address = bank_address; + } + } + public static void system_control_w(int offset) + { + //if (ACCESSING_BITS_0_7) + { + byte bit = (byte)((offset >> 3) & 0x01); + switch (offset & 0x07) + { + default: + case 0x00: + neogeo_set_screen_dark(bit); + break; + case 0x01: + main_cpu_vector_table_source = bit; + break; + case 0x05: + fixed_layer_source = bit; + break; + case 0x06: + save_ram_unlocked = bit; + break; + case 0x07: + neogeo_set_palette_bank(bit); + break; + case 0x02: /* unknown - HC32 middle pin 1 */ + case 0x03: /* unknown - uPD4990 pin ? */ + case 0x04: /* unknown - HC32 middle pin 10 */ + break; + } + } + } + public static void watchdog_w() + { + Watchdog.watchdog_reset(); + } + public static void machine_start_neogeo() + { + if (Memory.mainromLength > 0x100000) + { + main_cpu_bank_address = 0x100000; + } + else + { + main_cpu_bank_address = 0x000000; + } + audio_cpu_banks[0] = 0x1e; + audio_cpu_banks[1] = 0x0e; + audio_cpu_banks[2] = 0x06; + audio_cpu_banks[3] = 0x02; + display_position_interrupt_timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Neogeo_display_position_interrupt_callback, false); + display_position_vblank_timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Neogeo_display_position_vblank_callback, false); + vblank_interrupt_timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Neogeo_vblank_interrupt_callback, false); + Pd4900a.pd4990a_init(); + calendar_init(); + irq3_pending = 1; + } + + public static void nvram_handler_load_neogeo() + { + if (File.Exists("nvram\\" + Machine.sName + ".nv")) + { + FileStream fs1 = new FileStream("nvram\\" + Machine.sName + ".nv", FileMode.Open); + int n = (int)fs1.Length; + fs1.Read(mainram2, 0, n); + fs1.Close(); + } + } + public static void nvram_handler_save_neogeo() + { + FileStream fs1 = new FileStream("nvram\\" + Machine.sName + ".nv", FileMode.Create); + fs1.Write(mainram2, 0, 0x2000); + fs1.Close(); + } + public static void machine_reset_neogeo() + { + int offs; + for (offs = 0; offs < 8; offs++) + system_control_w(offs); + audio_cpu_nmi_enabled = false; + audio_cpu_nmi_pending = false; + audio_cpu_check_nmi(); + EmuTimer.timer_adjust_periodic(vblank_interrupt_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(display_position_vblank_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), Attotime.ATTOTIME_NEVER); + update_interrupts(); + start_sprite_line_timer(); + start_auto_animation_timer(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neogeo.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neogeo.cs.meta new file mode 100644 index 00000000..277b8e2b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neogeo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 253bfa81e74b5a14a8a323948fe6a8a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neoprot.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neoprot.cs new file mode 100644 index 00000000..c0338a25 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neoprot.cs @@ -0,0 +1,457 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Neogeo + { + public static ushort fatfury2_protection_16_r(int offset) + { + ushort res = (ushort)(fatfury2_prot_data >> 24); + switch (offset) + { + case 0x55550 / 2: + case 0xffff0 / 2: + case 0x00000 / 2: + case 0xff000 / 2: + case 0x36000 / 2: + case 0x36008 / 2: + return res; + case 0x36004 / 2: + case 0x3600c / 2: + return (ushort)(((res & 0xf0) >> 4) | ((res & 0x0f) << 4)); + default: + return 0; + } + } + public static void fatfury2_protection_16_w(int offset) + { + switch (offset) + { + case 0x11112 / 2: + fatfury2_prot_data = 0xff000000; + break; + case 0x33332 / 2: + fatfury2_prot_data = 0x0000ffff; + break; + case 0x44442 / 2: + fatfury2_prot_data = 0x00ff0000; + break; + case 0x55552 / 2: + fatfury2_prot_data = 0xff00ff00; + break; + case 0x56782 / 2: + fatfury2_prot_data = 0xf05a3601; + break; + case 0x42812 / 2: + fatfury2_prot_data = 0x81422418; + break; + case 0x55550 / 2: + case 0xffff0 / 2: + case 0xff000 / 2: + case 0x36000 / 2: + case 0x36004 / 2: + case 0x36008 / 2: + case 0x3600c / 2: + fatfury2_prot_data <<= 8; + break; + default: + break; + } + } + public static void kof98_prot_w(int value) + { + switch (value) + { + case 0x0090: + 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; + break; + default: + break; + } + } + public static ushort prot_9a37_r() + { + return 0x9a37; + } + public static ushort sma_random_r() + { + ushort old = neogeo_rng; + ushort newbit = (ushort)(((neogeo_rng >> 2) ^ + (neogeo_rng >> 3) ^ + (neogeo_rng >> 5) ^ + (neogeo_rng >> 6) ^ + (neogeo_rng >> 7) ^ + (neogeo_rng >> 11) ^ + (neogeo_rng >> 12) ^ + (neogeo_rng >> 15)) & 1); + neogeo_rng = (ushort)((neogeo_rng << 1) | newbit); + return old; + } + public static void kof99_bankswitch_w(int data) + { + int bankaddress; + int[] bankoffset = new int[] + { + 0x000000, 0x100000, 0x200000, 0x300000, + 0x3cc000, 0x4cc000, 0x3f2000, 0x4f2000, + 0x407800, 0x507800, 0x40d000, 0x50d000, + 0x417800, 0x517800, 0x420800, 0x520800, + 0x424800, 0x524800, 0x429000, 0x529000, + 0x42e800, 0x52e800, 0x431800, 0x531800, + 0x54d000, 0x551000, 0x567000, 0x592800, + 0x588800, 0x581800, 0x599800, 0x594800, + 0x598000 + }; + data = + (((data >> 14) & 1) << 0) + + (((data >> 6) & 1) << 1) + + (((data >> 8) & 1) << 2) + + (((data >> 10) & 1) << 3) + + (((data >> 12) & 1) << 4) + + (((data >> 5) & 1) << 5); + bankaddress = 0x100000 + bankoffset[data]; + main_cpu_bank_address = bankaddress; + } + public static void garou_bankswitch_w(int data) + { + int bankaddress; + int[] bankoffset = new int[] + { + 0x000000, 0x100000, 0x200000, 0x300000, // 00 + 0x280000, 0x380000, 0x2d0000, 0x3d0000, // 04 + 0x2f0000, 0x3f0000, 0x400000, 0x500000, // 08 + 0x420000, 0x520000, 0x440000, 0x540000, // 12 + 0x498000, 0x598000, 0x4a0000, 0x5a0000, // 16 + 0x4a8000, 0x5a8000, 0x4b0000, 0x5b0000, // 20 + 0x4b8000, 0x5b8000, 0x4c0000, 0x5c0000, // 24 + 0x4c8000, 0x5c8000, 0x4d0000, 0x5d0000, // 28 + 0x458000, 0x558000, 0x460000, 0x560000, // 32 + 0x468000, 0x568000, 0x470000, 0x570000, // 36 + 0x478000, 0x578000, 0x480000, 0x580000, // 40 + 0x488000, 0x588000, 0x490000, 0x590000, // 44 + 0x5d0000, 0x5d8000, 0x5e0000, 0x5e8000, // 48 + 0x5f0000, 0x5f8000, 0x600000 + }; + data = + (((data >> 5) & 1) << 0) + + (((data >> 9) & 1) << 1) + + (((data >> 7) & 1) << 2) + + (((data >> 6) & 1) << 3) + + (((data >> 14) & 1) << 4) + + (((data >> 12) & 1) << 5); + bankaddress = 0x100000 + bankoffset[data]; + main_cpu_bank_address = bankaddress; + } + public static void garouh_bankswitch_w(int data) + { + int bankaddress; + int[] bankoffset = new int[] + { + 0x000000, 0x100000, 0x200000, 0x300000, // 00 + 0x280000, 0x380000, 0x2d0000, 0x3d0000, // 04 + 0x2c8000, 0x3c8000, 0x400000, 0x500000, // 08 + 0x420000, 0x520000, 0x440000, 0x540000, // 12 + 0x598000, 0x698000, 0x5a0000, 0x6a0000, // 16 + 0x5a8000, 0x6a8000, 0x5b0000, 0x6b0000, // 20 + 0x5b8000, 0x6b8000, 0x5c0000, 0x6c0000, // 24 + 0x5c8000, 0x6c8000, 0x5d0000, 0x6d0000, // 28 + 0x458000, 0x558000, 0x460000, 0x560000, // 32 + 0x468000, 0x568000, 0x470000, 0x570000, // 36 + 0x478000, 0x578000, 0x480000, 0x580000, // 40 + 0x488000, 0x588000, 0x490000, 0x590000, // 44 + 0x5d8000, 0x6d8000, 0x5e0000, 0x6e0000, // 48 + 0x5e8000, 0x6e8000, 0x6e8000, 0x000000, // 52 + 0x000000, 0x000000, 0x000000, 0x000000, // 56 + 0x000000, 0x000000, 0x000000, 0x000000 // 60 + }; + data = + (((data >> 4) & 1) << 0) + + (((data >> 8) & 1) << 1) + + (((data >> 14) & 1) << 2) + + (((data >> 2) & 1) << 3) + + (((data >> 11) & 1) << 4) + + (((data >> 13) & 1) << 5); + bankaddress = 0x100000 + bankoffset[data]; + main_cpu_bank_address = bankaddress; + } + public static void mslug3_bankswitch_w(int data) + { + int bankaddress; + int[] bankoffset = new int[] + { + 0x000000, 0x020000, 0x040000, 0x060000, // 00 + 0x070000, 0x090000, 0x0b0000, 0x0d0000, // 04 + 0x0e0000, 0x0f0000, 0x120000, 0x130000, // 08 + 0x140000, 0x150000, 0x180000, 0x190000, // 12 + 0x1a0000, 0x1b0000, 0x1e0000, 0x1f0000, // 16 + 0x200000, 0x210000, 0x240000, 0x250000, // 20 + 0x260000, 0x270000, 0x2a0000, 0x2b0000, // 24 + 0x2c0000, 0x2d0000, 0x300000, 0x310000, // 28 + 0x320000, 0x330000, 0x360000, 0x370000, // 32 + 0x380000, 0x390000, 0x3c0000, 0x3d0000, // 36 + 0x400000, 0x410000, 0x440000, 0x450000, // 40 + 0x460000, 0x470000, 0x4a0000, 0x4b0000, // 44 + 0x4c0000 + }; + data = + (((data >> 14) & 1) << 0) + + (((data >> 12) & 1) << 1) + + (((data >> 15) & 1) << 2) + + (((data >> 6) & 1) << 3) + + (((data >> 3) & 1) << 4) + + (((data >> 9) & 1) << 5); + bankaddress = 0x100000 + bankoffset[data]; + main_cpu_bank_address = bankaddress; + } + public static void kof2000_bankswitch_w(int data) + { + int bankaddress; + int[] bankoffset = new int[] + { + 0x000000, 0x100000, 0x200000, 0x300000, // 00 + 0x3f7800, 0x4f7800, 0x3ff800, 0x4ff800, // 04 + 0x407800, 0x507800, 0x40f800, 0x50f800, // 08 + 0x416800, 0x516800, 0x41d800, 0x51d800, // 12 + 0x424000, 0x524000, 0x523800, 0x623800, // 16 + 0x526000, 0x626000, 0x528000, 0x628000, // 20 + 0x52a000, 0x62a000, 0x52b800, 0x62b800, // 24 + 0x52d000, 0x62d000, 0x52e800, 0x62e800, // 28 + 0x618000, 0x619000, 0x61a000, 0x61a800, // 32 + }; + data = + (((data >> 15) & 1) << 0) + + (((data >> 14) & 1) << 1) + + (((data >> 7) & 1) << 2) + + (((data >> 3) & 1) << 3) + + (((data >> 10) & 1) << 4) + + (((data >> 5) & 1) << 5); + bankaddress = 0x100000 + bankoffset[data]; + main_cpu_bank_address = bankaddress; + } + public static void pvc_prot1() + { + byte b1, b2; + b1 = pvc_cartridge_ram[0x1fe0]; + b2 = pvc_cartridge_ram[0x1fe1]; + pvc_cartridge_ram[0x1fe2] = (byte)((((b2 >> 4) & 0xf) << 1) | ((b1 >> 5) & 1)); + pvc_cartridge_ram[0x1fe3] = (byte)((((b2 >> 0) & 0xf) << 1) | ((b1 >> 4) & 1)); + pvc_cartridge_ram[0x1fe4] = (byte)(b1 >> 7); + pvc_cartridge_ram[0x1fe5] = (byte)((((b1 >> 0) & 0xf) << 1) | ((b1 >> 6) & 1)); + } + public static void pvc_prot2() + { + byte b1, b2, b3, b4; + b1 = pvc_cartridge_ram[0x1fe8]; + b2 = pvc_cartridge_ram[0x1fe9]; + b3 = pvc_cartridge_ram[0x1fea]; + b4 = pvc_cartridge_ram[0x1feb]; + pvc_cartridge_ram[0x1fec] = (byte)((b4 >> 1) | ((b2 & 1) << 4) | ((b1 & 1) << 5) | ((b4 & 1) << 6) | ((b3 & 1) << 7)); + pvc_cartridge_ram[0x1fed] = (byte)((b2 >> 1) | ((b1 >> 1) << 4)); + } + public static void pvc_write_bankswitch() + { + int bankaddress; + bankaddress = pvc_cartridge_ram[0xff8 * 2] + pvc_cartridge_ram[0xff9 * 2] * 0x10000 + pvc_cartridge_ram[0xff9 * 2 + 1] * 0x100; + pvc_cartridge_ram[0x1ff0] &= 0xfe; + pvc_cartridge_ram[0x1ff1] = 0xa0; + pvc_cartridge_ram[0x1ff2] &= 0x7f; + main_cpu_bank_address = bankaddress + 0x100000; + } + public static void cthd2003_bankswitch_w(int data) + { + int bankaddress; + int[] cthd2003_banks = new int[8] + { + 1,0,1,0,1,0,3,2, + }; + bankaddress = 0x100000 + cthd2003_banks[data & 7] * 0x100000; + main_cpu_bank_address = bankaddress; + } + public static ushort mslug5_prot_r() + { + return 0xa0; + } + public static void ms5plus_bankswitch_w(int offset, int data) + { + int bankaddress; + if ((offset == 0) && (data == 0xa0)) + { + bankaddress = 0xa0; + main_cpu_bank_address = bankaddress; + } + else if (offset == 2) + { + data = data >> 4; + bankaddress = data * 0x100000; + main_cpu_bank_address = bankaddress; + } + } + public static void kof2003_w(int offset) + { + if (offset == 0x1ff0 / 2 || offset == 0x1ff2 / 2) + { + int address = (extra_ram[0x1ff2] << 16) | (extra_ram[0x1ff3] << 8) | extra_ram[0x1ff0]; + byte prt = extra_ram[0x1ff3]; + extra_ram[0x1ff0] &= 0xfe; + extra_ram[0x1ff1] = 0xa0; + extra_ram[0x1ff2] &= 0x7f; + main_cpu_bank_address = address + 0x100000; + Memory.mainrom[0x58197] = prt; + } + } + public static void kof2003p_w(int offset) + { + if (offset == 0x1ff0 / 2 || offset == 0x1ff2 / 2) + { + int address = (extra_ram[0x1ff2] << 16) | (extra_ram[0x1ff3] << 8) | extra_ram[0x1ff1]; + byte prt = extra_ram[0x1ff3]; + extra_ram[0x1ff1] &= 0xfe; + extra_ram[0x1ff2] &= 0x7f; + main_cpu_bank_address = address + 0x100000; + Memory.mainrom[0x58197] = prt; + } + } + public static byte sbp_protection_r(int offset) + { + 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) + return origdata; + return data; + } + public static void sbp_protection_w(int offset, int data) + { + int realoffset = 0x200 + (offset * 2); + if (realoffset == 0x1080) + { + if (data == 0x4e75) + { + return; + } + else if (data == 0xffff) + { + return; + } + } + } + public static void kof10th_custom_w(int offset, byte data) + { + if (extra_ram[0x1ffc] == 0 && extra_ram[0x1ffd] == 0) + { + Memory.mainrom[0xe0000 + offset] = (byte)data; + } + else + { + Neogeo.fixedbiosrom[offset / 2] = (byte)BITSWAP8(data, 7, 6, 0, 4, 3, 2, 1, 5); + } + } + public static void kof10th_custom_w(int offset, ushort data) + { + if (extra_ram[0x1ffc] == 0 && extra_ram[0x1ffd] == 0) + { + Memory.mainrom[0xe0000 + offset] = (byte)(data >> 8); + Memory.mainrom[0xe0000 + offset + 1] = (byte)data; + } + else + { + Neogeo.fixedbiosrom[offset / 2] = (byte)BITSWAP8(data, 7, 6, 0, 4, 3, 2, 1, 5); + } + } + public static void kof10th_bankswitch_w(int offset, byte data) + { + if (offset >= 0xbe000) + { + if (offset == 0xbfff0) + { + int bank = 0x100000 + ((data & 7) << 20); + if (bank >= 0x700000) + bank = 0x100000; + main_cpu_bank_address = bank; + } + else if (offset == 0xbfff8 && (extra_ram[0x1ff8] * 0x100 + extra_ram[0x1ff9] != data)) + { + //Array.Copy(Memory.mainrom, ((data & 1) != 0) ? 0x810000 : 0x710000, Memory.mainrom, 0x10000, 0xcffff); + + //TODO 验证拷贝可靠性 + byte* source = Memory.mainrom + ((data & 1) != 0 ? 0x810000 : 0x710000); + byte* destination = Memory.mainrom + 0x10000; + int length = 0xcffff; // 注意:这个长度是否正确取决于你的实际需求 + Buffer.MemoryCopy(source, destination, length, length); + } + extra_ram[(offset - 0xbe000) & 0x1fff] = (byte)data; + } + } + public static void kof10th_bankswitch_w(int offset, ushort data) + { + if (offset >= 0xbe000) + { + if (offset == 0xbfff0) + { + int bank = 0x100000 + ((data & 7) << 20); + if (bank >= 0x700000) + bank = 0x100000; + main_cpu_bank_address = bank; + } + else if (offset == 0xbfff8 && (extra_ram[0x1ff8] * 0x100 + extra_ram[0x1ff9] != data)) + { + //Array.Copy(Memory.mainrom, ((data & 1) != 0) ? 0x810000 : 0x710000, Memory.mainrom, 0x10000, 0xcffff); + + //TODO 验证拷贝可靠性 + byte* source = Memory.mainrom + ((data & 1) != 0 ? 0x810000 : 0x710000); + byte* destination = Memory.mainrom + 0x10000; + int length = 0xcffff; // 注意:这个长度是否正确取决于你的实际需求 + Buffer.MemoryCopy(source, destination, length, length); + + } + extra_ram[(offset - 0xbe000) & 0x1fff] = (byte)(data >> 8); + extra_ram[((offset - 0xbe000) & 0x1fff) + 1] = (byte)data; + } + } + public static int BIT(int x, int n) + { + return (x >> n) & 1; + } + public static int BITSWAP8(int val, int B7, int B6, int B5, int B4, int B3, int B2, int B1, int B0) + { + return ((BIT(val, B7) << 7) | + (BIT(val, B6) << 6) | + (BIT(val, B5) << 5) | + (BIT(val, B4) << 4) | + (BIT(val, B3) << 3) | + (BIT(val, B2) << 2) | + (BIT(val, B1) << 1) | + (BIT(val, B0) << 0)); + } + + //TODO 暂时注释 用不上 + //public static int BITSWAP16(int val, int B15, int B14, int B13, int B12, int B11, int B10, int B9, int B8, int B7, int B6, int B5, int B4, int B3, int B2, int B1, int B0) + //{ + // return ((BIT(val, B15) << 15) | + // (BIT(val, B14) << 14) | + // (BIT(val, B13) << 13) | + // (BIT(val, B12) << 12) | + // (BIT(val, B11) << 11) | + // (BIT(val, B10) << 10) | + // (BIT(val, B9) << 9) | + // (BIT(val, B8) << 8) | + // (BIT(val, B7) << 7) | + // (BIT(val, B6) << 6) | + // (BIT(val, B5) << 5) | + // (BIT(val, B4) << 4) | + // (BIT(val, B3) << 3) | + // (BIT(val, B2) << 2) | + // (BIT(val, B1) << 1) | + // (BIT(val, B0) << 0)); + //} + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neoprot.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neoprot.cs.meta new file mode 100644 index 00000000..4f3eb692 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Neoprot.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 465734b328b0cbf42975789f2addd52e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/State.cs new file mode 100644 index 00000000..0a432c1b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/State.cs @@ -0,0 +1,152 @@ +using cpu.m68000; +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Neogeo + { + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + writer.Write(dsw); + writer.Write(display_position_interrupt_control); + writer.Write(display_counter); + writer.Write(vblank_interrupt_pending); + writer.Write(display_position_interrupt_pending); + writer.Write(irq3_pending); + writer.Write(controller_select); + writer.Write(main_cpu_bank_address); + writer.Write(main_cpu_vector_table_source); + writer.Write(audio_cpu_banks, 0, 4); + writer.Write(save_ram_unlocked); + writer.Write(audio_cpu_nmi_enabled); + writer.Write(audio_cpu_nmi_pending); + writer.Write(mainram2, 0, 0x10000); + writer.Write(pvc_cartridge_ram, 0, 0x2000); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 0x1000; j++) + { + writer.Write(palettes[i, j]); + } + } + for (i = 0; i < 0x10000; i++) + { + writer.Write(neogeo_videoram[i]); + } + writer.Write(videoram_read_buffer); + writer.Write(videoram_modulo); + writer.Write(videoram_offset); + writer.Write(fixed_layer_source); + writer.Write(screen_dark); + writer.Write(palette_bank); + writer.Write(neogeo_scanline_param); + writer.Write(auto_animation_speed); + writer.Write(auto_animation_disabled); + writer.Write(auto_animation_counter); + writer.Write(auto_animation_frame_counter); + writer.Write(Memory.mainram, 0, 0x10000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.vblank_start_time.seconds); + writer.Write(Video.screenstate.vblank_start_time.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + YM2610.F2610.SaveStateBinary(writer); + for (i = 0; i < 2; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(Sound.ym2610stream.output_sampindex); + writer.Write(Sound.ym2610stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + Pd4900a.SaveStateBinary(writer); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + dsw = reader.ReadByte(); + display_position_interrupt_control = reader.ReadByte(); + display_counter = reader.ReadUInt32(); + vblank_interrupt_pending = reader.ReadInt32(); + display_position_interrupt_pending = reader.ReadInt32(); + irq3_pending = reader.ReadInt32(); + controller_select = reader.ReadByte(); + main_cpu_bank_address = reader.ReadInt32(); + main_cpu_vector_table_source = reader.ReadByte(); + audio_cpu_banks = reader.ReadBytes(4); + save_ram_unlocked = reader.ReadByte(); + audio_cpu_nmi_enabled = reader.ReadBoolean(); + audio_cpu_nmi_pending = reader.ReadBoolean(); + mainram2_set = reader.ReadBytes(0x10000); + pvc_cartridge_ram = reader.ReadBytes(0x2000); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 0x1000; j++) + { + palettes[i, j] = reader.ReadUInt16(); + } + } + for (i = 0; i < 0x10000; i++) + { + neogeo_videoram[i] = reader.ReadUInt16(); + } + videoram_read_buffer = reader.ReadUInt16(); + videoram_modulo = reader.ReadUInt16(); + videoram_offset = reader.ReadUInt16(); + fixed_layer_source = reader.ReadByte(); + screen_dark = reader.ReadByte(); + palette_bank = reader.ReadByte(); + neogeo_scanline_param = reader.ReadInt32(); + auto_animation_speed = reader.ReadByte(); + auto_animation_disabled = reader.ReadByte(); + auto_animation_counter = reader.ReadInt32(); + auto_animation_frame_counter = reader.ReadInt32(); + Memory.Set_mainram(reader.ReadBytes(0x10000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); + Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + YM2610.F2610.LoadStateBinary(reader); + for (i = 0; i < 2; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + Sound.ym2610stream.output_sampindex = reader.ReadInt32(); + Sound.ym2610stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + Pd4900a.LoadStateBinary(reader); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/State.cs.meta new file mode 100644 index 00000000..4f020901 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6d08b740207f1f4dbb54267570ac7f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs new file mode 100644 index 00000000..aee7fa0e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs @@ -0,0 +1,979 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Neogeo + { + public static byte[] sprite_gfx; + public static uint sprite_gfx_address_mask; + public static ushort[] neogeo_videoram; + public static ushort[,] palettes; + public static int[] pens; + private static int neogeo_scanline_param; + private static byte palette_bank; + private static byte screen_dark; + private static ushort videoram_read_buffer; + private static ushort videoram_modulo; + private static ushort videoram_offset; + public static byte fixed_layer_source; + public static int neogeo_fixed_layer_bank_type; + private static byte auto_animation_speed; + public static byte auto_animation_disabled; + public static int auto_animation_counter; + private static int auto_animation_frame_counter; + public static EmuTimer.emu_timer auto_animation_timer, sprite_line_timer; + private static double[] rgb_weights_normal; + private static double[] rgb_weights_normal_bit15; + private static double[] rgb_weights_dark; + private static double[] rgb_weights_dark_bit15; + public static int[,] zoom_x_tables; + private static int[] transarray, bgarray; + private static int trans_color; + private static byte combine_5_weights(double[] tab, int w0, int w1, int w2, int w3, int w4) + { + return (byte)(tab[0] * w0 + tab[1] * w1 + tab[2] * w2 + tab[3] * w3 + tab[4] * w4 + 0.5); + } + private static int get_pen(ushort data) + { + double[] weights; + byte r, g, b; + if (screen_dark != 0) + { + if ((data & 0x8000) != 0) + weights = rgb_weights_dark_bit15; + else + weights = rgb_weights_dark; + } + else + { + if ((data & 0x8000) != 0) + weights = rgb_weights_normal_bit15; + else + weights = rgb_weights_normal; + } + r = combine_5_weights(weights, + (data >> 11) & 0x01, + (data >> 10) & 0x01, + (data >> 9) & 0x01, + (data >> 8) & 0x01, + (data >> 14) & 0x01); + g = combine_5_weights(weights, + (data >> 7) & 0x01, + (data >> 6) & 0x01, + (data >> 5) & 0x01, + (data >> 4) & 0x01, + (data >> 13) & 0x01); + b = combine_5_weights(weights, + (data >> 3) & 0x01, + (data >> 2) & 0x01, + (data >> 1) & 0x01, + (data >> 0) & 0x01, + (data >> 12) & 0x01); + //return (r << 16) | (g << 8) | b; + + //通道修改,BGRA->RGBA + return (b << 16) | (g << 8) | r; + } + public static void regenerate_pens() + { + int i; + for (i = 0; i < 0x1000; i++) + { + pens[i] = get_pen(palettes[palette_bank, i]); + } + for (i = 0; i < 384 * 264; i++) + { + bgarray[i] = pens[0xfff]; + } + } + private static void neogeo_set_palette_bank(byte data) + { + if (data != palette_bank) + { + palette_bank = data; + regenerate_pens(); + } + } + private static void neogeo_set_screen_dark(byte data) + { + if (data != screen_dark) + { + screen_dark = data; + regenerate_pens(); + } + } + private static void neogeo_paletteram_w(int offset, ushort data) + { + int i; + palettes[palette_bank, offset] = data; + pens[offset] = get_pen(data); + if (offset == 0xfff) + { + for (i = 0; i < 384 * 264; i++) + { + bgarray[i] = pens[0xfff]; + } + } + } + public static void auto_animation_timer_callback() + { + if (auto_animation_frame_counter == 0) + { + auto_animation_frame_counter = auto_animation_speed; + auto_animation_counter = auto_animation_counter + 1; + } + else + { + auto_animation_frame_counter = auto_animation_frame_counter - 1; + } + EmuTimer.timer_adjust_periodic(auto_animation_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + } + private static void create_auto_animation_timer() + { + auto_animation_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Neogeo_auto_animation_timer_callback, false); + } + private static void start_auto_animation_timer() + { + EmuTimer.timer_adjust_periodic(auto_animation_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + } + private static int rows_to_height(int rows) + { + if ((rows == 0) || (rows > 0x20)) + rows = 0x20; + return rows * 0x10; + } + public static bool sprite_on_scanline(int scanline, int y, int rows) + { + int max_y = (y + rows_to_height(rows) - 1) & 0x1ff; + return (((max_y >= y) && (scanline >= y) && (scanline <= max_y)) || + ((max_y < y) && ((scanline >= y) || (scanline <= max_y)))); + } + + //private static void draw_sprites(int iBitmap, int scanline) + //{ + // int x_2, code_2; + // int x, y, rows, zoom_x, zoom_y, sprite_list_offset, sprite_index, max_sprite_index, sprite_number, sprite_y, tile, attr_and_code_offs, code, zoom_x_table_offset, gfx_offset, line_pens_offset, x_inc, sprite_line, zoom_line; + // ushort y_control, zoom_control, attr; + // byte sprite_y_and_tile; + // bool invert; + // y = 0; + // x = 0; + // rows = 0; + // zoom_y = 0; + // zoom_x = 0; + // if ((scanline & 0x01) != 0) + // { + // sprite_list_offset = 0x8680; + // } + // else + // { + // sprite_list_offset = 0x8600; + // } + // Span span_neogeo_videoram = neogeo_videoram.AsSpan(); + // Span span_bitmapbaseN_iBitmap = Video.bitmapbaseN_Ptrs[iBitmap].AsSpan(); + // Span span_sprite_gfx = sprite_gfx.AsSpan(); + // Span span_pens = pens.AsSpan(); + // for (max_sprite_index = 95; max_sprite_index >= 0; max_sprite_index--) + // { + // if (span_neogeo_videoram[sprite_list_offset + max_sprite_index] != 0) + // { + // break; + // } + // } + // if (max_sprite_index != 95) + // { + // max_sprite_index = max_sprite_index + 1; + // } + // for (sprite_index = 0; sprite_index < max_sprite_index; sprite_index++) + // { + // sprite_number = span_neogeo_videoram[sprite_list_offset + sprite_index] & 0x1ff; + // y_control = span_neogeo_videoram[0x8200 | sprite_number]; + // zoom_control = span_neogeo_videoram[0x8000 | sprite_number]; + // x_2 = span_neogeo_videoram[0x8400 | sprite_number]; + // code_2 = span_neogeo_videoram[sprite_number << 6]; + // if ((y_control & 0x40) != 0) + // { + // x = (x + zoom_x + 1) & 0x01ff; + // zoom_x = (zoom_control >> 8) & 0x0f; + // } + // else + // { + // y = 0x200 - (y_control >> 7); + // x = span_neogeo_videoram[0x8400 | sprite_number] >> 7; + // zoom_y = zoom_control & 0xff; + // zoom_x = (zoom_control >> 8) & 0x0f; + // rows = y_control & 0x3f; + // } + // if ((x >= 0x140) && (x <= 0x1f0)) + // { + // continue; + // } + // if (sprite_on_scanline(scanline, y, rows)) + // { + // sprite_line = (scanline - y) & 0x1ff; + // zoom_line = sprite_line & 0xff; + // invert = ((sprite_line & 0x100) != 0) ? true : false; + // if (invert) + // { + // zoom_line ^= 0xff; + // } + // if (rows > 0x20) + // { + // zoom_line = zoom_line % ((zoom_y + 1) << 1); + // if (zoom_line > zoom_y) + // { + // zoom_line = ((zoom_y + 1) << 1) - 1 - zoom_line; + // invert = !invert; + // } + // } + // sprite_y_and_tile = zoomyrom[(zoom_y << 8) | zoom_line]; + // sprite_y = sprite_y_and_tile & 0x0f; + // tile = sprite_y_and_tile >> 4; + // if (invert) + // { + // sprite_y ^= 0x0f; + // tile ^= 0x1f; + // } + // attr_and_code_offs = (sprite_number << 6) | (tile << 1); + // attr = span_neogeo_videoram[attr_and_code_offs + 1]; + // code = ((attr << 12) & 0x70000) | span_neogeo_videoram[attr_and_code_offs]; + // if (auto_animation_disabled == 0) + // { + // if ((attr & 0x0008) != 0) + // { + // code = (code & ~0x07) | (auto_animation_counter & 0x07); + // } + // else if ((attr & 0x0004) != 0) + // { + // code = (code & ~0x03) | (auto_animation_counter & 0x03); + // } + // } + // if ((attr & 0x0002) != 0) + // { + // sprite_y ^= 0x0f; + // } + // zoom_x_table_offset = 0; + // gfx_offset = (int)(((code << 8) | (sprite_y << 4)) & sprite_gfx_address_mask); + // line_pens_offset = attr >> 8 << 4; + // if ((attr & 0x0001) != 0) + // { + // gfx_offset = gfx_offset + 0x0f; + // x_inc = -1; + // } + // else + // { + // x_inc = 1; + // } + // int pixel_addr_offsetx, pixel_addr_offsety; + // if (x <= 0x01f0) + // { + // int i; + // pixel_addr_offsetx = x + NEOGEO_HBEND; + // pixel_addr_offsety = scanline; + // for (i = 0; i < 0x10; i++) + // { + // if (zoom_x_tables[zoom_x, zoom_x_table_offset] != 0) + // { + // //if (sprite_gfx[gfx_offset] != 0) + // if (span_sprite_gfx[gfx_offset] != 0) + // { + // //Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; + // span_bitmapbaseN_iBitmap[pixel_addr_offsety * 384 + pixel_addr_offsetx] = span_pens[line_pens_offset + span_sprite_gfx[gfx_offset]]; + // } + // pixel_addr_offsetx++; + // } + // zoom_x_table_offset++; + // gfx_offset += x_inc; + // } + // } + // else + // { + // int i; + // int x_save = x; + // pixel_addr_offsetx = NEOGEO_HBEND; + // pixel_addr_offsety = scanline; + // for (i = 0; i < 0x10; i++) + // { + // if (zoom_x_tables[zoom_x, zoom_x_table_offset] != 0) + // { + // if (x >= 0x200) + // { + // //if (sprite_gfx[gfx_offset] != 0) + // if (span_sprite_gfx[gfx_offset] != 0) + // { + // //Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; + // span_bitmapbaseN_iBitmap[pixel_addr_offsety * 384 + pixel_addr_offsetx] = span_pens[line_pens_offset + span_sprite_gfx[gfx_offset]]; + // } + // pixel_addr_offsetx++; + // } + // x++; + // } + // zoom_x_table_offset++; + // gfx_offset += x_inc; + // } + // x = x_save; + // } + // } + // } + //} + + /// + /// draw_sprites (Unsafa 尝试提升效率) + /// + /// + /// + unsafe private static void draw_sprites(int iBitmap, int scanline) + { + + fixed (ushort* videoramPtr = &neogeo_videoram[0]) + //fixed (int* bitmapbasePtr = &Video.bitmapbaseN_Ptrs[iBitmap][0]) + fixed (byte* spriteGfxPtr = &sprite_gfx[0]) + fixed (int* pensPtr = &pens[0]) + fixed (byte* zoomyromPtr = &zoomyrom[0]) + { + ushort* neogeo_videoram = videoramPtr; + //int* bitmapbase = bitmapbasePtr; + int* bitmapbase = &Video.bitmapbaseN_Ptrs[iBitmap][0]; + byte* spriteGfx = spriteGfxPtr; + int* pens = pensPtr; + byte* zoomyrom = zoomyromPtr; + + int x_2, code_2; + int x, y, rows, zoom_x, zoom_y, sprite_list_offset, sprite_index, max_sprite_index, sprite_number, sprite_y, tile, attr_and_code_offs, code, zoom_x_table_offset, gfx_offset, line_pens_offset, x_inc, sprite_line, zoom_line; + ushort y_control, zoom_control, attr; + byte sprite_y_and_tile; + bool invert; + y = 0; + x = 0; + rows = 0; + zoom_y = 0; + zoom_x = 0; + if ((scanline & 0x01) != 0) + { + sprite_list_offset = 0x8680; + } + else + { + sprite_list_offset = 0x8600; + } + for (max_sprite_index = 95; max_sprite_index >= 0; max_sprite_index--) + { + if (neogeo_videoram[sprite_list_offset + max_sprite_index] != 0) + { + break; + } + } + if (max_sprite_index != 95) + { + max_sprite_index = max_sprite_index + 1; + } + for (sprite_index = 0; sprite_index < max_sprite_index; sprite_index++) + { + sprite_number = neogeo_videoram[sprite_list_offset + sprite_index] & 0x1ff; + y_control = neogeo_videoram[0x8200 | sprite_number]; + zoom_control = neogeo_videoram[0x8000 | sprite_number]; + x_2 = neogeo_videoram[0x8400 | sprite_number]; + code_2 = neogeo_videoram[sprite_number << 6]; + + //sprite_number = (*(videoram + sprite_list_offset + sprite_index) & 0x1ff); + //y_control = (ushort)(*(videoram + 0x8200) | sprite_number); + //zoom_control = (ushort)(*(videoram + 0x8000) | sprite_number); + //x_2 = (ushort)(*(videoram + 0x8400) | sprite_number); + //code_2 = *(videoram + (sprite_number << 6)); + + if ((y_control & 0x40) != 0) + { + x = (x + zoom_x + 1) & 0x01ff; + zoom_x = (zoom_control >> 8) & 0x0f; + } + else + { + y = 0x200 - (y_control >> 7); + //x = neogeo_videoram[0x8400 | sprite_number] >> 7; + x = x_2 >> 7; + zoom_y = zoom_control & 0xff; + zoom_x = (zoom_control >> 8) & 0x0f; + rows = y_control & 0x3f; + } + + fixed (int* zoom_x_tablesPtr = &zoom_x_tables[zoom_x, 0]) + { + int* zoom_x_tables = zoom_x_tablesPtr; + + if ((x >= 0x140) && (x <= 0x1f0)) + { + continue; + } + if (sprite_on_scanline(scanline, y, rows)) + { + sprite_line = (scanline - y) & 0x1ff; + zoom_line = sprite_line & 0xff; + invert = ((sprite_line & 0x100) != 0) ? true : false; + if (invert) + { + zoom_line ^= 0xff; + } + if (rows > 0x20) + { + zoom_line = zoom_line % ((zoom_y + 1) << 1); + if (zoom_line > zoom_y) + { + zoom_line = ((zoom_y + 1) << 1) - 1 - zoom_line; + invert = !invert; + } + } + sprite_y_and_tile = zoomyrom[(zoom_y << 8) | zoom_line]; + sprite_y = sprite_y_and_tile & 0x0f; + tile = sprite_y_and_tile >> 4; + if (invert) + { + sprite_y ^= 0x0f; + tile ^= 0x1f; + } + attr_and_code_offs = (sprite_number << 6) | (tile << 1); + attr = neogeo_videoram[attr_and_code_offs + 1]; + code = ((attr << 12) & 0x70000) | neogeo_videoram[attr_and_code_offs]; + if (auto_animation_disabled == 0) + { + if ((attr & 0x0008) != 0) + { + code = (code & ~0x07) | (auto_animation_counter & 0x07); + } + else if ((attr & 0x0004) != 0) + { + code = (code & ~0x03) | (auto_animation_counter & 0x03); + } + } + if ((attr & 0x0002) != 0) + { + sprite_y ^= 0x0f; + } + zoom_x_table_offset = 0; + gfx_offset = (int)(((code << 8) | (sprite_y << 4)) & sprite_gfx_address_mask); + line_pens_offset = attr >> 8 << 4; + if ((attr & 0x0001) != 0) + { + gfx_offset = gfx_offset + 0x0f; + x_inc = -1; + } + else + { + x_inc = 1; + } + int pixel_addr_offsetx, pixel_addr_offsety; + if (x <= 0x01f0) + { + int i; + pixel_addr_offsetx = x + NEOGEO_HBEND; + pixel_addr_offsety = scanline; + for (i = 0; i < 0x10; i++) + { + //if (zoom_x_tables[zoom_x, zoom_x_table_offset] != 0) + if (zoom_x_tables[zoom_x_table_offset] != 0) + { + //if (sprite_gfx[gfx_offset] != 0) + if (spriteGfx[gfx_offset] != 0) + { + //Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; + bitmapbase[pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + spriteGfx[gfx_offset]]; + } + pixel_addr_offsetx++; + } + zoom_x_table_offset++; + gfx_offset += x_inc; + } + } + else + { + int i; + int x_save = x; + pixel_addr_offsetx = NEOGEO_HBEND; + pixel_addr_offsety = scanline; + for (i = 0; i < 0x10; i++) + { + //if (zoom_x_tables[zoom_x, zoom_x_table_offset] != 0) + if (zoom_x_tables[zoom_x_table_offset] != 0) + { + if (x >= 0x200) + { + //if (sprite_gfx[gfx_offset] != 0) + if (spriteGfx[gfx_offset] != 0) + { + //Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; + bitmapbase[pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + spriteGfx[gfx_offset]]; + } + pixel_addr_offsetx++; + } + x++; + } + zoom_x_table_offset++; + gfx_offset += x_inc; + } + x = x_save; + } + } + } + } + } + } + + //private static void draw_sprites(int iBitmap, int scanline) + //{ + // int x_2, code_2; + // int x, y, rows, zoom_x, zoom_y, sprite_list_offset, sprite_index, max_sprite_index, sprite_number, sprite_y, tile, attr_and_code_offs, code, zoom_x_table_offset, gfx_offset, line_pens_offset, x_inc, sprite_line, zoom_line; + // ushort y_control, zoom_control, attr; + // byte sprite_y_and_tile; + // bool invert; + // y = 0; + // x = 0; + // rows = 0; + // zoom_y = 0; + // zoom_x = 0; + // if ((scanline & 0x01) != 0) + // { + // sprite_list_offset = 0x8680; + // } + // else + // { + // sprite_list_offset = 0x8600; + // } + // for (max_sprite_index = 95; max_sprite_index >= 0; max_sprite_index--) + // { + // if (neogeo_videoram[sprite_list_offset + max_sprite_index] != 0) + // { + // break; + // } + // } + // if (max_sprite_index != 95) + // { + // max_sprite_index = max_sprite_index + 1; + // } + // for (sprite_index = 0; sprite_index < max_sprite_index; sprite_index++) + // { + // sprite_number = neogeo_videoram[sprite_list_offset + sprite_index] & 0x1ff; + // y_control = neogeo_videoram[0x8200 | sprite_number]; + // zoom_control = neogeo_videoram[0x8000 | sprite_number]; + // x_2 = neogeo_videoram[0x8400 | sprite_number]; + // code_2 = neogeo_videoram[sprite_number << 6]; + // if ((y_control & 0x40) != 0) + // { + // x = (x + zoom_x + 1) & 0x01ff; + // zoom_x = (zoom_control >> 8) & 0x0f; + // } + // else + // { + // y = 0x200 - (y_control >> 7); + // x = neogeo_videoram[0x8400 | sprite_number] >> 7; + // zoom_y = zoom_control & 0xff; + // zoom_x = (zoom_control >> 8) & 0x0f; + // rows = y_control & 0x3f; + // } + // if ((x >= 0x140) && (x <= 0x1f0)) + // { + // continue; + // } + // if (sprite_on_scanline(scanline, y, rows)) + // { + // sprite_line = (scanline - y) & 0x1ff; + // zoom_line = sprite_line & 0xff; + // invert = ((sprite_line & 0x100) != 0) ? true : false; + // if (invert) + // { + // zoom_line ^= 0xff; + // } + // if (rows > 0x20) + // { + // zoom_line = zoom_line % ((zoom_y + 1) << 1); + // if (zoom_line > zoom_y) + // { + // zoom_line = ((zoom_y + 1) << 1) - 1 - zoom_line; + // invert = !invert; + // } + // } + // sprite_y_and_tile = zoomyrom[(zoom_y << 8) | zoom_line]; + // sprite_y = sprite_y_and_tile & 0x0f; + // tile = sprite_y_and_tile >> 4; + // if (invert) + // { + // sprite_y ^= 0x0f; + // tile ^= 0x1f; + // } + // attr_and_code_offs = (sprite_number << 6) | (tile << 1); + // attr = neogeo_videoram[attr_and_code_offs + 1]; + // code = ((attr << 12) & 0x70000) | neogeo_videoram[attr_and_code_offs]; + // if (auto_animation_disabled == 0) + // { + // if ((attr & 0x0008) != 0) + // { + // code = (code & ~0x07) | (auto_animation_counter & 0x07); + // } + // else if ((attr & 0x0004) != 0) + // { + // code = (code & ~0x03) | (auto_animation_counter & 0x03); + // } + // } + // if ((attr & 0x0002) != 0) + // { + // sprite_y ^= 0x0f; + // } + // zoom_x_table_offset = 0; + // gfx_offset = (int)(((code << 8) | (sprite_y << 4)) & sprite_gfx_address_mask); + // line_pens_offset = attr >> 8 << 4; + // if ((attr & 0x0001) != 0) + // { + // gfx_offset = gfx_offset + 0x0f; + // x_inc = -1; + // } + // else + // { + // x_inc = 1; + // } + // int pixel_addr_offsetx, pixel_addr_offsety; + // if (x <= 0x01f0) + // { + // int i; + // pixel_addr_offsetx = x + NEOGEO_HBEND; + // pixel_addr_offsety = scanline; + // for (i = 0; i < 0x10; i++) + // { + // if (zoom_x_tables[zoom_x, zoom_x_table_offset] != 0) + // { + // if (sprite_gfx[gfx_offset] != 0) + // { + // Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; + // } + // pixel_addr_offsetx++; + // } + // zoom_x_table_offset++; + // gfx_offset += x_inc; + // } + // } + // else + // { + // int i; + // int x_save = x; + // pixel_addr_offsetx = NEOGEO_HBEND; + // pixel_addr_offsety = scanline; + // for (i = 0; i < 0x10; i++) + // { + // if (zoom_x_tables[zoom_x, zoom_x_table_offset] != 0) + // { + // if (x >= 0x200) + // { + // if (sprite_gfx[gfx_offset] != 0) + // { + // Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; + // } + // pixel_addr_offsetx++; + // } + // x++; + // } + // zoom_x_table_offset++; + // gfx_offset += x_inc; + // } + // x = x_save; + // } + // } + // } + //} + private static void parse_sprites(int scanline) + { + ushort sprite_number, y_control; + int y = 0; + int rows = 0; + int sprite_list_offset; + int active_sprite_count = 0; + if ((scanline & 0x01) != 0) + { + sprite_list_offset = 0x8680; + } + else + { + sprite_list_offset = 0x8600; + } + for (sprite_number = 0; sprite_number < 381; sprite_number++) + { + y_control = neogeo_videoram[0x8200 | sprite_number]; + if ((~y_control & 0x40) != 0) + { + y = 0x200 - (y_control >> 7); + rows = y_control & 0x3f; + } + if (rows == 0) + { + continue; + } + if (!sprite_on_scanline(scanline, y, rows)) + { + continue; + } + neogeo_videoram[sprite_list_offset] = sprite_number; + sprite_list_offset++; + active_sprite_count++; + if (active_sprite_count == 96) + { + break; + } + } + for (; active_sprite_count <= 96; active_sprite_count++) + { + neogeo_videoram[sprite_list_offset] = 0; + sprite_list_offset++; + } + } + public static void sprite_line_timer_callback() + { + int scanline = neogeo_scanline_param; + if (scanline != 0) + { + Video.video_screen_update_partial(scanline - 1); + } + parse_sprites(scanline); + scanline = (scanline + 1) % 264; + neogeo_scanline_param = scanline; + EmuTimer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + } + private static void create_sprite_line_timer() + { + sprite_line_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Neogeo_sprite_line_timer_callback, false); + } + private static void start_sprite_line_timer() + { + neogeo_scanline_param = 0; + EmuTimer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + } + readonly static int[] pix_offsets = new int[] { 0x10, 0x18, 0x00, 0x08 }; + static int[] garouoffsets = new int[32]; + private static void draw_fixed_layer(int iBitmap, int scanline) + { + int i, j, x, y; + byte[] gfx_base; + //int[] garouoffsets = new int[32], pix_offsets = new int[] { 0x10, 0x18, 0x00, 0x08 }; + int addr_mask; + int gfx_offset, char_pens_offset; + byte data; + bool banked; + int garoubank, k, code; + ushort code_and_palette; + if (fixed_layer_source != 0) + { + gfx_base = fixedrom; + addr_mask = fixedrom.Length - 1; + } + else + { + gfx_base = fixedbiosrom; + addr_mask = fixedbiosrom.Length - 1; + } + int video_data_offset = 0x7000 | (scanline >> 3); + banked = (fixed_layer_source != 0) && (addr_mask > 0x1ffff); + if (banked && neogeo_fixed_layer_bank_type == 1) + { + garoubank = 0; + k = 0; + y = 0; + while (y < 32) + { + if (neogeo_videoram[0x7500 + k] == 0x0200 && (neogeo_videoram[0x7580 + k] & 0xff00) == 0xff00) + { + garoubank = neogeo_videoram[0x7580 + k] & 3; + garouoffsets[y++] = garoubank; + } + garouoffsets[y++] = garoubank; + k += 2; + } + } + for (x = 0; x < 40; x++) + { + code_and_palette = neogeo_videoram[video_data_offset]; + code = code_and_palette & 0x0fff; + if (banked) + { + y = scanline >> 3; + switch (neogeo_fixed_layer_bank_type) + { + case 1: + code += 0x1000 * (garouoffsets[(y - 2) & 31] ^ 3); + break; + case 2: + code += 0x1000 * (((neogeo_videoram[0x7500 + ((y - 1) & 31) + 32 * (x / 6)] >> (5 - (x % 6)) * 2) & 3) ^ 3); + break; + } + } + data = 0; + gfx_offset = ((code << 5) | (scanline & 0x07)) & addr_mask; + char_pens_offset = code_and_palette >> 12 << 4; + for (i = 0; i < 8; i++) + { + if ((i & 0x01) != 0) + { + data = (byte)(data >> 4); + } + else + { + data = gfx_base[gfx_offset + pix_offsets[i >> 1]]; + } + if ((data & 0x0f) != 0) + { + Video.bitmapbaseN_Ptrs[iBitmap][384 * scanline + 30 + x * 8 + i] = pens[char_pens_offset + (data & 0x0f)]; + } + } + video_data_offset += 0x20; + } + } + private static void optimize_sprite_data() + { + sprite_gfx_address_mask = (uint)(spritesromLength * 2 - 1); + for (int i = 0; i < spritesromLength; i++) + { + sprite_gfx[i * 2] = (byte)((spritesrom[i] & 0xf0) >> 4); + sprite_gfx[i * 2 + 1] = (byte)(spritesrom[i] & 0x0f); + } + } + private static ushort get_video_control() + { + int ret; + int v_counter; + v_counter = Video.video_screen_get_vpos() + 0x100; + if (v_counter >= 0x200) + v_counter = v_counter - NEOGEO_VTOTAL; + ret = (v_counter << 7) | (auto_animation_counter & 0x07); + return (ushort)ret; + } + private static ushort neogeo_video_register_r(int offset) + { + ushort ret; + switch (offset) + { + default: + case 0x00: + case 0x01: + ret = videoram_read_buffer; + break; + case 0x02: + ret = videoram_modulo; + break; + case 0x03: + ret = get_video_control(); + break; + } + return ret; + } + private static void neogeo_video_register_w(int offset, ushort data) + { + switch (offset) + { + case 0x00: + videoram_offset = data; + videoram_read_buffer = neogeo_videoram[videoram_offset]; + break; + case 0x01: + if (videoram_offset == 0x842d && data == 0x0) + { + int i1 = 1; + } + if (videoram_offset == 0x8263 && data == 0xb102) + { + int i1 = 1; + } + if (videoram_offset == 0x18c0 && data == 0xcb06) + { + int i1 = 1; + } + neogeo_videoram[videoram_offset] = data; + videoram_offset = (ushort)((videoram_offset & 0x8000) | ((videoram_offset + videoram_modulo) & 0x7fff)); + videoram_read_buffer = neogeo_videoram[videoram_offset]; + break; + case 0x02: + videoram_modulo = data; + break; + case 0x03: + auto_animation_speed = (byte)(data >> 8); + auto_animation_disabled = (byte)(data & 0x08); + display_position_interrupt_control = (byte)(data & 0xf0); + break; + case 0x04: + display_counter = (display_counter & 0x0000ffff) | ((uint)data << 16); + break; + case 0x05: + display_counter = (display_counter & 0xffff0000) | data; + if ((display_position_interrupt_control & 0x20) != 0) + { + adjust_display_position_interrupt_timer(); + } + break; + case 0x06: + if ((data & 0x01) != 0) + irq3_pending = 0; + if ((data & 0x02) != 0) + display_position_interrupt_pending = 0; + if ((data & 0x04) != 0) + vblank_interrupt_pending = 0; + update_interrupts(); + break; + case 0x07: + break; + } + } + public static void video_start_neogeo() + { + sprite_gfx = new byte[spritesromLength * 2]; + neogeo_videoram = new ushort[0x10000]; + palettes = new ushort[2, 0x1000]; + pens = new int[0x1000]; + transarray = new int[384 * 264]; + bgarray = new int[384 * 264]; + trans_color = unchecked((int)0xffff00ff); + rgb_weights_normal = new double[5] { 138.24919544273797, 64.712389372353314, 30.414823021125919, 13.824919571647138, 7.7986725921356159 }; + rgb_weights_normal_bit15 = new double[5] { 136.26711031260342, 63.784604843122239, 29.978764292156193, 13.626711058241233, 7.6868626613063098 }; + rgb_weights_dark = new double[5] { 77.012238506947057, 36.048281863327709, 16.942692484743652, 7.7012238659431276, 4.3442801368916566 }; + rgb_weights_dark_bit15 = new double[5] { 76.322306339305158, 35.725334891159271, 16.790907407744047, 7.6322306490423326, 4.3053608862660706 }; + zoom_x_tables = new int[,] + { + { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0 }, + { 0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0 }, + { 0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 }, + { 0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0 }, + { 0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0 }, + { 0,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0 }, + { 0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0 }, + { 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0 }, + { 1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0 }, + { 1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,0 }, + { 1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,1 }, + { 1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,1 }, + { 1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1 }, + { 1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1 }, + { 1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1 }, + { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 } + }; + Array.Clear(palettes, 0, 0x2000); + Array.Clear(pens, 0, 0x1000); + Array.Clear(neogeo_videoram, 0, 0x10000); + for (int i = 0; i < 384 * 264; i++) + { + transarray[i] = trans_color; + } + create_sprite_line_timer(); + create_auto_animation_timer(); + optimize_sprite_data(); + videoram_read_buffer = 0; + videoram_offset = 0; + videoram_modulo = 0; + auto_animation_speed = 0; + auto_animation_disabled = 0; + auto_animation_counter = 0; + auto_animation_frame_counter = 0; + } + public static void video_update_neogeo() + { + Array.Copy(bgarray, 0, Video.bitmapbaseN[Video.curbitmap], 384 * Video.new_clip.min_y, 384 * (Video.new_clip.max_y - Video.new_clip.min_y + 1)); + draw_sprites(Video.curbitmap, Video.new_clip.min_y); + draw_fixed_layer(Video.curbitmap, Video.new_clip.min_y); + } + public static void video_eof_neogeo() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs.meta new file mode 100644 index 00000000..9517f972 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fca287fe0fff4eb43b51d9baf558be5d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/mainbios.rom b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/mainbios.rom new file mode 100644 index 00000000..ed9c5088 Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/mainbios.rom differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/mainbios.rom.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/mainbios.rom.meta new file mode 100644 index 00000000..03654b23 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/mainbios.rom.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 207cb47462bf6f24285805673bcfa00d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sfix.sfix b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sfix.sfix new file mode 100644 index 00000000..bf5e7e7d Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sfix.sfix differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sfix.sfix.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sfix.sfix.meta new file mode 100644 index 00000000..cdba7d18 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sfix.sfix.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 641fade6f3a274a4dbbd8b5e66bcc60a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sm1.sm1 b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sm1.sm1 new file mode 100644 index 00000000..984b1b5a Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sm1.sm1 differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sm1.sm1.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sm1.sm1.meta new file mode 100644 index 00000000..1dd5ecc4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/sm1.sm1.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 15bcaf617da652b4986081bfe27d1d7d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm.meta new file mode 100644 index 00000000..68f954de --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5237dd9039f60d94f9134714154ff4c2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Input.cs new file mode 100644 index 00000000..f3b1129e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Input.cs @@ -0,0 +1,269 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class PGM + { + public static void loop_inputports_pgm_standard() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + short2 &= ~0x0001; + } + else + { + short2 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + short2 &= ~0x0002; + } + else + { + short2 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + short0 &= ~0x0001; + } + else + { + short0 |= 0x0001; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + short0 &= ~0x0100; + } + else + { + short0 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + short0 &= ~0x0010; + } + else + { + short0 |= 0x0010; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + short0 &= ~0x0008; + } + else + { + short0 |= 0x0008; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + short0 &= ~0x0004; + } + else + { + short0 |= 0x0004; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + short0 &= ~0x0002; + } + else + { + short0 |= 0x0002; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + short0 &= ~0x0020; + } + else + { + short0 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + short0 &= ~0x0040; + } + else + { + short0 |= 0x0040; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + short0 &= ~0x0080; + } + else + { + short0 |= 0x0080; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + short2 &= ~0x0100; + } + else + { + short2 |= 0x0100; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_4))//if (Keyboard.IsPressed(Corekey.I)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.O)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + short0 &= ~0x1000; + } + else + { + short0 |= 0x1000; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + short0 &= ~0x0800; + } + else + { + short0 |= 0x0800; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + short0 &= ~0x0400; + } + else + { + short0 |= 0x0400; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + short0 &= ~0x0200; + } + else + { + short0 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + short0 &= ~0x2000; + } + else + { + short0 |= 0x2000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + short0 &= ~0x4000; + } + else + { + short0 |= 0x4000; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + short0 &= unchecked((short)~0x8000); + } + else + { + short0 |= unchecked((short)0x8000); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + short2 &= ~0x0200; + } + else + { + short2 |= 0x0200; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_4))//if (Keyboard.IsPressed(Corekey.NumPad5)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_F))//if (Keyboard.IsPressed(Corekey.NumPad6)) + { + + } + else + { + + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + short2 &= ~0x0020; + } + else + { + short2 |= 0x0020; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + short2 &= ~0x0080; + } + else + { + short2 |= 0x0080; + } + } + public static void record_port() + { + if (short0 != short0_old || short1 != short1_old || short2 != short2_old || short3 != short3_old || short4 != short4_old) + { + short0_old = short0; + short1_old = short1; + short2_old = short2; + short3_old = short3; + short4_old = short4; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(short0); + Mame.bwRecord.Write(short1); + Mame.bwRecord.Write(short2); + Mame.bwRecord.Write(short3); + Mame.bwRecord.Write(short4); + } + } + public static void replay_port() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + short0_old = Mame.brRecord.ReadInt16(); + short1_old = Mame.brRecord.ReadInt16(); + short2_old = Mame.brRecord.ReadInt16(); + short3_old = Mame.brRecord.ReadInt16(); + short4_old = Mame.brRecord.ReadInt16(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + short0 = short0_old; + short1 = short1_old; + short2 = short2_old; + short3 = short3_old; + short4 = short4_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Input.cs.meta new file mode 100644 index 00000000..86aa9d9d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 485b9fbe5ebd4d3499e9765b8c43b5b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Machine.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Machine.cs new file mode 100644 index 00000000..96bbee12 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Machine.cs @@ -0,0 +1,333 @@ +namespace MAME.Core +{ + public partial class PGM + { + public static int kb_game_id, kb_region; + public static ushort kb_prot_hold, kb_prot_hilo, kb_prot_hilo_select; + public static int kb_cmd, kb_reg, kb_ptr; + public static byte kb_swap; + public static ushort olds_bs, kb_cmd3; + public static byte[][] kb_source_data; + public static byte[][] drgw2_source_data = new byte[0x08][]//[0xec] + { + new byte[]{ 0, }, // Region 0, not used + new byte[]{ // Region 1, $13A886 + 0x67, 0x51, 0xF3, 0x19, 0xA0, 0x11, 0xB1, 0x11, 0xB0, 0xEE, 0xE3, 0xF6, 0xBE, 0x81, 0x35, 0xE3, + 0xFB, 0xE6, 0xEF, 0xDF, 0x61, 0x01, 0xFA, 0x22, 0x5D, 0x43, 0x01, 0xA5, 0x3B, 0x17, 0xD4, 0x74, + 0xF0, 0xF4, 0xF3, 0x43, 0xB5, 0x19, 0x04, 0xD5, 0x84, 0xCE, 0x87, 0xFE, 0x35, 0x3E, 0xC4, 0x3C, + 0xC7, 0x85, 0x2A, 0x33, 0x00, 0x86, 0xD0, 0x4D, 0x65, 0x4B, 0xF9, 0xE9, 0xC0, 0xBA, 0xAA, 0x77, + 0x9E, 0x66, 0xF6, 0x0F, 0x4F, 0x3A, 0xB6, 0xF1, 0x64, 0x9A, 0xE9, 0x25, 0x1A, 0x5F, 0x22, 0xA3, + 0xA2, 0xBF, 0x4B, 0x77, 0x3F, 0x34, 0xC9, 0x6E, 0xDB, 0x12, 0x5C, 0x33, 0xA5, 0x8B, 0x6C, 0xB1, + 0x74, 0xC8, 0x40, 0x4E, 0x2F, 0xE7, 0x46, 0xAE, 0x99, 0xFC, 0xB0, 0x55, 0x54, 0xDF, 0xA7, 0xA1, + 0x0F, 0x5E, 0x49, 0xCF, 0x56, 0x3C, 0x90, 0x2B, 0xAC, 0x65, 0x6E, 0xDB, 0x58, 0x3E, 0xC9, 0x00, + 0xAE, 0x53, 0x4D, 0x92, 0xFA, 0x40, 0xB2, 0x6B, 0x65, 0x4B, 0x90, 0x8A, 0x0C, 0xE2, 0xA5, 0x9A, + 0xD0, 0x20, 0x29, 0x55, 0xA4, 0x44, 0xAC, 0x51, 0x87, 0x54, 0x53, 0x34, 0x24, 0x4B, 0x81, 0x67, + 0x34, 0x4C, 0x5F, 0x31, 0x4E, 0xF2, 0xF1, 0x19, 0x18, 0x1C, 0x34, 0x38, 0xE1, 0x81, 0x17, 0xCF, + 0x24, 0xB9, 0x9A, 0xCB, 0x34, 0x51, 0x50, 0x59, 0x44, 0xB1, 0x0B, 0x50, 0x95, 0x6C, 0x48, 0x7E, + 0x14, 0xA4, 0xC6, 0xD9, 0xD3, 0xA5, 0xD6, 0xD0, 0xC5, 0x97, 0xF0, 0x45, 0xD0, 0x98, 0x51, 0x91, + 0x9F, 0xA3, 0x43, 0x51, 0x05, 0x90, 0xEE, 0xCA, 0x7E, 0x5F, 0x72, 0x53, 0xB1, 0xD3, 0xAF, 0x36, + 0x08, 0x75, 0xB0, 0x9B, 0xE0, 0x0D, 0x43, 0x88, 0xAA, 0x27, 0x44, 0x11 + }, + new byte[]{ 0, }, // Region 2, not used + new byte[]{ 0, }, // Region 3, not used + new byte[]{ 0, }, // Region 4, not used + new byte[]{ // Region 5, $13ab42 (drgw2c) + 0x7F, 0x41, 0xF3, 0x39, 0xA0, 0x11, 0xA1, 0x11, 0xB0, 0xA2, 0x4C, 0x23, 0x13, 0xE9, 0x25, 0x3D, + 0x0F, 0x72, 0x3A, 0x9D, 0xB5, 0x96, 0xD1, 0xDA, 0x07, 0x29, 0x41, 0x9A, 0xAD, 0x70, 0xBA, 0x46, + 0x63, 0x2B, 0x7F, 0x3D, 0xBE, 0x40, 0xAD, 0xD4, 0x4C, 0x73, 0x27, 0x58, 0xA7, 0x65, 0xDC, 0xD6, + 0xFD, 0xDE, 0xB5, 0x6E, 0xD6, 0x6C, 0x75, 0x1A, 0x32, 0x45, 0xD5, 0xE3, 0x6A, 0x14, 0x6D, 0x80, + 0x84, 0x15, 0xAF, 0xCC, 0x7B, 0x61, 0x51, 0x82, 0x40, 0x53, 0x7F, 0x38, 0xA0, 0xD6, 0x8F, 0x61, + 0x79, 0x19, 0xE5, 0x99, 0x84, 0xD8, 0x78, 0x27, 0x3F, 0x16, 0x97, 0x78, 0x4F, 0x7B, 0x0C, 0xA6, + 0x37, 0xDB, 0xC6, 0x0C, 0x24, 0xB4, 0xC7, 0x94, 0x9D, 0x92, 0xD2, 0x3B, 0xD5, 0x11, 0x6F, 0x0A, + 0xDB, 0x76, 0x66, 0xE7, 0xCD, 0x18, 0x2B, 0x66, 0xD8, 0x41, 0x40, 0x58, 0xA2, 0x01, 0x1E, 0x6D, + 0x44, 0x75, 0xE7, 0x19, 0x4F, 0xB2, 0xE8, 0xC4, 0x96, 0x77, 0x62, 0x02, 0xC9, 0xDC, 0x59, 0xF3, + 0x43, 0x8D, 0xC8, 0xFE, 0x9E, 0x2A, 0xBA, 0x32, 0x3B, 0x62, 0xE3, 0x92, 0x6E, 0xC2, 0x08, 0x4D, + 0x51, 0xCD, 0xF9, 0x3A, 0x3E, 0xC9, 0x50, 0x27, 0x21, 0x25, 0x97, 0xD7, 0x0E, 0xF8, 0x39, 0x38, + 0xF5, 0x86, 0x94, 0x93, 0xBF, 0xEB, 0x18, 0xA8, 0xFC, 0x24, 0xF5, 0xF9, 0x99, 0x20, 0x3D, 0xCD, + 0x2C, 0x94, 0x25, 0x79, 0x28, 0x77, 0x8F, 0x2F, 0x10, 0x69, 0x86, 0x30, 0x43, 0x01, 0xD7, 0x9A, + 0x17, 0xE3, 0x47, 0x37, 0xBD, 0x62, 0x75, 0x42, 0x78, 0xF4, 0x2B, 0x57, 0x4C, 0x0A, 0xDB, 0x53, + 0x4D, 0xA1, 0x0A, 0xD6, 0x3A, 0x16, 0x15, 0xAA, 0x2C, 0x6C, 0x39, 0x42 + }, + new byte[]{ // Region 6, $13ab42 (drgw2), $13ab2e (dw2v100x) + 0x12, 0x09, 0xF3, 0x29, 0xA0, 0x11, 0xA0, 0x11, 0xB0, 0xD5, 0x66, 0xA1, 0x28, 0x4A, 0x21, 0xC0, + 0xD3, 0x9B, 0x86, 0x80, 0x57, 0x6F, 0x41, 0xC2, 0xE4, 0x2F, 0x0B, 0x91, 0xBD, 0x3A, 0x7A, 0xBA, + 0x00, 0xE5, 0x35, 0x02, 0x74, 0x7D, 0x8B, 0x21, 0x57, 0x10, 0x0F, 0xAE, 0x44, 0xBB, 0xE2, 0x37, + 0x18, 0x7B, 0x52, 0x3D, 0x8C, 0x59, 0x9E, 0x20, 0x1F, 0x0A, 0xCC, 0x1C, 0x8E, 0x6A, 0xD7, 0x95, + 0x2B, 0x34, 0xB0, 0x82, 0x6D, 0xFD, 0x25, 0x33, 0xAA, 0x3B, 0x2B, 0x70, 0x15, 0x87, 0x31, 0x5D, + 0xBB, 0x29, 0x19, 0x95, 0xD5, 0x8E, 0x24, 0x28, 0x5E, 0xD0, 0x20, 0x83, 0x46, 0x4A, 0x21, 0x70, + 0x5B, 0xCD, 0xAE, 0x7B, 0x61, 0xA1, 0xFA, 0xF4, 0x2B, 0x84, 0x15, 0x6E, 0x36, 0x5D, 0x1B, 0x24, + 0x0F, 0x09, 0x3A, 0x61, 0x38, 0x0F, 0x18, 0x35, 0x11, 0x38, 0xB4, 0xBD, 0xEE, 0xF7, 0xEC, 0x0F, + 0x1D, 0xB7, 0x48, 0x01, 0xAA, 0x09, 0x8F, 0x61, 0xB5, 0x0F, 0x1D, 0x26, 0x39, 0x2E, 0x8C, 0xD6, + 0x26, 0x5C, 0x3D, 0x23, 0x63, 0xE9, 0x6B, 0x97, 0xB4, 0x9F, 0x7B, 0xB6, 0xBA, 0xA0, 0x7C, 0xC6, + 0x25, 0xA1, 0x73, 0x36, 0x67, 0x7F, 0x74, 0x1E, 0x1D, 0xDA, 0x70, 0xBF, 0xA5, 0x63, 0x35, 0x39, + 0x24, 0x8C, 0x9F, 0x85, 0x16, 0xD8, 0x50, 0x95, 0x71, 0xC0, 0xF6, 0x1E, 0x6D, 0x80, 0xED, 0x15, + 0xEB, 0x63, 0xE9, 0x1B, 0xF6, 0x78, 0x31, 0xC6, 0x5C, 0xDD, 0x19, 0xBD, 0xDF, 0xA7, 0xEC, 0x50, + 0x22, 0xAD, 0xBB, 0xF6, 0xEB, 0xD6, 0xA3, 0x20, 0xC9, 0xE6, 0x9F, 0xCB, 0xF2, 0x97, 0xB9, 0x54, + 0x12, 0x66, 0xA6, 0xBE, 0x4A, 0x12, 0x43, 0xEC, 0x00, 0xEA, 0x49, 0x02 + }, + new byte[]{ 0, } // Region 7, not used + }; + public static byte[][] killbld_source_data = new byte[0x0c][]//[0xec] + { + new byte[]{ // region 16, $178772 + 0x5e, 0x09, 0xb3, 0x39, 0x60, 0x71, 0x71, 0x53, 0x11, 0xe5, 0x26, 0x34, 0x4c, 0x8c, 0x90, 0xee, + 0xed, 0xb5, 0x05, 0x95, 0x9e, 0x6b, 0xdd, 0x87, 0x0e, 0x7b, 0xed, 0x33, 0xaf, 0xc2, 0x62, 0x98, + 0xec, 0xc8, 0x2c, 0x2b, 0x57, 0x3d, 0x00, 0xbd, 0x12, 0xac, 0xba, 0x64, 0x81, 0x99, 0x16, 0x29, + 0xb4, 0x63, 0xa8, 0xd9, 0xc9, 0x5f, 0xfe, 0x21, 0xbb, 0xbf, 0x9b, 0xd1, 0x7b, 0x93, 0xc4, 0x82, + 0xef, 0x2b, 0xe8, 0xa6, 0xdc, 0x68, 0x3a, 0xd9, 0xc9, 0x23, 0xc7, 0x7b, 0x98, 0x5b, 0xe1, 0xc7, + 0xa3, 0xd4, 0x51, 0x0a, 0x86, 0x30, 0x20, 0x51, 0x6e, 0x04, 0x1c, 0xd4, 0xfb, 0xf5, 0x22, 0x8f, + 0x16, 0x6f, 0xb9, 0x59, 0x30, 0xcf, 0xab, 0x32, 0x1d, 0x6c, 0x84, 0xab, 0x23, 0x90, 0x94, 0xb1, + 0xe7, 0x4b, 0x6d, 0xc1, 0x84, 0xba, 0x32, 0x68, 0xa3, 0xf2, 0x47, 0x28, 0xe5, 0xcb, 0xbb, 0x47, + 0x14, 0x2c, 0xad, 0x4d, 0xa1, 0xd7, 0x18, 0x53, 0xf7, 0x6f, 0x05, 0x81, 0x8f, 0xbb, 0x29, 0xdc, + 0xbd, 0x17, 0x61, 0x92, 0x9b, 0x1d, 0x4e, 0x7a, 0x83, 0x14, 0x9f, 0x7b, 0x7a, 0x6a, 0xe1, 0x27, + 0x62, 0x52, 0x7e, 0x82, 0x45, 0xda, 0xed, 0xf1, 0x0a, 0x3b, 0x6c, 0x02, 0x5b, 0x6e, 0x45, 0x4e, + 0xf2, 0x65, 0x87, 0x1d, 0x80, 0xed, 0x6a, 0xc3, 0x77, 0xcb, 0xe8, 0x8d, 0x5a, 0xb8, 0xda, 0x89, + 0x88, 0x4b, 0x27, 0xd5, 0x57, 0x29, 0x91, 0x86, 0x12, 0xbb, 0xd3, 0x8c, 0xc7, 0x49, 0x84, 0x9c, + 0x96, 0x59, 0x30, 0x93, 0x92, 0xeb, 0x59, 0x2b, 0x93, 0x5b, 0x5f, 0xf9, 0x67, 0xac, 0x97, 0x8c, + 0x04, 0xda, 0x1b, 0x65, 0xd7, 0xef, 0x44, 0xca, 0xc4, 0x87, 0x18, 0x2b + }, + new byte[]{ // region 17, $178a36 + 0xd7, 0x49, 0xb3, 0x39, 0x60, 0x71, 0x70, 0x53, 0x11, 0x00, 0x27, 0xb2, 0x61, 0xd3, 0x8c, 0x8b, + 0xb2, 0xde, 0x6a, 0x78, 0x40, 0x5d, 0x4d, 0x88, 0xeb, 0x81, 0xd0, 0x2a, 0xbf, 0x8c, 0x22, 0x0d, + 0x89, 0x83, 0xc8, 0xef, 0x0d, 0x7a, 0xf6, 0xf0, 0x1d, 0x49, 0xa2, 0xd3, 0x1e, 0xef, 0x1c, 0xa2, + 0xce, 0x00, 0x5e, 0xa8, 0x7f, 0x4c, 0x41, 0x27, 0xa8, 0x6b, 0x92, 0x0a, 0xb8, 0x03, 0x2f, 0x7e, + 0xaf, 0x4a, 0xd0, 0x5c, 0xce, 0xeb, 0x0e, 0x8a, 0x4d, 0x0b, 0x73, 0xb3, 0xf3, 0x0c, 0x83, 0xaa, + 0xe5, 0xe4, 0x84, 0x06, 0xd7, 0xcc, 0xcb, 0x52, 0x8d, 0xbe, 0xa4, 0xdf, 0xd9, 0xab, 0x50, 0x59, + 0x53, 0x61, 0xa1, 0xc8, 0x6d, 0xbc, 0xde, 0xab, 0xaa, 0x5e, 0xc6, 0xf7, 0x83, 0xdc, 0x40, 0xcb, + 0x1b, 0xdd, 0x28, 0x3b, 0xee, 0xb1, 0x1f, 0x37, 0xdb, 0xe9, 0xbb, 0x74, 0x4b, 0xc2, 0x8a, 0xe8, + 0xec, 0x6e, 0x0e, 0x35, 0xe3, 0x2e, 0xbe, 0xef, 0xfd, 0x07, 0xbf, 0x8c, 0xfe, 0xf3, 0x5c, 0xbf, + 0x87, 0xe5, 0xbc, 0xcf, 0x60, 0xdc, 0x18, 0xf8, 0xfc, 0x51, 0x50, 0x86, 0xc6, 0x48, 0x3d, 0xb9, + 0x1d, 0x26, 0xf7, 0x7e, 0x87, 0x90, 0x12, 0xe8, 0x06, 0x0a, 0x45, 0xe9, 0xd9, 0xd8, 0x41, 0x68, + 0x21, 0x52, 0x92, 0x0f, 0xd6, 0xda, 0xa2, 0x97, 0xeb, 0x68, 0xd0, 0xb1, 0x15, 0x19, 0x8b, 0xd0, + 0x48, 0x1a, 0xeb, 0x90, 0x3f, 0x2a, 0x33, 0x1e, 0x5e, 0x30, 0x66, 0x01, 0x64, 0xef, 0x99, 0x52, + 0xba, 0x23, 0xbd, 0x53, 0xc0, 0x60, 0x87, 0x09, 0xcb, 0x4d, 0xd3, 0x87, 0x0e, 0x3a, 0x5c, 0x8d, + 0xc8, 0xb8, 0xb7, 0x34, 0x01, 0xeb, 0x72, 0x0d, 0xb1, 0x1f, 0x0f, 0xea + }, + new byte[]{ // region 18, $17dac4 + 0x6a, 0x13, 0xb3, 0x09, 0x60, 0x79, 0x61, 0x53, 0x11, 0x33, 0x41, 0x31, 0x76, 0x34, 0x88, 0x0f, + 0x77, 0x08, 0xb6, 0x74, 0xc8, 0x36, 0xbc, 0x70, 0xe2, 0x87, 0x9a, 0x21, 0xe8, 0x56, 0xe1, 0x9a, + 0x26, 0x57, 0x7e, 0x9b, 0xdb, 0xb7, 0xd4, 0x3d, 0x0f, 0xfe, 0x8a, 0x2a, 0xba, 0x2d, 0x22, 0x03, + 0xcf, 0x9c, 0xfa, 0x77, 0x35, 0x39, 0x6a, 0x14, 0xae, 0x30, 0x89, 0x42, 0xdc, 0x59, 0xb2, 0x93, + 0x6f, 0x82, 0xd1, 0x12, 0xd9, 0x88, 0xfa, 0x3b, 0xb7, 0x0c, 0x1f, 0x05, 0x68, 0xa3, 0x0c, 0xa6, + 0x0f, 0xf4, 0x9e, 0x1b, 0x29, 0x82, 0x77, 0x3a, 0xac, 0x92, 0x2d, 0x04, 0xd0, 0x61, 0x65, 0x0a, + 0x77, 0x6c, 0x89, 0x38, 0xaa, 0xa9, 0xf8, 0x0c, 0x1f, 0x37, 0x09, 0x2b, 0xca, 0x29, 0x05, 0xe5, + 0x4e, 0x57, 0xfb, 0xcd, 0x40, 0xa8, 0x0c, 0x06, 0x2d, 0xe0, 0x30, 0xd9, 0x97, 0xb9, 0x59, 0x8a, + 0xde, 0xc9, 0x87, 0x1d, 0x3f, 0x84, 0x4c, 0x73, 0x04, 0x85, 0x61, 0xb0, 0x6e, 0x2c, 0x8f, 0xa2, + 0x6a, 0xcd, 0x31, 0xf3, 0x25, 0x83, 0xe1, 0x5e, 0x5d, 0xa7, 0xe7, 0xaa, 0x13, 0x26, 0xb1, 0x33, + 0xf0, 0x13, 0x58, 0x7a, 0xb0, 0x46, 0x1d, 0xdf, 0x02, 0xbf, 0x1e, 0xd1, 0x71, 0x43, 0x56, 0x82, + 0x4f, 0x58, 0x9d, 0x01, 0x2d, 0xc7, 0xda, 0x6b, 0x47, 0x05, 0xd1, 0xd5, 0xe8, 0x92, 0x3c, 0x18, + 0x21, 0xcf, 0xc9, 0x32, 0x0e, 0x12, 0xed, 0xb5, 0xaa, 0xa4, 0x12, 0x75, 0x01, 0x7d, 0xc7, 0x21, + 0xde, 0xec, 0x32, 0x13, 0xee, 0xd4, 0x9c, 0xe6, 0x04, 0x3f, 0x48, 0xfb, 0xb4, 0xc7, 0x21, 0x8e, + 0x8d, 0x7d, 0x54, 0x03, 0x11, 0xe7, 0xb9, 0x4f, 0x85, 0xb6, 0x1f, 0xaa + }, + new byte[]{ // region 19, $178eee + 0xe3, 0x53, 0xb3, 0x09, 0x60, 0x79, 0x60, 0x53, 0x11, 0x66, 0x5b, 0xc8, 0x8b, 0x94, 0x84, 0xab, + 0x3c, 0x18, 0x03, 0x57, 0x6a, 0x0f, 0x45, 0x58, 0xc0, 0x74, 0x64, 0x18, 0xf8, 0x39, 0xa1, 0x0f, + 0xc2, 0x2b, 0x1b, 0x60, 0xaa, 0x0e, 0xb2, 0x89, 0x01, 0x9b, 0x72, 0x80, 0x57, 0x83, 0x28, 0x63, + 0xe9, 0x39, 0x97, 0x46, 0xea, 0x3f, 0x93, 0x01, 0x9b, 0xf4, 0x80, 0x93, 0x01, 0xaf, 0x1d, 0x8f, + 0x16, 0xa1, 0xb9, 0xc7, 0xe4, 0x0c, 0xe7, 0xd2, 0x3b, 0xf3, 0xca, 0x3d, 0xc3, 0x54, 0xad, 0x89, + 0x51, 0x1e, 0xd1, 0x17, 0x7a, 0x1f, 0x23, 0x22, 0xcb, 0x4d, 0xce, 0x0f, 0xae, 0x30, 0x93, 0xd3, + 0x9b, 0x77, 0x71, 0xa7, 0xe7, 0x96, 0x2c, 0x85, 0xac, 0x29, 0x4b, 0x5e, 0x2b, 0x75, 0xb0, 0x00, + 0x81, 0xe9, 0xb6, 0x47, 0xaa, 0x9f, 0xdf, 0xd4, 0x7e, 0xd7, 0xa4, 0x3f, 0xe3, 0xb0, 0x41, 0x2c, + 0xb7, 0x0c, 0xe7, 0xeb, 0x9a, 0xda, 0xd9, 0x10, 0x23, 0x1d, 0x1c, 0xd4, 0xdd, 0x7d, 0xc2, 0x6c, + 0x4d, 0x9c, 0xa5, 0x18, 0xd0, 0x43, 0xab, 0xdc, 0xbd, 0xe4, 0x7f, 0xb5, 0x5f, 0x04, 0x0d, 0xac, + 0xab, 0xe6, 0xb8, 0x76, 0xf2, 0x15, 0x41, 0xef, 0x17, 0x8e, 0xf6, 0xb9, 0xef, 0x94, 0x52, 0x83, + 0x96, 0x45, 0x8f, 0xf2, 0x9c, 0xb4, 0x13, 0x3f, 0xbb, 0xa1, 0xd2, 0xf9, 0xa3, 0xf2, 0x06, 0x78, + 0xe0, 0x9e, 0xa7, 0xd3, 0xdc, 0x13, 0x8f, 0x4d, 0xf6, 0x19, 0xbd, 0x03, 0x9d, 0x24, 0xdc, 0xd6, + 0xe9, 0xcf, 0xa6, 0xd2, 0x1d, 0x49, 0xca, 0xc4, 0x55, 0x18, 0xbc, 0x70, 0x5b, 0x55, 0xfe, 0x8f, + 0x6b, 0x42, 0xf0, 0xd1, 0x21, 0xe3, 0xe7, 0x91, 0x59, 0x4e, 0x16, 0x83 + }, + new byte[]{ 0, }, // unused region 1a + new byte[]{ 0, }, // unused region 1b + new byte[]{ 0, }, // unused region 1c + new byte[]{ 0, }, // unused region 1d + new byte[]{ 0, }, // unused region 1e + new byte[]{ 0, }, // unused region 1f + new byte[]{ // region 20, $17a322 + 0xb3, 0x10, 0xf3, 0x0b, 0xe0, 0x71, 0x60, 0x53, 0x11, 0x9a, 0x12, 0x70, 0x1f, 0x1e, 0x81, 0xda, + 0x9d, 0x1f, 0x4b, 0xd6, 0x71, 0x48, 0x83, 0xe1, 0x04, 0x6c, 0x1b, 0xf1, 0xcd, 0x09, 0xdf, 0x3e, + 0x0b, 0xaa, 0x95, 0xc1, 0x07, 0xec, 0x0f, 0x54, 0xd0, 0x16, 0xb0, 0xdc, 0x86, 0x7b, 0x52, 0x38, + 0x3c, 0x68, 0x2b, 0xed, 0xe2, 0xeb, 0xb3, 0xc6, 0x48, 0x24, 0x41, 0x36, 0x17, 0x25, 0x1f, 0xa5, + 0x22, 0xc6, 0x5c, 0xa6, 0x19, 0xef, 0x17, 0x5c, 0x56, 0x4b, 0x4a, 0x2b, 0x75, 0xab, 0xe6, 0x22, + 0xd5, 0xc0, 0xd3, 0x46, 0xcc, 0xe4, 0xd4, 0xc4, 0x8c, 0x9a, 0x8a, 0x75, 0x24, 0x73, 0xa4, 0x26, + 0xca, 0x79, 0xaf, 0xb3, 0x94, 0x2a, 0x15, 0xbe, 0x40, 0x7b, 0x4d, 0xf6, 0xb4, 0xa4, 0x7b, 0xcf, + 0xce, 0xa0, 0x1d, 0xcb, 0x2f, 0x60, 0x28, 0x63, 0x85, 0x98, 0xd3, 0xd2, 0x45, 0x3f, 0x02, 0x65, + 0xd7, 0xf4, 0xbc, 0x2a, 0xe7, 0x50, 0xd1, 0x3f, 0x7f, 0xf6, 0x05, 0xb8, 0xe9, 0x39, 0x10, 0x6e, + 0x68, 0xa8, 0x89, 0x60, 0x00, 0x68, 0xfd, 0x20, 0xc4, 0xdc, 0xef, 0x67, 0x75, 0xfb, 0xbe, 0xfe, + 0x2b, 0x16, 0xa6, 0x5a, 0x77, 0x0d, 0x0c, 0xe2, 0x2d, 0xd1, 0xe4, 0x11, 0xc9, 0x4b, 0x81, 0x3a, + 0x0c, 0x24, 0xaa, 0x77, 0x2b, 0x2f, 0x83, 0x23, 0xd1, 0xe9, 0xa7, 0x29, 0x0a, 0xf9, 0x26, 0x9d, + 0x51, 0xc8, 0x6d, 0x71, 0x9d, 0xce, 0x46, 0x72, 0x26, 0x48, 0x3d, 0x64, 0xe5, 0x67, 0xbb, 0x1a, + 0xb4, 0x6d, 0x21, 0x11, 0x79, 0x78, 0xc2, 0xd5, 0x11, 0x6a, 0xd2, 0xea, 0x03, 0x4d, 0x92, 0xaf, + 0x18, 0xd5, 0x07, 0x79, 0xaa, 0xf9, 0x44, 0x93, 0x6f, 0x41, 0x22, 0x0d + }, + new byte[]{ // region 21, $17b3b4 + 0x2d, 0x50, 0xf3, 0x0b, 0xe0, 0x71, 0x61, 0x53, 0x11, 0xb4, 0x2c, 0xee, 0x34, 0x7e, 0x7d, 0x5e, + 0x62, 0x48, 0x97, 0xd2, 0xf9, 0x3a, 0xf2, 0xc9, 0xfa, 0x59, 0xe4, 0xe8, 0xf6, 0xd2, 0x9f, 0xb2, + 0xa7, 0x7e, 0x32, 0x86, 0xbc, 0x43, 0xec, 0xa0, 0xc2, 0xcb, 0x98, 0x33, 0x23, 0xd1, 0x58, 0x98, + 0x56, 0x05, 0xc7, 0xbc, 0x98, 0xd8, 0xdc, 0xb3, 0x35, 0xe8, 0x51, 0x6e, 0x3b, 0x7b, 0x89, 0xba, + 0xe1, 0xe5, 0x44, 0x5c, 0x24, 0x73, 0x04, 0x0d, 0xd9, 0x33, 0xf5, 0x63, 0xe9, 0x5c, 0x88, 0x05, + 0x18, 0xd0, 0x07, 0x5b, 0x1e, 0x81, 0x80, 0xac, 0x92, 0x6e, 0x13, 0x80, 0x1b, 0x29, 0xd2, 0xef, + 0x08, 0x84, 0x97, 0x23, 0xd1, 0x17, 0x2f, 0x38, 0xb4, 0x6d, 0x8f, 0x2a, 0x15, 0xf0, 0x40, 0xe9, + 0x02, 0x33, 0xd7, 0x5e, 0x99, 0x57, 0x15, 0x32, 0xbd, 0x8f, 0x48, 0x38, 0x91, 0x36, 0xe9, 0x07, + 0xc9, 0x37, 0x1d, 0x12, 0x2a, 0xbf, 0x5f, 0xdb, 0x85, 0x75, 0xbf, 0xdc, 0x59, 0x8a, 0x43, 0x51, + 0x4b, 0x77, 0xfd, 0x84, 0xc4, 0x28, 0xc7, 0x85, 0x25, 0x1a, 0x87, 0x8b, 0xc1, 0xd9, 0x1a, 0x78, + 0xe5, 0x03, 0x20, 0x56, 0xa0, 0xc2, 0x17, 0xf2, 0x29, 0xa0, 0xbd, 0xf8, 0x61, 0x9c, 0x7d, 0x54, + 0x3a, 0x11, 0xb5, 0x69, 0x9a, 0x1c, 0xbb, 0xf6, 0x2d, 0x86, 0xa8, 0x4d, 0xdd, 0x5a, 0xd6, 0xe4, + 0x11, 0x7e, 0x4b, 0x13, 0x6c, 0xb6, 0x01, 0x0a, 0x72, 0xbc, 0xe8, 0xf1, 0x82, 0x0e, 0xd0, 0xcf, + 0xbf, 0x50, 0x95, 0xb7, 0xa7, 0xec, 0xd7, 0xb3, 0x49, 0x5c, 0x47, 0x5f, 0xa9, 0xda, 0x70, 0xb0, + 0xdc, 0x9a, 0xa3, 0x48, 0xd3, 0xf5, 0x72, 0xd5, 0x43, 0xd8, 0x19, 0xcc + } + }; + public static void drgw_interrupt() + { + if (Cpuexec.iloops == 0) + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + else + { + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + } + public static void device_init() + { + kb_prot_hold = 0; + kb_prot_hilo = 0; + kb_prot_hilo_select = 0; + kb_cmd = 0; + kb_reg = 0; + kb_ptr = 0; + kb_swap = 0; + olds_bs = 0; + kb_cmd3 = 0; + switch (Machine.sName) + { + case "drgw2": + kb_source_data = drgw2_source_data; + int region = 0x06; + kb_region = region; + kb_game_id = region | (region << 8) | (region << 16) | (region << 24); + break; + case "killbld": + kb_source_data = killbld_source_data; + + break; + } + } + public static void device_reset() + { + kb_prot_hold = 0; + kb_prot_hilo = 0; + kb_prot_hilo_select = 0; + kb_cmd = 0; + kb_reg = 0; + kb_ptr = 0; + kb_swap = 0; + olds_bs = 0; + kb_cmd3 = 0; + } + public static int BIT(int x, int n) + { + return (x >> n) & 1; + } + public static int BITSWAP8(int val, int B7, int B6, int B5, int B4, int B3, int B2, int B1, int B0) + { + return ((BIT(val, B7) << 7) | + (BIT(val, B6) << 6) | + (BIT(val, B5) << 5) | + (BIT(val, B4) << 4) | + (BIT(val, B3) << 3) | + (BIT(val, B2) << 2) | + (BIT(val, B1) << 1) | + (BIT(val, B0) << 0)); + } + public static ushort killbld_igs025_prot_r(int offset) + { + if (offset != 0) + { + switch (kb_cmd) + { + case 0x00: + return (ushort)BITSWAP8((kb_swap + 1) & 0x7f, 0, 1, 2, 3, 4, 5, 6, 7); + case 0x01: + return (ushort)(kb_reg & 0x7f); + case 0x02: + return (ushort)(olds_bs | 0x80); + case 0x03: + return (ushort)kb_cmd3; + case 0x05: + { + switch (kb_ptr) + { + case 1: + return (ushort)(0x3f00 | ((kb_game_id >> 0) & 0xff)); + case 2: + return (ushort)(0x3f00 | ((kb_game_id >> 8) & 0xff)); + case 3: + return (ushort)(0x3f00 | ((kb_game_id >> 16) & 0xff)); + case 4: + return (ushort)(0x3f00 | ((kb_game_id >> 24) & 0xff)); + default: + return (ushort)(0x3f00 | BITSWAP8(kb_prot_hold, 5, 2, 9, 7, 10, 13, 12, 15)); + } + } + case 0x40: + killbld_protection_calculate_hilo(); + return 0; + } + } + return 0; + } + public static void drgw2_d80000_protection_w(int offset, ushort data) + { + if (offset == 0) + { + kb_cmd = data; + return; + } + switch (kb_cmd) + { + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + kb_ptr++; + killbld_protection_calculate_hold(kb_cmd & 0x0f, data & 0xff); + break; + } + } + public static void killbld_protection_calculate_hold(int y, int z) + { + ushort old = kb_prot_hold; + kb_prot_hold = (ushort)((old << 1) | (old >> 15)); + kb_prot_hold ^= (ushort)0x2bad; + kb_prot_hold ^= (ushort)BIT(z, y); + kb_prot_hold ^= (ushort)(BIT(old, 7) << 0); + kb_prot_hold ^= (ushort)(BIT(~old, 13) << 4); + kb_prot_hold ^= (ushort)(BIT(old, 3) << 11); + kb_prot_hold ^= (ushort)((kb_prot_hilo & ~0x0408) << 1); + } + public static void killbld_protection_calculate_hilo() + { + byte source; + kb_prot_hilo_select++; + if (kb_prot_hilo_select > 0xeb) + { + kb_prot_hilo_select = 0; + } + source = kb_source_data[kb_region][kb_prot_hilo_select]; + if ((kb_prot_hilo_select & 1) != 0) + { + kb_prot_hilo = (ushort)((kb_prot_hilo & 0x00ff) | (source << 8)); + } + else + { + kb_prot_hilo = (ushort)((kb_prot_hilo & 0xff00) | (source << 0)); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Machine.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Machine.cs.meta new file mode 100644 index 00000000..133d2c67 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Machine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 220c9c0197a18214ab1cba47a35cfbac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory.cs new file mode 100644 index 00000000..bf177ac9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory.cs @@ -0,0 +1,644 @@ +namespace MAME.Core +{ + public unsafe partial class PGM + { + public static short short0, short1, short2, short3, short4, short5, short6; + public static short short0_old, short1_old, short2_old, short3_old, short4_old, short5_old, short6_old; + public static sbyte MReadOpByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0 && address <= 0x1ffff) + { + result = (sbyte)(mainbiosrom[address]); + } + else if (address >= 0x100000 && address <= 0x3fffff) + { + if (address < 0x100000 + Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address - 0x100000]); + } + else + { + result = 0; + } + } + /*else if (address >= 0x800000 && address <= 0x81ffff) + { + result = (sbyte)Memory.mainram[address - 0x800000]; + }*/ + return result; + } + public static sbyte MReadByte(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address >= 0 && address <= 0x1ffff) + { + result = (sbyte)(mainbiosrom[address]); + } + else if (address >= 0x100000 && address <= 0x3fffff) + { + if (address < 0x100000 + Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address - 0x100000]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address <= 0x81ffff) + { + result = (sbyte)Memory.mainram[address - 0x800000]; + } + else if (address >= 0x900000 && address <= 0x903fff) + { + result = (sbyte)pgm_bg_videoram[address - 0x900000]; + } + else if (address >= 0x904000 && address <= 0x905fff) + { + result = (sbyte)pgm_tx_videoram[address - 0x904000]; + } + else if (address >= 0x907000 && address <= 0x9077ff) + { + result = (sbyte)pgm_rowscrollram[address - 0x907000]; + } + else if (address >= 0xa00000 && address <= 0xa011ff) + { + int offset = (address - 0xa00000) / 2; + if ((address % 2) == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if ((address % 2) == 1) + { + result = (sbyte)(Generic.paletteram16[offset]); + } + } + else if (address >= 0xb00000 && address <= 0xb0ffff) + { + result = (sbyte)pgm_videoregs[address - 0xb00000]; + } + else if (address >= 0xc00002 && address <= 0xc00003) + { + result = (sbyte)Sound.latched_value[0]; + } + else if (address >= 0xc00004 && address <= 0xc00005) + { + result = (sbyte)Sound.latched_value[1]; + } + else if (address >= 0xc00006 && address <= 0xc00007) + { + result = (sbyte)PGM.pgm_calendar_r(); + } + else if (address >= 0xc0000c && address <= 0xc0000d) + { + result = (sbyte)Sound.latched_value[2]; + } + else if (address >= 0xc08000 && address <= 0xc08001) + { + result = (sbyte)short0; + } + else if (address >= 0xc08002 && address <= 0xc08003) + { + result = (sbyte)short1; + } + else if (address >= 0xc08004 && address <= 0xc08005) + { + result = (sbyte)short2; + } + else if (address >= 0xc08006 && address <= 0xc08007) + { + result = (sbyte)short3; + } + else if (address >= 0xc10000 && address <= 0xc1ffff) + { + result = (sbyte)z80_ram_r(address - 0xc10000); + } + return result; + } + public static short MReadOpWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0 && address + 1 <= 0x1ffff) + { + result = (short)(mainbiosrom[address] * 0x100 + mainbiosrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x3fffff) + { + if (address + 1 < 0x100000 + Memory.mainromLength) + { + result = (short)(Memory.mainrom[address - 0x100000] * 0x100 + Memory.mainrom[address - 0x100000 + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x81ffff) + { + result = (short)(Memory.mainram[address - 0x800000] * 0x100 + Memory.mainram[address - 0x800000 + 1]); + } + return result; + } + public static short MReadWord(int address) + { + address &= 0xffffff; + short result = 0; + if (address >= 0 && address + 1 <= 0x1ffff) + { + result = (short)(mainbiosrom[address] * 0x100 + mainbiosrom[address + 1]); + } + else if (address >= 0x100000 && address + 1 <= 0x3fffff) + { + if (address + 1 < 0x100000 + Memory.mainromLength) + { + result = (short)(Memory.mainrom[address - 0x100000] * 0x100 + Memory.mainrom[address - 0x100000 + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x81ffff) + { + result = (short)(Memory.mainram[address - 0x800000] * 0x100 + Memory.mainram[address - 0x800000 + 1]); + } + else if (address >= 0x900000 && address + 1 <= 0x903fff) + { + result = (short)(pgm_bg_videoram[address - 0x900000] * 0x100 + pgm_bg_videoram[address - 0x900000 + 1]); + } + else if (address >= 0x904000 && address + 1 <= 0x905fff) + { + result = (short)(pgm_tx_videoram[address - 0x904000] * 0x100 + pgm_tx_videoram[address - 0x904000 + 1]); + } + else if (address >= 0x907000 && address + 1 <= 0x9077ff) + { + result = (short)(pgm_rowscrollram[address - 0x907000] * 0x100 + pgm_rowscrollram[address - 0x907000 + 1]); + } + else if (address >= 0xa00000 && address + 1 <= 0xa011ff) + { + int offset = (address - 0xa0000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0xb00000 && address + 1 <= 0xb0ffff) + { + result = (short)(pgm_videoregs[address - 0xb00000] * 0x100 + pgm_videoregs[address - 0xb00000 + 1]); + } + else if (address >= 0xc00002 && address + 1 <= 0xc00003) + { + result = (short)Sound.latched_value[0]; + } + else if (address >= 0xc00004 && address + 1 <= 0xc00005) + { + result = (short)Sound.latched_value[1]; + } + else if (address >= 0xc00006 && address + 1 <= 0xc00007) + { + result = (short)PGM.pgm_calendar_r(); + } + else if (address >= 0xc0000c && address + 1 <= 0xc0000d) + { + result = (short)Sound.latched_value[2]; + } + else if (address >= 0xc08000 && address + 1 <= 0xc08001) + { + result = short0; + } + else if (address >= 0xc08002 && address + 1 <= 0xc08003) + { + result = short1; + } + else if (address >= 0xc08004 && address + 1 <= 0xc08005) + { + result = short2; + } + else if (address >= 0xc08006 && address + 1 <= 0xc08007) + { + result = short3; + } + else if (address >= 0xc10000 && address + 1 <= 0xc1ffff) + { + result = (short)(z80_ram_r(address - 0xc10000) * 0x100 + z80_ram_r(address - 0xc10000 + 1)); + } + return result; + } + public static int MReadOpLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0 && address + 3 <= 0x1ffff) + { + result = mainbiosrom[address] * 0x1000000 + mainbiosrom[address + 1] * 0x10000 + mainbiosrom[address + 2] * 0x100 + mainbiosrom[address + 3]; + } + else if (address >= 0x100000 && address + 3 <= 0x3fffff) + { + 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]; + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 3 <= 0x81ffff) + { + result = Memory.mainram[address - 0x800000] * 0x1000000 + Memory.mainram[address - 0x800000 + 1] * 0x10000 + Memory.mainram[address - 0x800000 + 2] * 0x100 + Memory.mainram[address - 0x800000 + 3]; + } + return result; + } + public static int MReadLong(int address) + { + address &= 0xffffff; + int result = 0; + if (address >= 0 && address + 1 <= 0x1ffff) + { + result = mainbiosrom[address] * 0x1000000 + mainbiosrom[address + 1] * 0x10000 + mainbiosrom[address + 2] * 0x100 + mainbiosrom[address + 3]; + } + else if (address >= 0x100000 && address + 3 <= 0x3fffff) + { + 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]; + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 3 <= 0x81ffff) + { + result = Memory.mainram[address - 0x800000] * 0x1000000 + Memory.mainram[address - 0x800000 + 1] * 0x10000 + Memory.mainram[address - 0x800000 + 2] * 0x100 + Memory.mainram[address - 0x800000 + 3]; + } + else if (address >= 0x900000 && address + 3 <= 0x903fff) + { + result = pgm_bg_videoram[address - 0x900000] * 0x1000000 + pgm_bg_videoram[address - 0x900000 + 1] * 0x10000 + pgm_bg_videoram[address - 0x900000 + 2] * 0x100 + pgm_bg_videoram[address - 0x900000 + 3]; + } + else if (address >= 0x904000 && address + 3 <= 0x905fff) + { + result = pgm_tx_videoram[address - 0x904000] * 0x1000000 + pgm_tx_videoram[address - 0x904000 + 1] * 0x10000 + pgm_tx_videoram[address - 0x904000 + 2] * 0x100 + pgm_tx_videoram[address - 0x904000 + 3]; + } + else if (address >= 0x907000 && address + 3 <= 0x9077ff) + { + result = pgm_rowscrollram[address - 0x907000] * 0x1000000 + pgm_rowscrollram[address - 0x907000 + 1] * 0x10000 + pgm_rowscrollram[address - 0x907000 + 2] * 0x100 + pgm_rowscrollram[address - 0x907000 + 3]; + } + else if (address >= 0xa00000 && address + 3 <= 0xa011ff) + { + int offset = (address - 0xa00000) / 2; + result = Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]; + } + else if (address >= 0xb00000 && address + 3 <= 0xb0ffff) + { + result = pgm_videoregs[address - 0xb00000] * 0x1000000 + pgm_videoregs[address - 0xb00000 + 1] * 0x10000 + pgm_videoregs[address - 0xb00000 + 2] * 0x100 + pgm_videoregs[address - 0xb00000 + 3]; + } + /*else if (address >= 0xc00002 && address + 3 <= 0xc00003) + { + result = (short)Sound.ulatched_value[0]; + } + else if (address >= 0xc00004 && address + 3 <= 0xc00005) + { + result = (short)Sound.ulatched_value[1]; + } + else if (address >= 0xc00006 && address + 3 <= 0xc00007) + { + result = (short)Pgm.pgm_calendar_r(); + } + else if (address >= 0xc0000c && address + 3 <= 0xc0000d) + { + result = (short)Sound.ulatched_value[2]; + }*/ + else if (address >= 0xc08000 && address + 3 <= 0xc08003) + { + result = (int)(((ushort)short0 << 16) | (ushort)short1); + } + else if (address >= 0xc08002 && address + 3 <= 0xc08005) + { + result = short1; + } + else if (address >= 0xc08004 && address + 3 <= 0xc08007) + { + result = short2; + } + else if (address >= 0xc08006 && address + 3 <= 0xc08009) + { + result = short3; + } + else if (address >= 0xc10000 && address + 3 <= 0xc1ffff) + { + result = z80_ram_r(address - 0xc10000) * 0x1000000 + z80_ram_r(address - 0xc10000 + 1) * 0x10000 + z80_ram_r(address - 0xc10000 + 2) * 0x100 + z80_ram_r(address - 0xc10000 + 3); + } + return result; + } + public static void MWriteByte(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x700006 && address <= 0x700007) + { + //NOP; + } + else if (address >= 0x800000 && address <= 0x81ffff) + { + int offset = address - 0x800000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x900000 && address <= 0x903fff) + { + int offset = address - 0x900000; + pgm_bg_videoram_w(offset, (byte)value); + } + else if (address >= 0x904000 && address <= 0x905fff) + { + int offset = address - 0x904000; + pgm_tx_videoram_w(offset, (byte)value); + } + else if (address >= 0x907000 && address <= 0x9077ff) + { + int offset = address - 0x907000; + pgm_rowscrollram[offset] = (byte)value; + } + else if (address >= 0xa00000 && address <= 0xa011ff) + { + int offset = (address - 0xa00000) / 2; + if ((address % 2) == 0) + { + Generic.paletteram16[offset] = (ushort)(((byte)value << 8) | (Generic.paletteram16[offset] & 0xff)); + } + else if ((address % 2) == 1) + { + Generic.paletteram16[offset] = (ushort)((Generic.paletteram16[offset] & 0xff00) | (byte)value); + } + Generic.paletteram16_xRRRRRGGGGGBBBBB_word_w(offset); + } + else if (address >= 0xb00000 && address <= 0xb0ffff) + { + int offset = address - 0xb00000; + pgm_videoregs[offset] = (byte)value; + } + else if (address >= 0xc00002 && address <= 0xc00003) + { + if (address == 0xc00003) + { + m68k_l1_w((byte)value); + } + } + else if (address >= 0xc00004 && address <= 0xc00005) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0xc00006 && address <= 0xc00007) + { + if (address == 0xc00006) + { + int i1 = 1; + } + else if (address == 0xc00007) + { + pgm_calendar_w((ushort)value); + } + } + else if (address >= 0xc00008 && address <= 0xc00009) + { + z80_reset_w((ushort)value); + } + else if (address >= 0xc0000a && address <= 0xc0000b) + { + z80_ctrl_w(); + } + else if (address >= 0xc0000c && address <= 0xc0000d) + { + Sound.soundlatch3_w((ushort)value); + } + else if (address >= 0xc10000 && address <= 0xc1ffff) + { + int offset = address - 0xc10000; + z80_ram_w(offset, (byte)value); + } + else + { + int i1 = 1; + } + } + public static void MWriteWord(int address, short value) + { + address &= 0xffffff; + if (address >= 0x700006 && address + 1 <= 0x700007) + { + //NOP; + } + else if (address >= 0x800000 && address + 1 <= 0x81ffff) + { + int offset = address - 0x800000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x900000 && address + 1 <= 0x903fff) + { + int offset = (address - 0x900000) / 2; + pgm_bg_videoram_w(offset, (ushort)value); + } + else if (address >= 0x904000 && address + 1 <= 0x905fff) + { + int offset = (address - 0x904000) / 2; + pgm_tx_videoram_w(offset, (ushort)value); + } + else if (address >= 0x907000 && address + 1 <= 0x9077ff) + { + int offset = (address - 0x907000) / 2; + pgm_rowscrollram[offset * 2] = (byte)(value >> 8); + pgm_rowscrollram[offset * 2 + 1] = (byte)value; + } + else if (address >= 0xa00000 && address + 1 <= 0xa011ff) + { + int offset = (address - 0xa00000) / 2; + Generic.paletteram16[offset] = (ushort)value; + Generic.paletteram16_xRRRRRGGGGGBBBBB_word_w(offset); + } + else if (address >= 0xb00000 && address + 1 <= 0xb0ffff) + { + int offset = (address - 0xb00000) / 2; + pgm_videoregs[offset * 2] = (byte)(value >> 8); + pgm_videoregs[offset * 2 + 1] = (byte)value; + } + else if (address >= 0xc00002 && address + 1 <= 0xc00003) + { + m68k_l1_w((ushort)value); + } + else if (address >= 0xc00004 && address + 1 <= 0xc00005) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0xc00006 && address + 1 <= 0xc00007) + { + pgm_calendar_w((ushort)value); + } + else if (address >= 0xc00008 && address + 1 <= 0xc00009) + { + z80_reset_w((ushort)value); + } + else if (address >= 0xc0000a && address + 1 <= 0xc0000b) + { + z80_ctrl_w(); + } + else if (address >= 0xc0000c && address + 1 <= 0xc0000d) + { + Sound.soundlatch3_w((ushort)value); + } + else if (address >= 0xc10000 && address + 1 <= 0xc1ffff) + { + int offset = address - 0xc10000; + z80_ram_w(offset, (byte)(value >> 8)); + z80_ram_w(offset + 1, (byte)value); + } + else + { + int i1 = 1; + } + } + public static void MWriteLong(int address, int value) + { + address &= 0xffffff; + if (address >= 0x700006 && address + 3 <= 0x700007) + { + //NOP; + } + else if (address >= 0x800000 && address + 3 <= 0x81ffff) + { + int offset = address - 0x800000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x900000 && address + 3 <= 0x903fff) + { + int offset = (address - 0x900000) / 2; + pgm_bg_videoram_w(offset, (ushort)(value >> 16)); + pgm_bg_videoram_w(offset + 1, (ushort)value); + } + else if (address >= 0x904000 && address + 3 <= 0x905fff) + { + int offset = (address - 0x904000) / 2; + pgm_tx_videoram_w(offset, (ushort)(value >> 16)); + pgm_tx_videoram_w(offset + 1, (ushort)value); + } + else if (address >= 0x907000 && address + 3 <= 0x9077ff) + { + int offset = (address - 0x907000) / 2; + pgm_rowscrollram[offset * 2] = (byte)(value >> 24); + pgm_rowscrollram[offset * 2 + 1] = (byte)(value >> 16); + pgm_rowscrollram[offset * 2 + 2] = (byte)(value >> 8); + pgm_rowscrollram[offset * 2 + 3] = (byte)value; + } + else if (address >= 0xa00000 && address + 3 <= 0xa011ff) + { + int offset = (address - 0xa00000) / 2; + Generic.paletteram16[offset] = (ushort)(value >> 16); + Generic.paletteram16[offset + 1] = (ushort)value; + Generic.paletteram16_xRRRRRGGGGGBBBBB_word_w(offset); + Generic.paletteram16_xRRRRRGGGGGBBBBB_word_w(offset + 1); + } + else if (address >= 0xb00000 && address + 3 <= 0xb0ffff) + { + int offset = (address - 0xb00000) / 2; + pgm_videoregs[offset * 2] = (byte)(value >> 24); + pgm_videoregs[offset * 2 + 1] = (byte)(value >> 16); + pgm_videoregs[offset * 2 + 2] = (byte)(value >> 8); + pgm_videoregs[offset * 2 + 3] = (byte)value; + } + /*else if (address >= 0xc00002 && address + 3 <= 0xc00003) + { + m68k_l1_w((ushort)value); + } + else if (address >= 0xc00004 && address + 3 <= 0xc00005) + { + Sound.soundlatch2_w((ushort)value); + } + else if (address >= 0xc00006 && address + 3 <= 0xc00007) + { + pgm_calendar_w((ushort)value); + } + else if (address >= 0xc00008 && address + 3 <= 0xc00009) + { + z80_reset_w((ushort)value); + } + else if (address >= 0xc0000a && address + 3 <= 0xc0000b) + { + z80_ctrl_w(); + } + else if (address >= 0xc0000c && address + 3 <= 0xc0000d) + { + Sound.soundlatch3_w((ushort)value); + }*/ + else if (address >= 0xc10000 && address + 3 <= 0xc1ffff) + { + int offset = address - 0xc10000; + z80_ram_w(offset, (byte)(value >> 24)); + z80_ram_w(offset + 1, (byte)(value >> 16)); + z80_ram_w(offset + 2, (byte)(value >> 8)); + z80_ram_w(offset + 3, (byte)value); + } + else + { + int i1 = 1; + } + } + public static byte ZReadMemory(ushort address) + { + byte result = Memory.audioram[address]; + return result; + } + public static void ZWriteMemory(ushort address, byte value) + { + Memory.audioram[address] = value; + } + public static byte ZReadHardware(ushort address) + { + byte result = 0; + if (address >= 0x8000 && address <= 0x8003) + { + int offset = address - 0x8000; + result = ICS2115.ics2115_r(offset); + } + else if (address >= 0x8100 && address <= 0x81ff) + { + result = (byte)Sound.soundlatch3_r(); + } + else if (address >= 0x8200 && address <= 0x82ff) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address >= 0x8400 && address <= 0x84ff) + { + result = (byte)Sound.soundlatch2_r(); + } + return result; + } + public static void ZWriteHardware(ushort address, byte value) + { + if (address >= 0x8000 && address <= 0x8003) + { + int offset = address - 0x8000; + ICS2115.ics2115_w(offset, value); + } + else if (address >= 0x8100 && address <= 0x81ff) + { + z80_l3_w(value); + } + else if (address >= 0x8200 && address <= 0x82ff) + { + Sound.soundlatch_w((ushort)value); + } + else if (address >= 0x8400 && address <= 0x84ff) + { + Sound.soundlatch2_w((ushort)value); + } + } + public static int ZIRQCallback() + { + return 0; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory.cs.meta new file mode 100644 index 00000000..e59b1da4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3ca29a0d3a989f41bd4c9740b3d034f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory2.cs new file mode 100644 index 00000000..f47ef5d5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory2.cs @@ -0,0 +1,148 @@ +namespace MAME.Core +{ + public partial class PGM + { + public static sbyte MPReadByte_orlegend(int address) + { + sbyte result; + address &= 0xffffff; + if (address == 0xc0400f) + { + result = (sbyte)pgm_asic3_r(); + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MPReadWord_orlegend(int address) + { + short result; + address &= 0xffffff; + if (address == 0xc0400e) + { + result = (short)pgm_asic3_r(); + } + else + { + result = MReadWord(address); + } + return result; + } + public static void MPWriteByte_orlegend(int address, sbyte value) + { + address &= 0xffffff; + if (address == 0xc04001) + { + pgm_asic3_reg_w((ushort)value); + } + else if (address == 0xc0400f) + { + pgm_asic3_w((ushort)value); + } + else + { + MWriteByte(address, value); + } + } + public static void MPWriteWord_orlegend(int address, short value) + { + address &= 0xffffff; + if (address == 0xc04000) + { + pgm_asic3_reg_w((ushort)value); + } + else if (address == 0xc0400e) + { + pgm_asic3_w((ushort)value); + } + else + { + MWriteWord(address, value); + } + } + public static sbyte MPReadByte_drgw2(int address) + { + sbyte result; + address &= 0xffffff; + if (address >= 0xd80000 && address <= 0xd80003) + { + result = 0; + } + else + { + result = MReadByte(address); + } + return result; + } + public static short MPReadWord_drgw2(int address) + { + short result; + address &= 0xffffff; + if (address == 0xd80000 && address + 1 <= 0xd80003) + { + int offset = (address - 0xd80000) / 2; + result = (short)killbld_igs025_prot_r(offset); + } + else + { + result = MReadWord(address); + } + return result; + } + public static int MPReadLong_drgw2(int address) + { + int result; + address &= 0xffffff; + if (address == 0xd80000 && address + 3 <= 0xd80003) + { + result = 0; + } + else + { + result = MReadLong(address); + } + return result; + } + public static void MPWriteByte_drgw2(int address, sbyte value) + { + address &= 0xffffff; + if (address == 0xd80000 && address <= 0xd80003) + { + int offset = (address - 0xd80000) / 2; + //drgw2_d80000_protection_w(offset, (ushort)value); + } + else + { + MWriteByte(address, value); + } + } + public static void MPWriteWord_drgw2(int address, short value) + { + address &= 0xffffff; + if (address == 0xd80000 && address + 1 <= 0xd80003) + { + int offset = (address - 0xd80000) / 2; + drgw2_d80000_protection_w(offset, (ushort)value); + } + else + { + MWriteWord(address, value); + } + } + public static void MPWriteLong_drgw2(int address, int value) + { + address &= 0xffffff; + if (address == 0xd80000 && address + 3 <= 0xd80003) + { + int offset = (address - 0xd80000) / 2; + //drgw2_d80000_protection_w(offset, (ushort)value); + } + else + { + MWriteLong(address, value); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory2.cs.meta new file mode 100644 index 00000000..b83c812d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 755d4b0bd05d011458272fab971a9f8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/PGM.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/PGM.cs new file mode 100644 index 00000000..ccfc7e21 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/PGM.cs @@ -0,0 +1,261 @@ +using cpu.m68000; +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class PGM + { + public static byte[] mainbiosrom, videobios, audiobios; + public static byte[] pgm_bg_videoram, pgm_tx_videoram, pgm_rowscrollram, pgm_videoregs, sprmaskrom, sprcolrom, tilesrom, /*tiles1rom,*/ /*tiles2rom, */pgm_sprite_a_region; + public static byte CalVal, CalMask, CalCom = 0, CalCnt = 0; + public static uint[] arm7_shareram; + public static uint arm7_latch; + public static int pgm_sprite_a_region_allocate; + + #region //指针化 tiles1rom + static byte[] tiles1rom_src; + static GCHandle tiles1rom_handle; + public static byte* tiles1rom; + public static int tiles1romLength; + public static bool tiles1rom_IsNull => tiles1rom == null; + public static byte[] tiles1rom_set + { + set + { + tiles1rom_handle.ReleaseGCHandle(); + if (value == null) + return; + tiles1rom_src = value; + tiles1romLength = value.Length; + tiles1rom_src.GetObjectPtr(ref tiles1rom_handle, ref tiles1rom); + } + } + #endregion + + #region //指针化 tiles2rom + static byte[] tiles2rom_src; + static GCHandle tiles2rom_handle; + public static byte* tiles2rom; + public static int tiles2romLength; + public static bool tiles2rom_IsNull => tiles2rom == null; + public static byte[] tiles2rom_set + { + set + { + tiles2rom_handle.ReleaseGCHandle(); + if (value == null) + return; + tiles2rom_src = value; + tiles2romLength = value.Length; + tiles2rom_src.GetObjectPtr(ref tiles2rom_handle, ref tiles2rom); + } + } + #endregion + + public static void PGMInit() + { + Machine.bRom = true; + mainbiosrom = MameMainMotion.resource.pgmmainbios; + videobios = MameMainMotion.resource.pgmvideobios; + audiobios = MameMainMotion.resource.pgmaudiobios; + ICS2115.icsrom = audiobios; + byte[] bb1, bb2; + int i3, n1, n2, n3; + bb1 = Machine.GetRom("ics.rom"); + bb2 = Machine.GetRom("tiles.rom"); + if (bb1 == null) + { + bb1 = new byte[0]; + } + n1 = bb1.Length; + n2 = bb2.Length; + ICS2115.icsrom = new byte[0x400000 + n1]; + Array.Copy(audiobios, ICS2115.icsrom, 0x200000); + Array.Copy(bb1, 0, ICS2115.icsrom, 0x400000, n1); + tilesrom = new byte[0x400000 + n2]; + Array.Copy(videobios, tilesrom, 0x200000); + Array.Copy(bb2, 0, tilesrom, 0x400000, n2); + n3 = tilesrom.Length; + tiles1rom_set = new byte[n3 * 2]; + for (i3 = 0; i3 < n3; i3++) + { + tiles1rom[i3 * 2] = (byte)(tilesrom[i3] & 0x0f); + tiles1rom[i3 * 2 + 1] = (byte)(tilesrom[i3] >> 4); + } + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + sprmaskrom = Machine.GetRom("sprmask.rom"); + sprcolrom = Machine.GetRom("sprcol.rom"); + expand_32x32x5bpp(); + expand_colourdata(); + Memory.Set_mainram(new byte[0x20000]); + pgm_bg_videoram = new byte[0x4000]; + pgm_tx_videoram = new byte[0x2000]; + pgm_rowscrollram = new byte[0x800]; + Generic.paletteram16_set = new ushort[0x900]; + pgm_videoregs = new byte[0x10000]; + Memory.Set_audioram(new byte[0x10000]); + if (Memory.mainrom_IsNull || sprmaskrom == null || pgm_sprite_a_region == null) + { + Machine.bRom = false; + } + } + private static void expand_32x32x5bpp() + { + int n2 = tilesrom.Length / 5 * 8; + tiles2rom_set = new byte[n2]; + int cnt; + byte pix; + for (cnt = 0; cnt < tilesrom.Length / 5; cnt++) + { + pix = (byte)((tilesrom[0 + 5 * cnt] >> 0) & 0x1f); tiles2rom[0 + 8 * cnt] = pix; + pix = (byte)(((tilesrom[0 + 5 * cnt] >> 5) & 0x07) | ((tilesrom[1 + 5 * cnt] << 3) & 0x18)); tiles2rom[1 + 8 * cnt] = pix; + pix = (byte)((tilesrom[1 + 5 * cnt] >> 2) & 0x1f); tiles2rom[2 + 8 * cnt] = pix; + pix = (byte)(((tilesrom[1 + 5 * cnt] >> 7) & 0x01) | ((tilesrom[2 + 5 * cnt] << 1) & 0x1e)); tiles2rom[3 + 8 * cnt] = pix; + pix = (byte)(((tilesrom[2 + 5 * cnt] >> 4) & 0x0f) | ((tilesrom[3 + 5 * cnt] << 4) & 0x10)); tiles2rom[4 + 8 * cnt] = pix; + pix = (byte)((tilesrom[3 + 5 * cnt] >> 1) & 0x1f); tiles2rom[5 + 8 * cnt] = pix; + pix = (byte)(((tilesrom[3 + 5 * cnt] >> 6) & 0x03) | ((tilesrom[4 + 5 * cnt] << 2) & 0x1c)); tiles2rom[6 + 8 * cnt] = pix; + pix = (byte)((tilesrom[4 + 5 * cnt] >> 3) & 0x1f); tiles2rom[7 + 8 * cnt] = pix; + } + } + private static void expand_colourdata() + { + int srcsize = sprcolrom.Length; + int cnt; + int needed = srcsize / 2 * 3; + int pgm_sprite_a_region_allocate = 1; + int colpack; + while (pgm_sprite_a_region_allocate < needed) + { + pgm_sprite_a_region_allocate = pgm_sprite_a_region_allocate << 1; + } + pgm_sprite_a_region = new byte[pgm_sprite_a_region_allocate]; + for (cnt = 0; cnt < srcsize / 2; cnt++) + { + colpack = sprcolrom[cnt * 2] | (sprcolrom[cnt * 2 + 1] << 8); + pgm_sprite_a_region[cnt * 3 + 0] = (byte)((colpack >> 0) & 0x1f); + pgm_sprite_a_region[cnt * 3 + 1] = (byte)((colpack >> 5) & 0x1f); + pgm_sprite_a_region[cnt * 3 + 2] = (byte)((colpack >> 10) & 0x1f); + } + } + public static void machine_reset_pgm() + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_HALT, LineState.ASSERT_LINE); + device_reset(); + } + public unsafe static byte z80_ram_r(int offset) + { + return Memory.audioram[offset]; + } + public unsafe static void z80_ram_w(int offset, byte data) + { + int pc = MC68000.m1.PC; + Memory.audioram[offset] = data; + if (pc != 0xf12 && pc != 0xde2 && pc != 0x100c50 && pc != 0x100b20) + { + //error + } + } + public static void z80_reset_w(ushort data) + { + if (data == 0x5050) + { + ICS2115.ics2115_reset(); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_HALT, LineState.CLEAR_LINE); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, LineState.PULSE_LINE); + } + else + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_HALT, LineState.ASSERT_LINE); + } + } + public static void z80_ctrl_w() + { + + } + public static void m68k_l1_w(byte data) + { + //if(ACCESSING_BITS_0_7) + Sound.soundlatch_w(data); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + public static void m68k_l1_w(ushort data) + { + Sound.soundlatch_w(data); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + public static void z80_l3_w(byte data) + { + Sound.soundlatch3_w(data); + } + public static void sound_irq(int level) + { + Cpuint.cpunum_set_input_line(1, 0, (LineState)level); + } + public static byte bcd(byte data) + { + return (byte)(((data / 10) << 4) | (data % 10)); + } + public static byte pgm_calendar_r() + { + byte calr; + calr = (byte)(((CalVal & CalMask) != 0) ? 1 : 0); + CalMask <<= 1; + return calr; + } + public static void pgm_calendar_w(ushort data) + { + //DateTime time = DateTime.Now; + DateTime time = DateTime.Parse("1970-01-01 08:00:00"); + CalCom <<= 1; + CalCom |= (byte)(data & 1); + ++CalCnt; + if (CalCnt == 4) + { + CalMask = 1; + CalVal = 1; + CalCnt = 0; + switch (CalCom & 0xf) + { + case 1: + case 3: + case 5: + case 7: + case 9: + case 0xb: + case 0xd: + CalVal++; + break; + case 0: + CalVal = bcd((byte)time.DayOfWeek); //?? + break; + case 2: //Hours + CalVal = bcd((byte)time.Hour); + break; + case 4: //Seconds + CalVal = bcd((byte)time.Second); + break; + case 6: //Month + CalVal = bcd((byte)(time.Month)); //?? not bcd in MVS + break; + case 8: + CalVal = 0; //Controls blinking speed, maybe milliseconds + break; + case 0xa: //Day + CalVal = bcd((byte)time.Day); + break; + case 0xc: //Minute + CalVal = bcd((byte)time.Minute); + break; + case 0xe: //Year + CalVal = bcd((byte)(time.Year % 100)); + break; + case 0xf: //Load Date + //mame_get_base_datetime(machine, &systime); + break; + } + } + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/PGM.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/PGM.cs.meta new file mode 100644 index 00000000..546b9ef6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/PGM.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 997e22304c37a4b45806ec2c73d3ec1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Pgmprot.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Pgmprot.cs new file mode 100644 index 00000000..6fed266e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Pgmprot.cs @@ -0,0 +1,120 @@ +namespace MAME.Core +{ + public partial class PGM + { + public static byte asic3_reg, asic3_x; + public static byte[] asic3_latch = new byte[3]; + public static ushort asic3_hold, asic3_hilo; + public static int bt(uint v, int bit) + { + if ((v & (1 << bit)) != 0) + { + return 1; + } + else + { + return 0; + } + } + public static void asic3_compute_hold(int y, int z) + { + ushort old = asic3_hold; + asic3_hold = (ushort)((old << 1) | (old >> 15)); + asic3_hold ^= 0x2bad; + asic3_hold ^= (ushort)BIT(z, y); + asic3_hold ^= (ushort)(BIT(asic3_x, 2) << 10); + asic3_hold ^= (ushort)BIT(old, 5); + switch (short4) + { + case 0: + case 1: + asic3_hold ^= (ushort)(BIT(old, 10) ^ BIT(old, 8) ^ (BIT(asic3_x, 0) << 1) ^ (BIT(asic3_x, 1) << 6) ^ (BIT(asic3_x, 3) << 14)); + break; + case 2: + asic3_hold ^= (ushort)(BIT(old, 10) ^ BIT(old, 8) ^ (BIT(asic3_x, 0) << 4) ^ (BIT(asic3_x, 1) << 6) ^ (BIT(asic3_x, 3) << 12)); + break; + case 3: + asic3_hold ^= (ushort)(BIT(old, 7) ^ BIT(old, 6) ^ (BIT(asic3_x, 0) << 4) ^ (BIT(asic3_x, 1) << 6) ^ (BIT(asic3_x, 3) << 12)); + break; + case 4: + asic3_hold ^= (ushort)(BIT(old, 7) ^ BIT(old, 6) ^ (BIT(asic3_x, 0) << 3) ^ (BIT(asic3_x, 1) << 8) ^ (BIT(asic3_x, 3) << 14)); + break; + } + } + public static ushort pgm_asic3_r() + { + byte res = 0; + switch (asic3_reg) + { + case 0x00: + res = (byte)((asic3_latch[0] & 0xf7) | ((short4 << 3) & 0x08)); + break; + case 0x01: + res = asic3_latch[1]; + break; + case 0x02: + res = (byte)((asic3_latch[2] & 0x7f) | ((short4 << 6) & 0x80)); + break; + case 0x03: + res = (byte)BITSWAP8(asic3_hold, 5, 2, 9, 7, 10, 13, 12, 15); + break; + case 0x20: res = 0x49; break; + case 0x21: res = 0x47; break; + case 0x22: res = 0x53; break; + case 0x24: res = 0x41; break; + case 0x25: res = 0x41; break; + case 0x26: res = 0x7f; break; + case 0x27: res = 0x41; break; + case 0x28: res = 0x41; break; + case 0x2a: res = 0x3e; break; + case 0x2b: res = 0x41; break; + case 0x2c: res = 0x49; break; + case 0x2d: res = 0xf9; break; + case 0x2e: res = 0x0a; break; + case 0x30: res = 0x26; break; + case 0x31: res = 0x49; break; + case 0x32: res = 0x49; break; + case 0x33: res = 0x49; break; + case 0x34: res = 0x32; break; + } + return res; + } + public static void pgm_asic3_w(ushort data) + { + //if(ACCESSING_BITS_0_7) + { + if (asic3_reg < 3) + asic3_latch[asic3_reg] = (byte)(data << 1); + else if (asic3_reg == 0x40) + { + asic3_hilo = (ushort)((asic3_hilo << 8) | data); + } + else if (asic3_reg == 0x48) + { + asic3_x = 0; + if ((asic3_hilo & 0x0090) == 0) + asic3_x |= 0x01; + if ((asic3_hilo & 0x0006) == 0) + asic3_x |= 0x02; + if ((asic3_hilo & 0x9000) == 0) + asic3_x |= 0x04; + if ((asic3_hilo & 0x0a00) == 0) + asic3_x |= 0x08; + } + else if (asic3_reg >= 0x80 && asic3_reg <= 0x87) + { + asic3_compute_hold(asic3_reg & 0x07, data); + } + else if (asic3_reg == 0xa0) + { + asic3_hold = 0; + } + } + } + public static void pgm_asic3_reg_w(ushort data) + { + //if(ACCESSING_BITS_0_7) + asic3_reg = (byte)(data & 0xff); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Pgmprot.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Pgmprot.cs.meta new file mode 100644 index 00000000..7185a19b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Pgmprot.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8bd824acac237b6449a3050d3b8f6d14 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/State.cs new file mode 100644 index 00000000..364a28e5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/State.cs @@ -0,0 +1,114 @@ +using cpu.m68000; +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class PGM + { + public unsafe static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + writer.Write(pgm_tx_videoram, 0, 0x2000); + writer.Write(pgm_bg_videoram, 0, 0x4000); + writer.Write(pgm_rowscrollram, 0, 0x800); + writer.Write(pgm_videoregs, 0, 0x10000); + writer.Write(CalVal); + writer.Write(CalMask); + writer.Write(CalCom); + writer.Write(CalCnt); + writer.Write(asic3_reg); + writer.Write(asic3_x); + for (i = 0; i < 3; i++) + { + writer.Write(asic3_latch[i]); + } + writer.Write(asic3_hold); + writer.Write(asic3_hilo); + for (i = 0; i < 0x900; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x901; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x20000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x10000); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + ICS2115.SaveStateBinary(writer); + for (i = 0; i < 3; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 3; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(Sound.ics2115stream.output_sampindex); + writer.Write(Sound.ics2115stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + pgm_tx_videoram = reader.ReadBytes(0x2000); + pgm_bg_videoram = reader.ReadBytes(0x4000); + pgm_rowscrollram = reader.ReadBytes(0x800); + pgm_videoregs = reader.ReadBytes(0x10000); + CalVal = reader.ReadByte(); + CalMask = reader.ReadByte(); + CalCom = reader.ReadByte(); + CalCnt = reader.ReadByte(); + asic3_reg = reader.ReadByte(); + asic3_x = reader.ReadByte(); + for (i = 0; i < 3; i++) + { + asic3_latch[i] = reader.ReadByte(); + } + asic3_hold = reader.ReadUInt16(); + asic3_hilo = reader.ReadUInt16(); + for (i = 0; i < 0x900; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x901; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x20000)); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x10000)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + ICS2115.LoadStateBinary(reader); + for (i = 0; i < 3; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 3; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + Sound.ics2115stream.output_sampindex = reader.ReadInt32(); + Sound.ics2115stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/State.cs.meta new file mode 100644 index 00000000..133d7da3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e43816b5eb1c1d4eaf0b1dd980ee4ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Tilemap.cs new file mode 100644 index 00000000..f88654e2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Tilemap.cs @@ -0,0 +1,291 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class PGM + { + public static Tmap pgm_tx_tilemap, pgm_bg_tilemap; + public static void tilemap_init() + { + int i; + pgm_tx_tilemap = new Tmap(); + pgm_tx_tilemap.rows = 32; + pgm_tx_tilemap.cols = 64; + pgm_tx_tilemap.tilewidth = 8; + pgm_tx_tilemap.tileheight = 8; + pgm_tx_tilemap.width = 0x200; + pgm_tx_tilemap.height = 0x100; + pgm_tx_tilemap.enable = true; + pgm_tx_tilemap.all_tiles_dirty = true; + pgm_tx_tilemap.pixmap = new ushort[0x100 * 0x200]; + pgm_tx_tilemap.flagsmap = new byte[0x100, 0x200]; + pgm_tx_tilemap.tileflags = new byte[0x20, 0x40]; + pgm_tx_tilemap.tile_update3 = pgm_tx_tilemap.tile_updatePgmtx; + pgm_tx_tilemap.tilemap_draw_instance3 = pgm_tx_tilemap.tilemap_draw_instancePgm; + pgm_tx_tilemap.total_elements = 0x800000 / 0x20; + pgm_tx_tilemap.pen_data_set = new byte[0x40]; + pgm_tx_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 15; i++) + { + pgm_tx_tilemap.pen_to_flags[0, i] = 0x10; + } + pgm_tx_tilemap.pen_to_flags[0, 15] = 0; + pgm_tx_tilemap.scrollrows = 1; + pgm_tx_tilemap.scrollcols = 1; + pgm_tx_tilemap.rowscroll = new int[pgm_tx_tilemap.scrollrows]; + pgm_tx_tilemap.colscroll = new int[pgm_tx_tilemap.scrollcols]; + pgm_bg_tilemap = new Tmap(); + pgm_bg_tilemap.cols = 64; + pgm_bg_tilemap.rows = 64; + pgm_bg_tilemap.tilewidth = 32; + pgm_bg_tilemap.tileheight = 32; + pgm_bg_tilemap.width = 0x800; + pgm_bg_tilemap.height = 0x800; + pgm_bg_tilemap.enable = true; + pgm_bg_tilemap.all_tiles_dirty = true; + pgm_bg_tilemap.pixmap = new ushort[0x800 * 0x800]; + pgm_bg_tilemap.flagsmap = new byte[0x800, 0x800]; + pgm_bg_tilemap.tileflags = new byte[0x40, 0x40]; + pgm_bg_tilemap.tile_update3 = pgm_bg_tilemap.tile_updatePgmbg; + pgm_bg_tilemap.tilemap_draw_instance3 = pgm_bg_tilemap.tilemap_draw_instancePgm; + pgm_bg_tilemap.total_elements = 0x3333; + pgm_bg_tilemap.pen_data_set = new byte[0x400]; + pgm_bg_tilemap.pen_to_flags = new byte[1, 32]; + for (i = 0; i < 31; i++) + { + pgm_bg_tilemap.pen_to_flags[0, i] = 0x10; + } + pgm_bg_tilemap.pen_to_flags[0, 31] = 0; + pgm_bg_tilemap.scrollrows = 64 * 32; + pgm_bg_tilemap.scrollcols = 1; + pgm_bg_tilemap.rowscroll = new int[pgm_bg_tilemap.scrollrows]; + pgm_bg_tilemap.colscroll = new int[pgm_bg_tilemap.scrollcols]; + } + } + public unsafe partial class Tmap + { + public void tile_updatePgmtx(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int tileno, colour, flipyx; + int code, tile_index, palette_base; + byte flags; + tile_index = row * PGM.pgm_tx_tilemap.cols + col; + tileno = (PGM.pgm_tx_videoram[tile_index * 4] * 0x100 + PGM.pgm_tx_videoram[tile_index * 4 + 1]) & 0xffff; + colour = (PGM.pgm_tx_videoram[tile_index * 4 + 3] & 0x3e) >> 1; + flipyx = (PGM.pgm_tx_videoram[tile_index * 4 + 3] & 0xc0) >> 6; + if (tileno > 0xbfff) + { + tileno -= 0xc000; + tileno += 0x20000; + } + code = tileno % PGM.pgm_tx_tilemap.total_elements; + flags = (byte)(flipyx & 3); + palette_base = 0x800 + 0x10 * colour; + tileflags[row, col] = tile_drawPgmtx(code * 0x40, x0, y0, palette_base, flags); + //tileflags[row, col] = tile_apply_bitmaskPgmtx(code << 3, x0, y0, flags); + //tileinfo_set( tileinfo, 0,tileno,colour,flipyx&3) + } + public byte tile_drawPgmtx(int pendata_offset, int x0, int y0, int palette_base, byte flags) + { + int height = tileheight; + int width = tilewidth; + int dx0 = 1, dy0 = 1; + int tx, ty; + int offset1 = 0; + int offsety1; + int xoffs; + byte andmask = 0xff, ormask = 0; + byte pen, map; + AxiArray.Copy(PGM.tiles1rom, pendata_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += height - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += width - 1; + dx0 = -1; + } + for (ty = 0; ty < height; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < width; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[0, pen]; + offset1++; + pixmap[offsety1 * 0x200 + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public unsafe void tilemap_draw_instancePgm(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + cur_trans = trans_t.WHOLLY_TRANSPARENT; + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + continue; + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x200 + xpos + x_start, x_end - x_start); + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Tilemap.priority_bitmap[offsety2 + ypos, i] = priority; + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = (ushort)(pixmap[offsety2 * width + i - xpos] + palette_offset); + Tilemap.priority_bitmap[offsety2 + ypos, i] = priority; + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tile_updatePgmbg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int tileno, colour, flipyx; + int code, tile_index, palette_base; + byte flags; + tile_index = row * PGM.pgm_bg_tilemap.cols + col; + tileno = (PGM.pgm_bg_videoram[tile_index * 4] * 0x100 + PGM.pgm_bg_videoram[tile_index * 4 + 1]) & 0xffff; + if (tileno > 0x7ff) + { + tileno += 0x1000; + } + colour = (PGM.pgm_bg_videoram[tile_index * 4 + 3] & 0x3e) >> 1; + flipyx = (PGM.pgm_bg_videoram[tile_index * 4 + 3] & 0xc0) >> 6; + code = tileno % PGM.pgm_bg_tilemap.total_elements; + flags = (byte)(flipyx & 3); + palette_base = 0x400 + 0x20 * colour; + tileflags[row, col] = tile_drawPgmbg(code * 0x400, x0, y0, palette_base, flags); + } + public byte tile_drawPgmbg(int pendata_offset, int x0, int y0, int palette_base, byte flags) + { + int height = tileheight; + int width = tilewidth; + int dx0 = 1, dy0 = 1; + int tx, ty; + int offset1 = 0; + int offsety1; + int xoffs; + byte andmask = 0xff, ormask = 0; + byte pen, map; + AxiArray.Copy(PGM.tiles2rom, pendata_offset, pen_data, 0, 0x400); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += height - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += width - 1; + dx0 = -1; + } + for (ty = 0; ty < height; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < width; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[0, pen]; + offset1++; + pixmap[offsety1 * 0x800 + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Tilemap.cs.meta new file mode 100644 index 00000000..079e683d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d14dd68dbc18124cb9457fa84a6017c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Video.cs new file mode 100644 index 00000000..4194c94a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Video.cs @@ -0,0 +1,405 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class PGM + { + public static ushort[] pgm_spritebufferram; // buffered spriteram + public static ushort[] sprite_temp_render; + private static ushort[] uu900; + private static int pgm_sprite_source_offset; + private static void pgm_prepare_sprite(int wide, int high, int palt, int boffset) + { + int bdatasize = sprmaskrom.Length - 1; + int adatasize = pgm_sprite_a_region.Length - 1; + int xcnt, ycnt, aoffset, x; + ushort msk; + aoffset = (sprmaskrom[(boffset + 3) & bdatasize] << 24) | (sprmaskrom[(boffset + 2) & bdatasize] << 16) | (sprmaskrom[(boffset + 1) & bdatasize] << 8) | (sprmaskrom[(boffset + 0) & bdatasize] << 0); + aoffset = aoffset >> 2; + aoffset *= 3; + boffset += 4; + for (ycnt = 0; ycnt < high; ycnt++) + { + for (xcnt = 0; xcnt < wide; xcnt++) + { + msk = (ushort)((sprmaskrom[(boffset + 1) & bdatasize] << 8) | (sprmaskrom[(boffset + 0) & bdatasize] << 0)); + for (x = 0; x < 16; x++) + { + if ((msk & 0x0001) == 0) + { + sprite_temp_render[(ycnt * (wide * 16)) + (xcnt * 16 + x)] = (ushort)(pgm_sprite_a_region[aoffset & adatasize] + palt * 32); + aoffset++; + } + else + { + sprite_temp_render[(ycnt * (wide * 16)) + (xcnt * 16 + x)] = 0x8000; + } + msk >>= 1; + } + boffset += 2; + } + } + } + private static void pgm_draw_pix(int xdrawpos, int ydrawpos, int pri, ushort srcdat) + { + if ((xdrawpos >= 0) && (xdrawpos < 448)) + { + if ((Tilemap.priority_bitmap[ydrawpos, xdrawpos] & 1) == 0) + { + if (pri == 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][ydrawpos * 0x200 + xdrawpos] = srcdat; + } + else + { + if ((Tilemap.priority_bitmap[ydrawpos, xdrawpos] & 2) == 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][ydrawpos * 0x200 + xdrawpos] = srcdat; + } + } + } + Tilemap.priority_bitmap[ydrawpos, xdrawpos] |= 1; + } + } + private static void pgm_draw_pix_nopri(int xdrawpos, int ydrawpos, ushort srcdat) + { + if ((xdrawpos >= 0) && (xdrawpos < 448)) + { + if ((Tilemap.priority_bitmap[ydrawpos, xdrawpos] & 1) == 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][ydrawpos * 0x200 + xdrawpos] = srcdat; + } + Tilemap.priority_bitmap[ydrawpos, xdrawpos] |= 1; + } + } + private static void pgm_draw_pix_pri(int xdrawpos, int ydrawpos, ushort srcdat) + { + if ((xdrawpos >= 0) && (xdrawpos < 448)) + { + if ((Tilemap.priority_bitmap[ydrawpos, xdrawpos] & 1) == 0) + { + if ((Tilemap.priority_bitmap[ydrawpos, xdrawpos] & 2) == 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][ydrawpos * 0x200 + xdrawpos] = srcdat; + } + } + Tilemap.priority_bitmap[ydrawpos, xdrawpos] |= 1; + } + } + private static void draw_sprite_line(int wide, int ydrawpos, int xzoom, int xgrow, int yoffset, int flip, int xpos) + { + int xcnt, xcntdraw; + int xzoombit; + int xoffset; + int xdrawpos = 0; + ushort srcdat; + xcnt = 0; + xcntdraw = 0; + while (xcnt < wide * 16) + { + if ((flip & 0x01) == 0) + xoffset = xcnt; + else + xoffset = (wide * 16) - xcnt - 1; + srcdat = sprite_temp_render[yoffset + xoffset]; + xzoombit = (xzoom >> (xcnt & 0x1f)) & 1; + if (xzoombit == 1 && xgrow == 1) + { + xdrawpos = xpos + xcntdraw; + if ((srcdat & 0x8000) == 0) + { + if ((xdrawpos >= 0) && (xdrawpos < 448)) + Video.bitmapbase_Ptrs[Video.curbitmap][ydrawpos * 0x200 + xdrawpos] = srcdat; + } + xcntdraw++; + xdrawpos = xpos + xcntdraw; + if ((srcdat & 0x8000) == 0) + { + if ((xdrawpos >= 0) && (xdrawpos < 448)) + Video.bitmapbase_Ptrs[Video.curbitmap][ydrawpos * 0x200 + xdrawpos] = srcdat; + } + xcntdraw++; + } + else if (xzoombit == 1 && xgrow == 0) + { + + } + else + { + xdrawpos = xpos + xcntdraw; + if ((srcdat & 0x8000) == 0) + { + if ((xdrawpos >= 0) && (xdrawpos < 448)) + Video.bitmapbase_Ptrs[Video.curbitmap][ydrawpos * 0x200 + xdrawpos] = srcdat; + } + xcntdraw++; + } + xcnt++; + if (xdrawpos == 448) + xcnt = wide * 16; + } + } + private static void draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, int xzoom, int xgrow, int yzoom, int ygrow) + { + int ycnt; + int ydrawpos; + int yoffset; + int ycntdraw; + int yzoombit; + pgm_prepare_sprite(wide, high, palt, boffset); + ycnt = 0; + ycntdraw = 0; + while (ycnt < high) + { + yzoombit = (yzoom >> (ycnt & 0x1f)) & 1; + if (yzoombit == 1 && ygrow == 1) + { + ydrawpos = ypos + ycntdraw; + if ((flip & 0x02) == 0) + yoffset = (ycnt * (wide * 16)); + else + yoffset = ((high - ycnt - 1) * (wide * 16)); + if ((ydrawpos >= 0) && (ydrawpos < 224)) + { + draw_sprite_line(wide, ydrawpos, xzoom, xgrow, yoffset, flip, xpos); + } + ycntdraw++; + ydrawpos = ypos + ycntdraw; + if ((flip & 0x02) == 0) + yoffset = (ycnt * (wide * 16)); + else + yoffset = ((high - ycnt - 1) * (wide * 16)); + if ((ydrawpos >= 0) && (ydrawpos < 224)) + { + draw_sprite_line(wide, ydrawpos, xzoom, xgrow, yoffset, flip, xpos); + } + ycntdraw++; + if (ydrawpos == 224) + ycnt = high; + } + else if (yzoombit == 1 && ygrow == 0) + { + + } + else + { + ydrawpos = ypos + ycntdraw; + if ((flip & 0x02) == 0) + yoffset = (ycnt * (wide * 16)); + else + yoffset = ((high - ycnt - 1) * (wide * 16)); + if ((ydrawpos >= 0) && (ydrawpos < 224)) + { + draw_sprite_line(wide, ydrawpos, xzoom, xgrow, yoffset, flip, xpos); + } + ycntdraw++; + if (ydrawpos == 224) + ycnt = high; + } + ycnt++; + } + } + unsafe private static void draw_sprites(int priority) + { + fixed (ushort* pSpriteBuffer = &pgm_spritebufferram[0]) + fixed (byte* pVideoRegs = &pgm_videoregs[0]) + { + ushort* spritePtr = pSpriteBuffer + pgm_sprite_source_offset; + int offset = 0; + + while (pgm_sprite_source_offset < 0x500) + { + // 读取数据 + ushort* spriteData = (ushort*)spritePtr; + int xpos = spriteData[0] & 0x07FF; + int ypos = spriteData[1] & 0x03FF; + int xzom = (spriteData[0] & 0x7800) >> 11; + int xgrow = (spriteData[0] & 0x8000) >> 15; + int yzom = (spriteData[1] & 0x7800) >> 11; + int ygrow = (spriteData[1] & 0x8000) >> 15; + ushort* spriteData2 = (ushort*)(spritePtr + 4); + int palt = (spriteData2[0] & 0x1F00) >> 8; + int flip = (spriteData2[0] & 0x6000) >> 13; + int boff = ((spriteData2[0] & 0x007F) << 16) | spriteData2[1]; + ushort* spriteData3 = (ushort*)(spritePtr + 6); + int wide = (spriteData3[0] & 0x7E00) >> 9; + int high = spriteData3[0] & 0x01FF; + int pri = (spriteData2[0] & 0x0080) >> 7; + int pgm_sprite_zoomtable_offset = 0x1000; + // 处理缩放 + int xzoom, yzoom; + int* zoomTablePtr = (int*)(pVideoRegs + pgm_sprite_zoomtable_offset); + if (xgrow != 0) + { + xzom = 0x10 - xzom; + } + if (ygrow != 0) + { + yzom = 0x10 - yzom; + } + xzoom = zoomTablePtr[xzom * 4] * 0x10000 + zoomTablePtr[xzom * 4 + 1] * 0x100 + zoomTablePtr[xzom * 4 + 2]; + yzoom = zoomTablePtr[yzom * 4] * 0x10000 + zoomTablePtr[yzom * 4 + 1] * 0x100 + zoomTablePtr[yzom * 4 + 2]; + + // 调整偏移和边界检查 + boff *= 2; + if (xpos > 0x3FF) + xpos -= 0x800; + if (ypos > 0x1FF) + ypos -= 0x400; + if (high == 0) + break; + if ((priority == 1) && (pri == 0)) + break; + + // 调用绘制函数(注意:这个函数也需要被修改为接受指针或适当的参数类型) + draw_sprite_new_zoomed(wide, high, xpos, ypos, palt, boff, flip, xzoom, xgrow, yzoom, ygrow); + + // 移动到下一个精灵 + spritePtr += 10; // 每个精灵占用5个ushort,即10个字节 + pgm_sprite_source_offset += 5; // 假设pgm_sprite_source_offset是以ushort为单位递增的 + + // 注意:这里我们直接通过指针移动,因此不需要再次访问数组来更新pgm_sprite_source_offset对应的值 + } + } + } + + //private static void draw_sprites(int priority) + //{ + // while (pgm_sprite_source_offset < 0x500) + // { + // //用Span优化 + // Span span_pgm_spritebufferram = pgm_spritebufferram.AsSpan(); + // int xpos = span_pgm_spritebufferram[pgm_sprite_source_offset + 0] & 0x07ff; + // int ypos = span_pgm_spritebufferram[pgm_sprite_source_offset + 1] & 0x03ff; + // int xzom = (span_pgm_spritebufferram[pgm_sprite_source_offset + 0] & 0x7800) >> 11; + // int xgrow = (span_pgm_spritebufferram[pgm_sprite_source_offset + 0] & 0x8000) >> 15; + // int yzom = (span_pgm_spritebufferram[pgm_sprite_source_offset + 1] & 0x7800) >> 11; + // int ygrow = (span_pgm_spritebufferram[pgm_sprite_source_offset + 1] & 0x8000) >> 15; + // int palt = (span_pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x1f00) >> 8; + // int flip = (span_pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x6000) >> 13; + // int boff = ((span_pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x007f) << 16) | (span_pgm_spritebufferram[pgm_sprite_source_offset + 3] & 0xffff); + // int wide = (span_pgm_spritebufferram[pgm_sprite_source_offset + 4] & 0x7e00) >> 9; + // int high = span_pgm_spritebufferram[pgm_sprite_source_offset + 4] & 0x01ff; + // int pri = (span_pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x0080) >> 7; + + + // //int xpos = pgm_spritebufferram[pgm_sprite_source_offset + 0] & 0x07ff; + // //int ypos = pgm_spritebufferram[pgm_sprite_source_offset + 1] & 0x03ff; + // //int xzom = (pgm_spritebufferram[pgm_sprite_source_offset + 0] & 0x7800) >> 11; + // //int xgrow = (pgm_spritebufferram[pgm_sprite_source_offset + 0] & 0x8000) >> 15; + // //int yzom = (pgm_spritebufferram[pgm_sprite_source_offset + 1] & 0x7800) >> 11; + // //int ygrow = (pgm_spritebufferram[pgm_sprite_source_offset + 1] & 0x8000) >> 15; + // //int palt = (pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x1f00) >> 8; + // //int flip = (pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x6000) >> 13; + // //int boff = ((pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x007f) << 16) | (pgm_spritebufferram[pgm_sprite_source_offset + 3] & 0xffff); + // //int wide = (pgm_spritebufferram[pgm_sprite_source_offset + 4] & 0x7e00) >> 9; + // //int high = pgm_spritebufferram[pgm_sprite_source_offset + 4] & 0x01ff; + // //int pri = (pgm_spritebufferram[pgm_sprite_source_offset + 2] & 0x0080) >> 7; + + // int xzoom, yzoom; + // int pgm_sprite_zoomtable_offset = 0x1000; + // if (xgrow != 0) + // { + // xzom = 0x10 - xzom; + // } + // if (ygrow != 0) + // { + // yzom = 0x10 - yzom; + // } + // Span span_pgm_videoregs = pgm_videoregs.AsSpan(); + // xzoom = ((span_pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4] * 0x100 + span_pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4 + 1]) << 16) | (span_pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4 + 2] * 0x100 + span_pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4 + 3]); + // yzoom = ((span_pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4] * 0x100 + span_pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4 + 1]) << 16) | (span_pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4 + 2] * 0x100 + span_pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4 + 3]); + + // //xzoom = ((pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4] * 0x100 + pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4 + 1]) << 16) | (pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4 + 2] * 0x100 + pgm_videoregs[pgm_sprite_zoomtable_offset + xzom * 4 + 3]); + // //yzoom = ((pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4] * 0x100 + pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4 + 1]) << 16) | (pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4 + 2] * 0x100 + pgm_videoregs[pgm_sprite_zoomtable_offset + yzom * 4 + 3]); + // boff *= 2; + // if (xpos > 0x3ff) + // xpos -= 0x800; + // if (ypos > 0x1ff) + // ypos -= 0x400; + // if (high == 0) + // break; + // if ((priority == 1) && (pri == 0)) + // break; + // draw_sprite_new_zoomed(wide, high, xpos, ypos, palt, boff, flip, xzoom, xgrow, yzoom, ygrow); + // pgm_sprite_source_offset += 5; + // } + //} + private static void pgm_tx_videoram_w(int offset, byte data) + { + int col, row; + pgm_tx_videoram[offset] = data; + col = (offset / 4) % 64; + row = (offset / 4) / 64; + pgm_tx_tilemap.tilemap_mark_tile_dirty(row, col); + } + private static void pgm_tx_videoram_w(int offset, ushort data) + { + int col, row; + pgm_tx_videoram[offset * 2] = (byte)(data >> 8); + pgm_tx_videoram[offset * 2 + 1] = (byte)data; + col = (offset / 2) % 64; + row = (offset / 2) / 64; + pgm_tx_tilemap.tilemap_mark_tile_dirty(row, col); + } + private static void pgm_bg_videoram_w(int offset, byte data) + { + int col, row; + pgm_bg_videoram[offset] = data; + col = (offset / 4) % 64; + row = (offset / 4) / 64; + pgm_bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + private static void pgm_bg_videoram_w(int offset, ushort data) + { + int col, row; + pgm_bg_videoram[offset * 2] = (byte)(data >> 8); + pgm_bg_videoram[offset * 2 + 1] = (byte)data; + col = (offset / 2) % 64; + row = (offset / 2) / 64; + pgm_bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void video_start_pgm() + { + int i; + uu900 = new ushort[0x200 * 0x200]; + for (i = 0; i < 0x40000; i++) + { + uu900[i] = 0x900; + } + pgm_spritebufferram = new ushort[0xa00 / 2]; + sprite_temp_render = new ushort[0x400 * 0x200]; + } + public static void video_update_pgm() + { + int y; + RECT new_clip = new RECT(); + new_clip.min_x = 0x00; + new_clip.max_x = 0x1bf; + new_clip.min_y = 0x00; + new_clip.max_y = 0xdf; + Array.Copy(uu900, Video.bitmapbase[Video.curbitmap], 0x40000); + pgm_sprite_source_offset = 0; + draw_sprites(1); + pgm_bg_tilemap.tilemap_set_scrolly(0, pgm_videoregs[0x2000] * 0x100 + pgm_videoregs[0x2000 + 1]); + for (y = 0; y < 224; y++) + { + pgm_bg_tilemap.tilemap_set_scrollx((y + pgm_videoregs[0x2000] * 0x100 + pgm_videoregs[0x2000 + 1]) & 0x7ff, pgm_videoregs[0x3000] * 0x100 + pgm_videoregs[0x3000 + 1] + pgm_rowscrollram[y * 2] * 0x100 + pgm_rowscrollram[y * 2 + 1]); + } + pgm_bg_tilemap.tilemap_draw_primask(new_clip, 0x10, 0); + draw_sprites(0); + //draw_sprites(); + pgm_tx_tilemap.tilemap_set_scrolly(0, pgm_videoregs[0x5000] * 0x100 + pgm_videoregs[0x5000 + 1]); + pgm_tx_tilemap.tilemap_set_scrollx(0, pgm_videoregs[0x6000] * 0x100 + pgm_videoregs[0x6000 + 1]); + pgm_tx_tilemap.tilemap_draw_primask(new_clip, 0x10, 0); + } + public unsafe static void video_eof_pgm() + { + int i; + for (i = 0; i < 0x500; i++) + { + pgm_spritebufferram[i] = (ushort)(Memory.mainram[i * 2] * 0x100 + Memory.mainram[i * 2 + 1]); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Video.cs.meta new file mode 100644 index 00000000..47180a68 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90f5ac7ff04c39b43ab1065f76c4e46d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/mainbios.rom b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/mainbios.rom new file mode 100644 index 00000000..555d65f5 Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/mainbios.rom differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/mainbios.rom.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/mainbios.rom.meta new file mode 100644 index 00000000..6edcc13a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/mainbios.rom.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9dcf1f275fde4ff4ca7753f34bfff06e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_m01s.rom b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_m01s.rom new file mode 100644 index 00000000..7055f76d Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_m01s.rom differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_m01s.rom.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_m01s.rom.meta new file mode 100644 index 00000000..4f5d007c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_m01s.rom.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 512b18861baab1146a74c111baf7543f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_t01s.rom b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_t01s.rom new file mode 100644 index 00000000..27cdfd80 Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_t01s.rom differ diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_t01s.rom.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_t01s.rom.meta new file mode 100644 index 00000000..b50efb91 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/pgm/pgm_t01s.rom.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4520bb2f8f044c14ead213f30f331f19 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8.meta new file mode 100644 index 00000000..bffed8d3 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3979fd1c936ac34db9ce97905f11a09 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Drawgfx.cs new file mode 100644 index 00000000..6ad1f9fd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Drawgfx.cs @@ -0,0 +1,103 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_starfigh(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 8 - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x100) + { + ex = 0x100 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 8 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 8; + int sh = 8; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 0x10 * color; + blockmove_8toN_transpen16_starfigh(bb1, code, sw, sh, 8, ls, ts, flipx, flipy, dw, dh, colorbase, sx, sy); + } + public unsafe static void blockmove_8toN_transpen16_starfigh(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsetx, int offsety) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * 0x40; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0x0f) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x100 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Drawgfx.cs.meta new file mode 100644 index 00000000..a5298abf --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5bcd3cc49976ef4fa1dfe57f3b5cb9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Input.cs new file mode 100644 index 00000000..d7b2c058 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Input.cs @@ -0,0 +1,177 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class SunA8 + { + public static void loop_inputports_suna8_starfigh() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte1 &= unchecked((byte)~0x80); + } + else + { + byte1 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 &= unchecked((byte)~0x80); + } + else + { + byte2 |= 0x80; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + byte1 &= unchecked((byte)~0x40); + } + else + { + byte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + byte2 &= unchecked((byte)~0x40); + } + else + { + byte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + byte1 &= unchecked((byte)~0x08); + } + else + { + byte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + byte1 &= unchecked((byte)~0x04); + } + else + { + byte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + byte1 &= unchecked((byte)~0x02); + } + else + { + byte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + byte1 &= unchecked((byte)~0x01); + } + else + { + byte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte1 &= unchecked((byte)~0x10); + } + else + { + byte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte1 &= unchecked((byte)~0x20); + } + else + { + byte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + byte2 &= unchecked((byte)~0x08); + } + else + { + byte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + byte2 &= unchecked((byte)~0x04); + } + else + { + byte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + byte2 &= unchecked((byte)~0x02); + } + else + { + byte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + byte2 &= unchecked((byte)~0x01); + } + else + { + byte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte2 &= unchecked((byte)~0x10); + } + else + { + byte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + byte2 &= unchecked((byte)~0x20); + } + else + { + byte2 |= 0x20; + } + } + public static void record_port_starfigh() + { + if (byte1 != byte1_old || byte2 != byte2_old) + { + byte1_old = byte1; + byte2_old = byte2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(byte1); + Mame.bwRecord.Write(byte2); + } + } + public static void replay_port_starfigh() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + byte1_old = Mame.brRecord.ReadByte(); + byte2_old = Mame.brRecord.ReadByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + byte1 = byte1_old; + byte2 = byte2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Input.cs.meta new file mode 100644 index 00000000..2d9160d6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b65d8b76b5064f48886951713fc0026 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Memory.cs new file mode 100644 index 00000000..c222001b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Memory.cs @@ -0,0 +1,209 @@ +using cpu.z80; + +namespace MAME.Core +{ + public unsafe partial class SunA8 + { + public static byte byte1, byte2; + public static byte byte1_old, byte2_old; + public static byte Z0ReadOp_starfigh(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = mainromop[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.mainrom[basebankmain + offset]; + } + else + { + result = 0; + } + return result; + } + public static byte Z0ReadMemory_starfigh(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address == 0xc000) + { + result = byte1; + } + else if (address == 0xc001) + { + result = byte2; + } + else if (address == 0xc002) + { + result = dsw1; + } + else if (address == 0xc003) + { + result = dsw2; + } + else if (address == 0xc080) + { + result = starfigh_cheats_r(); + } + else if (address >= 0xc600 && address <= 0xc7ff) + { + int offset = address - 0xc600; + result = suna8_banked_paletteram_r(offset); + } + else if (address >= 0xc800 && address <= 0xdfff) + { + int offset = address - 0xc800; + result = Memory.mainram[offset]; + } + else if (address >= 0xe000 && address <= 0xffff) + { + int offset = address - 0xe000; + result = suna8_banked_spriteram_r(offset); + } + return result; + } + public static void Z0WriteMemory_starfigh(ushort address, byte value) + { + if (address <= 0x7fff) + { + Memory.mainrom[address] = value; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + Memory.mainrom[basebankmain + offset] = value; + } + else if (address == 0xc200) + { + starfigh_spritebank_w(); + } + else if (address >= 0xc280 && address <= 0xc2ff) + { + starfigh_rombank_latch_w(value); + } + else if (address == 0xc300) + { + hardhea2_flipscreen_w(value); + } + else if (address >= 0xc380 && address <= 0xc3ff) + { + starfigh_spritebank_latch_w(value); + } + else if (address == 0xc400) + { + starfigh_leds_w(value); + } + else if (address == 0xc500) + { + starfigh_sound_latch_w(value); + } + else if (address >= 0xc600 && address <= 0xc7ff) + { + int offset = address - 0xc600; + Generic.paletteram_RRRRGGGGBBBBxxxx_be_w(offset, value); + } + else if (address >= 0xc800 && address <= 0xdfff) + { + int offset = address - 0xc800; + Memory.mainram[offset] = value; + } + else if (address >= 0xe000 && address <= 0xffff) + { + int offset = address - 0xe000; + suna8_banked_spriteram_w(offset, value); + } + } + public static byte Z0ReadHardware(ushort address) + { + return 0; + } + public static void Z0WriteHardware(ushort address, byte value) + { + + } + public static int Z0IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[0].cpunum, 0); + } + public static byte Z1ReadOp_hardhead(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static byte Z1ReadMemory_hardhead(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + result = Memory.audioram[offset]; + } + else if (address == 0xc800) + { + result = FMOpl.ym3812_read(0); + } + else if (address == 0xd800) + { + result = (byte)Sound.soundlatch_r(); + } + return result; + } + public static void Z1Write_Memory_hardhead(ushort address, byte value) + { + if (address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0xa000 && address <= 0xa001) + { + int offset = address - 0xa000; + FMOpl.ym3812_write(offset, value); + } + else if (address >= 0xa002 && address <= 0xa003) + { + int offset = address - 0xa002; + AY8910.AA8910[0].ay8910_write_ym(offset, value); + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + Memory.audioram[offset] = value; + } + else if (address == 0xd000) + { + Sound.soundlatch2_w(value); + } + } + public static byte Z1ReadHardware(ushort address) + { + return 0; + } + public static void Z1WriteHardware(ushort address, byte value) + { + + } + public static int Z1IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[1].cpunum, 0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Memory.cs.meta new file mode 100644 index 00000000..29e699a5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2cff9433b186c154eaf13183506fef6a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/State.cs new file mode 100644 index 00000000..f5e3567a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/State.cs @@ -0,0 +1,16 @@ +using System.IO; + +namespace MAME.Core +{ + public partial class SunA8 + { + public static void SaveStateBinary_starfigh(BinaryWriter writer) + { + + } + public static void LoadStateBinary_starfigh(BinaryReader reader) + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/State.cs.meta new file mode 100644 index 00000000..a794a997 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2c4a1c9d83e3314ba97a24f64c6a0ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/SunA8.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/SunA8.cs new file mode 100644 index 00000000..8945992a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/SunA8.cs @@ -0,0 +1,279 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class SunA8 + { + public static byte m_rombank, m_spritebank, m_palettebank, spritebank_latch; + public static byte suna8_unknown; + public static byte m_gfxbank; + public static int m_has_text; + public static GFXBANK_TYPE m_gfxbank_type; + public static byte dsw1, dsw2, dswcheat; + public static byte m_rombank_latch, m_nmi_enable; + //public static byte[] /*mainromop,*/ /*gfx1rom,*/ gfx12rom, samplesrom; + public static int basebankmain; + //public static short[] samplebuf, samplebuf2; + public static int sample; + public static int sample_offset; + + #region //指针化 mainromop + static byte[] mainromop_src; + static GCHandle mainromop_handle; + public static byte* mainromop; + public static int mainromopLength; + public static bool mainromop_IsNull => mainromop == null; + public static byte[] mainromop_set + { + set + { + mainromop_handle.ReleaseGCHandle(); + mainromop_src = value; + mainromopLength = value.Length; + mainromop_src.GetObjectPtr(ref mainromop_handle, ref mainromop); + } + } + #endregion + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + + #region //指针化 gfx12rom + static byte[] gfx12rom_src; + static GCHandle gfx12rom_handle; + public static byte* gfx12rom; + public static int gfx12romLength; + public static bool gfx12rom_IsNull => gfx12rom == null; + public static byte[] gfx12rom_set + { + set + { + gfx12rom_handle.ReleaseGCHandle(); + gfx12rom_src = value; + gfx12romLength = value.Length; + gfx12rom_src.GetObjectPtr(ref gfx12rom_handle, ref gfx12rom); + } + } + #endregion + + + #region //指针化 samplesrom + static byte[] samplesrom_src; + static GCHandle samplesrom_handle; + public static byte* samplesrom; + public static int samplesromLength; + public static bool samplesrom_IsNull => samplesrom == null; + public static byte[] samplesrom_set + { + set + { + samplesrom_handle.ReleaseGCHandle(); + if (value == null) + return; + samplesrom_src = value; + samplesromLength = value.Length; + samplesrom_src.GetObjectPtr(ref samplesrom_handle, ref samplesrom); + } + } + #endregion + + #region //指针化 samplebuf + static short[] samplebuf_src; + static GCHandle samplebuf_handle; + public static short* samplebuf; + public static int samplebufLength; + public static bool samplebuf_IsNull => samplebuf == null; + public static short[] samplebuf_set + { + set + { + samplebuf_handle.ReleaseGCHandle(); + samplebuf_src = value; + samplebufLength = value.Length; + samplebuf_src.GetObjectPtr(ref samplebuf_handle, ref samplebuf); + } + } + #endregion + + + #region //指针化 samplebuf2 + static short[] samplebuf2_src; + static GCHandle samplebuf2_handle; + public static short* samplebuf2; + public static int samplebuf2Length; + public static bool samplebuf2_IsNull => samplebuf2 == null; + public static short[] samplebuf2_set + { + set + { + samplebuf2_handle.ReleaseGCHandle(); + samplebuf2_src = value; + samplebuf2Length = value.Length; + samplebuf2_src.GetObjectPtr(ref samplebuf2_handle, ref samplebuf2); + } + } + #endregion + + + public static void SunA8Init() + { + int i, n; + Machine.bRom = true; + switch (Machine.sName) + { + case "starfigh": + Generic.spriteram_set = new byte[0x4000]; + mainromop_set = Machine.GetRom("maincpuop.rom"); + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + samplesrom_set = Machine.GetRom("samples.rom"); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + Memory.Set_mainram(new byte[0x1800]); + Memory.Set_audioram(new byte[0x800]); + Generic.paletteram_set = new byte[0x200]; + if (mainromop == null || Memory.mainrom_IsNull || Memory.audiorom_IsNull || samplesrom == null || gfx12rom == null) + { + Machine.bRom = false; + } + break; + } + if (Machine.bRom) + { + switch (Machine.sName) + { + case "starfigh": + dsw1 = 0x5f; + dsw2 = 0xff; + dswcheat = 0xbf; + Sample.info.starthandler = suna8_sh_start; + break; + } + } + } + public static void hardhea2_flipscreen_w(byte data) + { + Generic.flip_screen_set(data & 0x01); + } + public static void starfigh_leds_w(byte data) + { + int bank; + //set_led_status(0, data & 0x01); + //set_led_status(1, data & 0x02); + Generic.coin_counter_w(0, data & 0x04); + m_gfxbank = (byte)((data & 0x08) != 0 ? 4 : 0); + bank = m_rombank_latch & 0x0f; + basebankmain = 0x10000 + bank * 0x4000; + //memory_set_bank(1,bank); + m_rombank = m_rombank_latch; + } + public static void starfigh_rombank_latch_w(byte data) + { + m_rombank_latch = data; + } + public static void starfigh_sound_latch_w(byte data) + { + if ((m_rombank_latch & 0x20) == 0) + { + Sound.soundlatch_w(data); + } + } + public static byte starfigh_cheats_r() + { + byte b1 = dswcheat; + if (Video.video_screen_get_vblank()) + { + b1 = (byte)(dswcheat | 0x40); + } + return b1; + } + public static void hardhea2_interrupt() + { + switch (Cpuexec.iloops) + { + case 240: + Cpuint.cpunum_set_input_line(0, 0, LineState.HOLD_LINE); + break; + case 112: + if (m_nmi_enable != 0) + { + Cpuint.cpunum_set_input_line(0, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + break; + } + } + public static void starfigh_spritebank_latch_w(byte data) + { + spritebank_latch = (byte)((data >> 2) & 1); + m_nmi_enable = (byte)((data >> 5) & 1); + } + public static void starfigh_spritebank_w() + { + m_spritebank = spritebank_latch; + } + public static void suna8_play_samples_w(int offset, byte data) + { + if (data != 0) + { + if ((~data & 0x10) != 0) + { + sample_offset = 0x800 * sample; + if (sample_offset == 0x3000) + { + int i1 = 1; + } + AxiArray.Copy(samplebuf, 0x800 * sample, samplebuf2, 0, 0x800); + Sample.sample_start_raw(0, samplebuf2, 0x0800, 4000, 0); + } + else if ((~data & 0x08) != 0) + { + sample &= 3; + sample_offset = 0x800 * (sample + 7); + AxiArray.Copy(samplebuf, 0x800 * (sample + 7), samplebuf2, 0, 0x800); + Sample.sample_start_raw(0, samplebuf2, 0x0800, 4000, 0); + } + } + } + public static void suna8_samples_number_w(int offset, byte data) + { + sample = data & 0xf; + } + public static void suna8_sh_start() + { + int i, len = samplesromLength; + samplebuf_set = new short[len]; + samplebuf2_set = new short[0x800]; + for (i = 0; i < len; i++) + { + samplebuf[i] = (short)((sbyte)(samplesrom[i] ^ 0x80) * 256); + } + } + public static void machine_reset_suna8() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/SunA8.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/SunA8.cs.meta new file mode 100644 index 00000000..fd182df8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/SunA8.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7bb46e8afcc7a94b9c448d96c6b28c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Video.cs new file mode 100644 index 00000000..c2c2c4ff --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Video.cs @@ -0,0 +1,286 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class SunA8 + { + public static RECT cliprect; + public static ushort[] uuFF; + public enum GFXBANK_TYPE + { + GFXBANK_TYPE_SPARKMAN = 0, + GFXBANK_TYPE_BRICKZN, + GFXBANK_TYPE_STARFIGH + } + public static byte suna8_banked_paletteram_r(int offset) + { + offset += m_palettebank * 0x200; + return Generic.paletteram[offset]; + } + public static byte suna8_banked_spriteram_r(int offset) + { + offset += m_spritebank * 0x2000; + return Generic.spriteram[offset]; + } + public static void suna8_spriteram_w(int offset, byte data) + { + Generic.spriteram[offset] = data; + } + public static void suna8_banked_spriteram_w(int offset, byte data) + { + offset += m_spritebank * 0x2000; + Generic.spriteram[offset] = data; + } + public static void brickzn_banked_paletteram_w(int offset, byte data) + { + byte r, g, b; + ushort rgb; + offset += m_palettebank * 0x200; + Generic.paletteram[offset] = data; + rgb = (ushort)((Generic.paletteram[offset & ~1] << 8) + Generic.paletteram[offset | 1]); + r = (byte)((((rgb & (1 << 0xc)) != 0 ? 1 : 0) << 0) | + (((rgb & (1 << 0xb)) != 0 ? 1 : 0) << 1) | + (((rgb & (1 << 0xe)) != 0 ? 1 : 0) << 2) | + (((rgb & (1 << 0xf)) != 0 ? 1 : 0) << 3)); + g = (byte)((((rgb & (1 << 0x8)) != 0 ? 1 : 0) << 0) | + (((rgb & (1 << 0x9)) != 0 ? 1 : 0) << 1) | + (((rgb & (1 << 0xa)) != 0 ? 1 : 0) << 2) | + (((rgb & (1 << 0xd)) != 0 ? 1 : 0) << 3)); + b = (byte)((((rgb & (1 << 0x4)) != 0 ? 1 : 0) << 0) | + (((rgb & (1 << 0x3)) != 0 ? 1 : 0) << 1) | + (((rgb & (1 << 0x6)) != 0 ? 1 : 0) << 2) | + (((rgb & (1 << 0x7)) != 0 ? 1 : 0) << 3)); + Palette.palette_set_callback(offset / 2, Palette.make_rgb(Palette.pal4bit(r), Palette.pal4bit(g), Palette.pal4bit(b))); + } + public static void suna8_vh_start_common(int has_text, GFXBANK_TYPE gfxbank_type) + { + m_has_text = has_text; + m_spritebank = 0; + m_gfxbank = 0; + m_gfxbank_type = gfxbank_type; + m_palettebank = 0; + if (m_has_text == 0) + { + Generic.paletteram_set = new byte[0x200 * 2]; + Generic.spriteram_set = new byte[0x2000 * 2 * 2]; + AxiArray.Clear(Generic.spriteram, 0, 0x2000 * 2 * 2); + } + } + public static void video_start_suna8_text() + { + suna8_vh_start_common(1, GFXBANK_TYPE.GFXBANK_TYPE_SPARKMAN); + } + public static void video_start_suna8_sparkman() + { + suna8_vh_start_common(0, GFXBANK_TYPE.GFXBANK_TYPE_SPARKMAN); + } + public static void video_start_suna8_brickzn() + { + suna8_vh_start_common(0, GFXBANK_TYPE.GFXBANK_TYPE_BRICKZN); + } + public static void video_start_suna8_starfigh() + { + int i; + uuFF = new ushort[0x100 * 0x100]; + for (i = 0; i < 0x10000; i++) + { + uuFF[i] = 0xff; + } + cliprect = new RECT(); + cliprect.min_x = 0; + cliprect.max_x = 0xff; + cliprect.min_y = 0x10; + cliprect.max_y = 0xef; + suna8_vh_start_common(0, GFXBANK_TYPE.GFXBANK_TYPE_STARFIGH); + } + public static void draw_sprites(int start, int end, int which) + { + int i, x, y, bank, read_mask; + int gfxbank, code, code2, color, addr, tile, attr, tile_flipx, tile_flipy, sx, sy; + int spriteram_offset = which * 0x2000 * 2; + int mx = 0; + int max_x = 0xf8; + int max_y = 0xf8; + if (m_has_text != 0) + { + //fillbitmap(priority_bitmap,0,cliprect); + } + for (i = start; i < end; i += 4) + { + int srcpg, srcx, srcy, dimx, dimy, tx, ty; + int colorbank = 0, flipx, flipy, multisprite; + y = Generic.spriteram[spriteram_offset + i + 0]; + code = Generic.spriteram[spriteram_offset + i + 1]; + x = Generic.spriteram[spriteram_offset + i + 2]; + bank = Generic.spriteram[spriteram_offset + i + 3]; + read_mask = 0; + if (m_has_text != 0) + { + read_mask = 1; + if ((bank & 0xc0) == 0xc0) + { + int text_list = (i - start) & 0x20; + int text_start = text_list != 0 ? 0x19c0 : 0x1980; + int write_mask = (text_list == 0) ? 1 : 0; + //draw_text_sprites(machine, bitmap, cliprect, text_start, text_start + 0x80, y, write_mask); + continue; + } + flipx = 0; + flipy = 0; + gfxbank = bank & 0x3f; + switch (code & 0x80) + { + case 0x80: + dimx = 2; + dimy = 32; + srcx = (code & 0xf) * 2; + srcy = 0; + srcpg = (code >> 4) & 3; + break; + case 0x00: + default: + dimx = 2; + dimy = 2; + srcx = (code & 0xf) * 2; + srcy = ((code >> 5) & 0x3) * 8 + 6; + srcpg = (code >> 4) & 1; + break; + } + multisprite = ((code & 0x80) != 0 && (code & 0x40) != 0) ? 1 : 0; + } + else + { + switch (code & 0xc0) + { + case 0xc0: + dimx = 4; + dimy = 32; + srcx = (code & 0xe) * 2; + srcy = 0; + flipx = (code & 0x1); + flipy = 0; + gfxbank = bank & 0x1f; + srcpg = (code >> 4) & 3; + break; + case 0x80: + dimx = 2; + dimy = 32; + srcx = (code & 0xf) * 2; + srcy = 0; + flipx = 0; + flipy = 0; + gfxbank = bank & 0x1f; + srcpg = (code >> 4) & 3; + break; + case 0x40: + dimx = 4; + dimy = 4; + srcx = (code & 0xe) * 2; + flipx = code & 0x01; + flipy = bank & 0x10; + srcy = (((bank & 0x80) >> 4) + (bank & 0x04) + ((~bank >> 4) & 2)) * 2; + srcpg = ((code >> 4) & 3) + 4; + gfxbank = (bank & 0x3); + switch (m_gfxbank_type) + { + case GFXBANK_TYPE.GFXBANK_TYPE_SPARKMAN: + break; + case GFXBANK_TYPE.GFXBANK_TYPE_BRICKZN: + gfxbank += 4; + break; + case GFXBANK_TYPE.GFXBANK_TYPE_STARFIGH: + if (gfxbank == 3) + gfxbank += m_gfxbank; + break; + } + colorbank = (bank & 8) >> 3; + break; + case 0x00: + default: + dimx = 2; + dimy = 2; + srcx = (code & 0xf) * 2; + flipx = 0; + flipy = 0; + srcy = (((bank & 0x80) >> 4) + (bank & 0x04) + ((~bank >> 4) & 3)) * 2; + srcpg = (code >> 4) & 3; + gfxbank = bank & 0x03; + switch (m_gfxbank_type) + { + case GFXBANK_TYPE.GFXBANK_TYPE_STARFIGH: + if (gfxbank == 3) + { + gfxbank += m_gfxbank; + } + break; + default: + break; + } + break; + } + multisprite = ((code & 0x80) != 0 && (bank & 0x80) != 0) ? 1 : 0; + } + x = x - ((bank & 0x40) != 0 ? 0x100 : 0); + y = (0x100 - y - dimy * 8) & 0xff; + if (multisprite != 0) + { + mx += dimx * 8; + x = mx; + } + else + { + mx = x; + } + gfxbank *= 0x400; + for (ty = 0; ty < dimy; ty++) + { + for (tx = 0; tx < dimx; tx++) + { + addr = (srcpg * 0x20 * 0x20) + ((srcx + (flipx != 0 ? dimx - tx - 1 : tx)) & 0x1f) * 0x20 + ((srcy + (flipy != 0 ? dimy - ty - 1 : ty)) & 0x1f); + tile = Generic.spriteram[addr * 2 + 0]; + attr = Generic.spriteram[addr * 2 + 1]; + tile_flipx = attr & 0x40; + tile_flipy = attr & 0x80; + sx = x + tx * 8; + sy = (y + ty * 8) & 0xff; + if (flipx != 0) + { + tile_flipx = (tile_flipx == 0 ? 1 : 0); + } + if (flipy != 0) + { + tile_flipy = (tile_flipy == 0 ? 1 : 0); + } + if (Generic.flip_screen_get() != 0) + { + sx = max_x - sx; + tile_flipx = (tile_flipx == 0 ? 1 : 0); + sy = max_y - sy; + tile_flipy = (tile_flipy == 0 ? 1 : 0); + } + code2 = tile + (attr & 0x3) * 0x100 + gfxbank; + color = (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank; + if (read_mask != 0) + { + //((mygfx_element*)(m_gfxdecode->gfx(which)))->prio_mask_transpen(bitmap, cliprect, code, color, tile_flipx, tile_flipy, sx, sy, screen.priority(), 0xf); + } + else + { + Drawgfx.common_drawgfx_starfigh(gfx1rom, code2, color, tile_flipx, tile_flipy, sx, sy, cliprect); + //m_gfxdecode->gfx(which)->transpen(bitmap, cliprect, code, color, tile_flipx, tile_flipy, sx, sy, 0xf); + } + } + } + } + } + public static void video_update_suna8() + { + Array.Copy(uuFF, Video.bitmapbase[Video.curbitmap], 0x10000); + draw_sprites(0x1d00, 0x2000, 0); + } + public static void video_eof_suna8() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Video.cs.meta new file mode 100644 index 00000000..ff5f0f21 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/suna8/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e6aae4474fdbd3247948b474270c1d58 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito.meta new file mode 100644 index 00000000..9c53643e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5a2f4ee525ed9fe499facd59ec0ce669 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Bublbobl.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Bublbobl.cs new file mode 100644 index 00000000..480e4919 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Bublbobl.cs @@ -0,0 +1,400 @@ +namespace MAME.Core +{ + public partial class Taito + { + public static byte dsw0, dsw1; + public static int bublbobl_video_enable, tokio_prot_count; + public static int address, latch; + public static int sound_nmi_enable, pending_nmi; + public static byte ddr1, ddr2, ddr3, ddr4; + public static byte port1_in, port2_in, port3_in, port4_in; + public static byte port1_out, port2_out, port3_out, port4_out; + public static byte portA_in, portA_out, ddrA, portB_in, portB_out, ddrB; + public static int ic43_a, ic43_b; + public static byte[] tokio_prot_data = new byte[] + { + 0x6c, + 0x7f,0x5f,0x7f,0x6f,0x5f,0x77,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5b,0x7f,0x5f,0x7f, + 0x5f,0x77,0x59,0x7f,0x5e,0x7e,0x5f,0x6d,0x57,0x7f,0x5d,0x7d,0x5f,0x7e,0x5f,0x7f, + 0x5d,0x7d,0x5f,0x7e,0x5e,0x79,0x5f,0x7f,0x5f,0x7f,0x5d,0x7f,0x5f,0x7b,0x5d,0x7e, + 0x5f,0x7f,0x5d,0x7d,0x5f,0x7e,0x5e,0x7e,0x5f,0x7d,0x5f,0x7f,0x5f,0x7e,0x7f,0x5f, + 0x01,0x00,0x02,0x01,0x01,0x01,0x03,0x00,0x05,0x02,0x04,0x01,0x03,0x00,0x05,0x01, + 0x02,0x03,0x00,0x04,0x04,0x01,0x02,0x00,0x05,0x03,0x02,0x01,0x04,0x05,0x00,0x03, + 0x00,0x05,0x02,0x01,0x03,0x04,0x05,0x00,0x01,0x04,0x04,0x02,0x01,0x04,0x01,0x00, + 0x03,0x01,0x02,0x05,0x00,0x03,0x00,0x01,0x02,0x00,0x03,0x04,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00, + 0x01,0x02,0x01,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01, + 0x00,0x00,0x00,0x00,0x02,0x00,0x01,0x02,0x00,0x01,0x01,0x00,0x00,0x02,0x01,0x00, + 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x01 + }; + public static void bublbobl_bankswitch_w(byte data) + { + basebankmain = 0x10000 + 0x4000 * ((data ^ 4) & 7); + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, (data & 0x10) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + if (Cpuexec.ncpu == 4) + { + Cpuint.cpunum_set_input_line(3, (int)LineState.INPUT_LINE_RESET, (data & 0x20) != 0 ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + } + bublbobl_video_enable = data & 0x40; + Generic.flip_screen_set(data & 0x80); + } + public static void tokio_bankswitch_w(byte data) + { + basebankmain = 0x10000 + 0x4000 * (data & 7); + } + public static void tokio_videoctrl_w(byte data) + { + Generic.flip_screen_set(data & 0x80); + } + public static void bublbobl_nmitrigger_w() + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + public static byte tokio_mcu_r() + { + tokio_prot_count %= tokio_prot_data.Length; + return tokio_prot_data[tokio_prot_count++]; + } + public static byte tokiob_mcu_r() + { + return 0xbf; /* ad-hoc value set to pass initial testing */ + } + public static void nmi_callback() + { + if (sound_nmi_enable != 0) + { + Cpuint.cpunum_set_input_line(2, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + } + else + { + pending_nmi = 1; + } + } + public static void bublbobl_sound_command_w(byte data) + { + Sound.soundlatch_w((ushort)data); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Taito_nmi_callback); + } + public static void bublbobl_sh_nmi_disable_w() + { + sound_nmi_enable = 0; + } + public static void bublbobl_sh_nmi_enable_w() + { + sound_nmi_enable = 1; + if (pending_nmi != 0) + { + Cpuint.cpunum_set_input_line(2, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + pending_nmi = 0; + } + } + public static byte bublbobl_mcu_ddr1_r() + { + return ddr1; + } + public static void bublbobl_mcu_ddr1_w(byte data) + { + ddr1 = data; + } + public static byte bublbobl_mcu_ddr2_r() + { + return ddr2; + } + public static void bublbobl_mcu_ddr2_w(byte data) + { + ddr2 = data; + } + public static byte bublbobl_mcu_ddr3_r() + { + return ddr3; + } + public static void bublbobl_mcu_ddr3_w(byte data) + { + ddr3 = data; + } + public static byte bublbobl_mcu_ddr4_r() + { + return ddr4; + } + public static void bublbobl_mcu_ddr4_w(byte data) + { + ddr4 = data; + } + public static byte bublbobl_mcu_port1_r() + { + port1_in = (byte)sbyte0; + return (byte)((port1_out & ddr1) | (port1_in & ~ddr1)); + } + public static void bublbobl_mcu_port1_w(byte data) + { + //coin_lockout_global_w(~data & 0x10); + if ((port1_out & 0x40) != 0 && (~data & 0x40) != 0) + { + Cpuint.cpunum_set_input_line_vector(0, 0, bublbobl_mcu_sharedram[0]); + Cpuint.cpunum_set_input_line(0, 0, LineState.HOLD_LINE); + } + port1_out = data; + } + public static byte bublbobl_mcu_port2_r() + { + return (byte)((port2_out & ddr2) | (port2_in & ~ddr2)); + } + public static void bublbobl_mcu_port2_w(byte data) + { + byte[] ports = new byte[] { dsw0, dsw1, (byte)sbyte1, (byte)sbyte2 }; + if ((~port2_out & 0x10) != 0 && (data & 0x10) != 0) + { + int address = port4_out | ((data & 0x0f) << 8); + if ((port1_out & 0x80) != 0) + { + if ((address & 0x0800) == 0x0000) + { + port3_in = ports[address & 3]; + } + else if ((address & 0x0c00) == 0x0c00) + { + port3_in = bublbobl_mcu_sharedram[address & 0x03ff]; + } + } + else + { + if ((address & 0x0c00) == 0x0c00) + { + bublbobl_mcu_sharedram[address & 0x03ff] = port3_out; + } + } + } + port2_out = data; + } + public static byte bublbobl_mcu_port3_r() + { + return (byte)((port3_out & ddr3) | (port3_in & ~ddr3)); + } + public static void bublbobl_mcu_port3_w(byte data) + { + port3_out = data; + } + public static byte bublbobl_mcu_port4_r() + { + return (byte)((port4_out & ddr4) | (port4_in & ~ddr4)); + } + public static void bublbobl_mcu_port4_w(byte data) + { + port4_out = data; + } + public static byte boblbobl_ic43_a_r(int offset) + { + if (offset == 0) + { + return (byte)(ic43_a << 4); + } + else + { + return 0; + } + } + public static void boblbobl_ic43_a_w(int offset) + { + int res = 0; + switch (offset) + { + case 0: + if ((~ic43_a & 8) != 0) + { + res ^= 1; + } + if ((~ic43_a & 1) != 0) + { + res ^= 2; + } + if ((~ic43_a & 1) != 0) + { + res ^= 4; + } + if ((~ic43_a & 2) != 0) + { + res ^= 4; + } + if ((~ic43_a & 4) != 0) + { + res ^= 8; + } + break; + case 1: + if ((~ic43_a & 8) != 0) + { + res ^= 1; + } + if ((~ic43_a & 2) != 0) + { + res ^= 1; + } + if ((~ic43_a & 8) != 0) + { + res ^= 2; + } + if ((~ic43_a & 1) != 0) + { + res ^= 4; + } + if ((~ic43_a & 4) != 0) + { + res ^= 8; + } + break; + case 2: + if ((~ic43_a & 4) != 0) + { + res ^= 1; + } + if ((~ic43_a & 8) != 0) + { + res ^= 2; + } + if ((~ic43_a & 2) != 0) + { + res ^= 4; + } + if ((~ic43_a & 1) != 0) + { + res ^= 8; + } + if ((~ic43_a & 4) != 0) + { + res ^= 8; + } + break; + case 3: + if ((~ic43_a & 2) != 0) + { + res ^= 1; + } + if ((~ic43_a & 4) != 0) + { + res ^= 2; + } + if ((~ic43_a & 8) != 0) + { + res ^= 2; + } + if ((~ic43_a & 8) != 0) + { + res ^= 4; + } + if ((~ic43_a & 1) != 0) + { + res ^= 8; + } + break; + } + ic43_a = res; + } + public static void boblbobl_ic43_b_w(int offset, byte data) + { + int[] xor = new int[] { 4, 1, 8, 2 }; + ic43_b = (data >> 4) ^ xor[offset]; + } + public static byte boblbobl_ic43_b_r(int offset) + { + if (offset == 0) + { + return (byte)(ic43_b << 4); + } + else + { + return 0xff; + } + } + public static void bublbobl_m68705_interrupt() + { + if ((Cpuexec.iloops & 1) != 0) + { + Cpuint.cpunum_set_input_line(3, 0, LineState.CLEAR_LINE); + } + else + { + Cpuint.cpunum_set_input_line(3, 0, LineState.ASSERT_LINE); + } + } + public static byte bublbobl_68705_portA_r() + { + return (byte)((portA_out & ddrA) | (portA_in & ~ddrA)); + } + public static void bublbobl_68705_portA_w(byte data) + { + portA_out = data; + } + public static void bublbobl_68705_ddrA_w(byte data) + { + ddrA = data; + } + public static byte bublbobl_68705_portB_r() + { + return (byte)((portB_out & ddrB) | (portB_in & ~ddrB)); + } + public static void bublbobl_68705_portB_w(byte data) + { + byte[] ports = new byte[] { dsw0, dsw1, (byte)sbyte1, (byte)sbyte2 }; + if (((ddrB & 0x01) != 0) && ((~data & 0x01) != 0) && ((portB_out & 0x01) != 0)) + { + portA_in = (byte)latch; + } + if (((ddrB & 0x02) != 0) && ((data & 0x02) != 0) && ((~portB_out & 0x02) != 0)) + { + address = (address & 0xff00) | portA_out; + } + if (((ddrB & 0x04) != 0) && ((data & 0x04) != 0) && ((~portB_out & 0x04) != 0)) + { + address = (address & 0x00ff) | ((portA_out & 0x0f) << 8); + } + if (((ddrB & 0x10) != 0) && ((~data & 0x10) != 0) && ((portB_out & 0x10) != 0)) + { + if ((data & 0x08) != 0) + { + if ((address & 0x0800) == 0x0000) + { + latch = ports[address & 3]; + } + else if ((address & 0x0c00) == 0x0c00) + { + latch = bublbobl_mcu_sharedram[address & 0x03ff]; + } + else + { + + } + } + else + { + if ((address & 0x0c00) == 0x0c00) + { + bublbobl_mcu_sharedram[address & 0x03ff] = portA_out; + } + else + { + + } + } + } + if (((ddrB & 0x20) != 0) && ((~data & 0x20) != 0) && ((portB_out & 0x20) != 0)) + { + bublbobl_mcu_sharedram[0x7c] = 0; + Cpuint.cpunum_set_input_line_vector(0, 0, bublbobl_mcu_sharedram[0]); + Cpuint.cpunum_set_input_line(0, 0, LineState.HOLD_LINE); + } + if (((ddrB & 0x40) != 0) && ((~data & 0x40) != 0) && ((portB_out & 0x40) != 0)) + { + + } + if (((ddrB & 0x80) != 0) && ((~data & 0x80) != 0) && ((portB_out & 0x80) != 0)) + { + + } + portB_out = data; + } + public static void bublbobl_68705_ddrB_w(byte data) + { + ddrB = data; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Bublbobl.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Bublbobl.cs.meta new file mode 100644 index 00000000..f7acfeae --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Bublbobl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f265a7c001f80444383ff710788a93d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Drawgfx.cs new file mode 100644 index 00000000..09927f0c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Drawgfx.cs @@ -0,0 +1,212 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_bublbobl(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 8 - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x100) + { + ex = 0x100 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 8 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 8; + int sh = 8; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 0x10 * color; + blockmove_8toN_transpen16_bublbobl(bb1, code, sw, sh, 8, ls, ts, flipx, flipy, dw, dh, colorbase, sx, sy); + } + public unsafe static void blockmove_8toN_transpen16_bublbobl(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsetx, int offsety) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * 0x40; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0x0f) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x100 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + public static void common_drawgfx_opwolf(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip, uint pri_mask) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 0x10 - 1; + if (code > 0x4000 || color > 0x80) + { + int i1 = 1; + } + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x140) + { + ex = 0x140 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x10 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = color * 0x10; + blockmove_8toN_transpen_pri16_opwolf(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, pri_mask, sx, sy); + } + public unsafe static void blockmove_8toN_transpen_pri16_opwolf(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, + int leftskip, int topskip, int flipx, int flipy, + int dstwidth, int dstheight, int colorbase, uint pmask, int sx, int sy) + { + int ydir, xdir, col, i, j, offsetx, offsety; + int srcdata_offset = code * 0x100; + offsetx = sx; + offsety = sy; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0) + { + if (((1 << (Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x1f)) & pmask) == 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x140 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] = (byte)((Tilemap.priority_bitmap[offsety + ydir * i, offsetx + xdir * j] & 0x7f) | 0x1f); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Drawgfx.cs.meta new file mode 100644 index 00000000..659c0ec1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6d505be5027b914db371baafe88c592 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Input.cs new file mode 100644 index 00000000..a4e6cbf2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Input.cs @@ -0,0 +1,884 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class Taito + { + public static void loop_inputports_taito_common() + { + + } + public static void loop_inputports_taito_bublbobl() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 |= 0x04; + } + else + { + sbyte0 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 |= 0x08; + } + else + { + sbyte0 &= ~0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + /*if (Keyboard.IsPressed(Key.S)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(Key.W)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + }*/ + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.L)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + }*/ + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + /*if (Keyboard.IsPressed(Key.Down)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(Key.Up)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + }*/ + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.NumPad3)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + }*/ + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + /*if (Keyboard.IsPressed(Key.T)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + }*/ + } + public static void loop_inputports_taito_tokio() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 |= 0x04; + } + else + { + sbyte0 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 |= 0x08; + } + else + { + sbyte0 &= ~0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.L)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + }*/ + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.NumPad3)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + }*/ + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + /*if (Keyboard.IsPressed(Key.T)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + }*/ + } + public static void loop_inputports_taito_boblbobl() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 |= 0x08; + } + else + { + sbyte0 &= ~0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 |= 0x04; + } + else + { + sbyte0 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x40; + } + else + { + sbyte0 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + /*if (Keyboard.IsPressed(Key.S)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(Key.W)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + }*/ + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.L)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + }*/ + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + /*if (Keyboard.IsPressed(Key.Down)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(Key.Up)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + }*/ + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.NumPad3)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + }*/ + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + /*if (Keyboard.IsPressed(Key.T)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + }*/ + } + public static void loop_inputports_taito_opwolf() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte0 |= 0x01; + } + else + { + sbyte0 &= ~0x01; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte0 |= 0x02; + } + else + { + sbyte0 &= ~0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + /*if (Keyboard.IsPressed(Key.D2)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(Key.D)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(Key.A)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(Key.S)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(Key.W)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + }*/ + + + if (Keyboard.IsPressed(MotionKey.P1_BTN_1) || Mouse.buttons[0] != 0)//if (Keyboard.IsPressed(Corekey.J) || Mouse.buttons[0] != 0) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2) || Mouse.buttons[1] != 0)//if (Keyboard.IsPressed(Corekey.K) || Mouse.buttons[1] != 0) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + /*if (Keyboard.IsPressed(Key.L)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(Key.Right)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(Key.Left)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(Key.Down)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(Key.Up)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(Key.NumPad1)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(Key.NumPad2)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(Key.NumPad3)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + }*/ + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + Inptport.frame_update_analog_field_opwolf_p1x(Inptport.analog_p1x); + Inptport.frame_update_analog_field_opwolf_p1y(Inptport.analog_p1y); + p1x = (byte)Inptport.input_port_read_direct(Inptport.analog_p1x); + p1y = (byte)Inptport.input_port_read_direct(Inptport.analog_p1y); + } + public static void loop_inputports_taito_opwolfp() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte3 |= 0x02; + } + else + { + sbyte3 &= ~0x02; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte3 |= 0x04; + } + else + { + sbyte3 &= ~0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1) || Mouse.buttons[0] != 0)//if (Keyboard.IsPressed(Corekey.J) || Mouse.buttons[0] != 0) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2) || Mouse.buttons[1] != 0) //if (Keyboard.IsPressed(Corekey.K) || Mouse.buttons[1] != 0) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + Inptport.frame_update_analog_field_opwolf_p1x(Inptport.analog_p1x); + Inptport.frame_update_analog_field_opwolf_p1y(Inptport.analog_p1y); + p1x = (byte)Inptport.input_port_read_direct(Inptport.analog_p1x); + p1y = (byte)Inptport.input_port_read_direct(Inptport.analog_p1y); + } + public static void record_port_bublbobl() + { + if (sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old) + { + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + } + } + public static void replay_port_bublbobl() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + //Mame.mame_pause(true); + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + public static void record_port_opwolf() + { + if (sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || Inptport.analog_p1x.accum != p1x_accum_old || Inptport.analog_p1x.previous != p1x_previous_old || Inptport.analog_p1y.accum != p1y_accum_old || Inptport.analog_p1y.previous != p1y_previous_old) + { + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + p1x_accum_old = Inptport.analog_p1x.accum; + p1x_previous_old = Inptport.analog_p1x.previous; + p1y_accum_old = Inptport.analog_p1y.accum; + p1y_previous_old = Inptport.analog_p1y.previous; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(Inptport.analog_p1x.accum); + Mame.bwRecord.Write(Inptport.analog_p1x.previous); + Mame.bwRecord.Write(Inptport.analog_p1y.accum); + Mame.bwRecord.Write(Inptport.analog_p1y.previous); + } + } + public static void replay_port_opwolf() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + p1x_accum_old = Mame.brRecord.ReadInt32(); + p1x_previous_old = Mame.brRecord.ReadInt32(); + p1y_accum_old = Mame.brRecord.ReadInt32(); + p1y_previous_old = Mame.brRecord.ReadInt32(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + Inptport.analog_p1x.accum = p1x_accum_old; + Inptport.analog_p1x.previous = p1x_previous_old; + Inptport.analog_p1y.accum = p1y_accum_old; + Inptport.analog_p1y.previous = p1y_previous_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + public static void record_port_opwolfp() + { + if (sbyte2 != sbyte2_old || sbyte3 != sbyte3_old || Inptport.analog_p1x.accum != p1x_accum_old || Inptport.analog_p1x.previous != p1x_previous_old || Inptport.analog_p1y.accum != p1y_accum_old || Inptport.analog_p1y.previous != p1y_previous_old) + { + sbyte2_old = sbyte2; + sbyte3_old = sbyte3; + p1x_accum_old = Inptport.analog_p1x.accum; + p1x_previous_old = Inptport.analog_p1x.previous; + p1y_accum_old = Inptport.analog_p1y.accum; + p1y_previous_old = Inptport.analog_p1y.previous; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbyte3); + Mame.bwRecord.Write(Inptport.analog_p1x.accum); + Mame.bwRecord.Write(Inptport.analog_p1x.previous); + Mame.bwRecord.Write(Inptport.analog_p1y.accum); + Mame.bwRecord.Write(Inptport.analog_p1y.previous); + } + } + public static void replay_port_opwolfp() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbyte3_old = Mame.brRecord.ReadSByte(); + p1x_accum_old = Mame.brRecord.ReadInt32(); + p1x_previous_old = Mame.brRecord.ReadInt32(); + p1y_accum_old = Mame.brRecord.ReadInt32(); + p1y_previous_old = Mame.brRecord.ReadInt32(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte2 = sbyte2_old; + sbyte3 = sbyte3_old; + Inptport.analog_p1x.accum = p1x_accum_old; + Inptport.analog_p1x.previous = p1x_previous_old; + Inptport.analog_p1y.accum = p1y_accum_old; + Inptport.analog_p1y.previous = p1y_previous_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Input.cs.meta new file mode 100644 index 00000000..b6e6d8a8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f6e4ff6077b94e4f92cc1c5db6160b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Memory.cs new file mode 100644 index 00000000..74f334f1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Memory.cs @@ -0,0 +1,2637 @@ +using cpu.z80; + +namespace MAME.Core +{ + public unsafe partial class Taito + { + public static sbyte sbyte0, sbyte1, sbyte2, sbyte3, sbyte4, sbyte5; + public static sbyte sbyte0_old, sbyte1_old, sbyte2_old, sbyte3_old, sbyte4_old, sbyte5_old; + public static int p1x_accum_old, p1x_previous_old, p1y_accum_old, p1y_previous_old; + public static byte Z0ReadMemory_tokio(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address >= 0xc000 && address <= 0xdcff) + { + int offset = address - 0xc000; + result = videoram[offset]; + } + else if (address >= 0xdd00 && address <= 0xdfff) + { + int offset = address - 0xdd00; + result = bublbobl_objectram[offset]; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + result = Memory.mainram[offset]; + } + else if (address == 0xfa03) + { + result = dsw0; + } + else if (address == 0xfa04) + { + result = dsw1; + } + else if (address == 0xfa05) + { + result = (byte)sbyte0; + } + else if (address == 0xfa06) + { + result = (byte)sbyte1; + } + else if (address == 0xfa07) + { + result = (byte)sbyte2; + } + else if (address == 0xfc00) + { + result = 0; + } + else if (address == 0xfe00) + { + result = tokio_mcu_r(); + } + else + { + result = 0; + } + return result; + } + public static byte Z0ReadMemory_tokiob(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address >= 0xc000 && address <= 0xdcff) + { + int offset = address - 0xc000; + result = videoram[offset]; + } + else if (address >= 0xdd00 && address <= 0xdfff) + { + int offset = address - 0xdd00; + result = bublbobl_objectram[offset]; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + result = Memory.mainram[offset]; + } + else if (address == 0xfa03) + { + result = dsw0; + } + else if (address == 0xfa04) + { + result = dsw1; + } + else if (address == 0xfa05) + { + result = (byte)sbyte0; + } + else if (address == 0xfa06) + { + result = (byte)sbyte1; + } + else if (address == 0xfa07) + { + result = (byte)sbyte2; + } + else if (address == 0xfc00) + { + result = 0; + } + else if (address == 0xfe00) + { + result = tokiob_mcu_r(); + } + else + { + result = 0; + } + return result; + } + public static byte Z0ReadMemory_bootleg(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address >= 0xc000 && address <= 0xdcff) + { + int offset = address - 0xc000; + result = videoram[offset]; + } + else if (address >= 0xdd00 && address <= 0xdfff) + { + int offset = address - 0xdd00; + result = bublbobl_objectram[offset]; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + result = Memory.mainram[offset]; + } + else if (address >= 0xfc00 && address <= 0xfcff) + { + int offset = address - 0xfc00; + result = mainram2[offset]; + } + else if (address >= 0xfd00 && address <= 0xfdff) + { + int offset = address - 0xfd00; + result = mainram3[offset]; + } + else if (address >= 0xfe00 && address <= 0xfe03) + { + int offset = address - 0xfe00; + result = boblbobl_ic43_a_r(offset); + } + else if (address >= 0xfe80 && address <= 0xfe83) + { + int offset = address - 0xfe80; + result = boblbobl_ic43_b_r(offset); + } + else if (address == 0xff00) + { + result = dsw0; + } + else if (address == 0xff01) + { + result = dsw1; + } + else if (address == 0xff02) + { + result = (byte)sbyte0; + } + else if (address == 0xff03) + { + result = (byte)sbyte1; + } + else + { + result = 0; + } + return result; + } + public static void Z0WriteMemory_tokio(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + Memory.mainrom[basebankmain + offset] = value; + } + else if (address >= 0xc000 && address <= 0xdcff) + { + int offset = address - 0xc000; + videoram[offset] = value; + } + else if (address >= 0xdd00 && address <= 0xdfff) + { + int offset = address - 0xdd00; + bublbobl_objectram[offset] = value; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + Memory.mainram[offset] = value; + } + else if (address >= 0xf800 && address <= 0xf9ff) + { + int offset = address - 0xf800; + Generic.paletteram_RRRRGGGGBBBBxxxx_be_w(offset, value); + } + else if (address == 0xfa00) + { + Generic.watchdog_reset_w(); + } + else if (address == 0xfa80) + { + tokio_bankswitch_w(value); + } + else if (address == 0xfb00) + { + tokio_videoctrl_w(value); + } + else if (address == 0xfb80) + { + bublbobl_nmitrigger_w(); + } + else if (address == 0xfc00) + { + bublbobl_sound_command_w(value); + } + else if (address == 0xfe00) + { + + } + } + public static void Z0WriteMemory_bootleg(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + Memory.mainrom[basebankmain + offset] = value; + } + else if (address >= 0xc000 && address <= 0xdcff) + { + int offset = address - 0xc000; + videoram[offset] = value; + } + else if (address >= 0xdd00 && address <= 0xdfff) + { + int offset = address - 0xdd00; + bublbobl_objectram[offset] = value; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + Memory.mainram[offset] = value; + } + else if (address >= 0xf800 && address <= 0xf9ff) + { + int offset = address - 0xf800; + Generic.paletteram_RRRRGGGGBBBBxxxx_be_w(offset, value); + } + else if (address == 0xfa00) + { + bublbobl_sound_command_w(value); + } + else if (address == 0xfa03) + { + + } + else if (address == 0xfa80) + { + + } + else if (address == 0xfb40) + { + bublbobl_bankswitch_w(value); + } + else if (address >= 0xfc00 && address <= 0xfcff) + { + int offset = address - 0xfc00; + mainram2[offset] = value; + } + else if (address >= 0xfd00 && address <= 0xfdff) + { + int offset = address - 0xfd00; + mainram3[offset] = value; + } + else if (address >= 0xfe00 && address <= 0xfe03) + { + int offset = address - 0xfe00; + boblbobl_ic43_a_w(offset); + } + else if (address >= 0xfe80 && address <= 0xfe83) + { + int offset = address - 0xfe80; + boblbobl_ic43_b_w(offset, value); + } + else if (address == 0xff94) + { + + } + else if (address == 0xff98) + { + + } + } + public static byte Z1ReadOp_tokio(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = slaverom[address]; + } + else if (address >= 0x8000 && address <= 0x97ff) + { + int offset = address - 0x8000; + result = Memory.mainram[offset]; + } + return result; + } + public static byte Z1ReadMemory_tokio(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = slaverom[address]; + } + else if (address >= 0x8000 && address <= 0x97ff) + { + int offset = address - 0x8000; + result = Memory.mainram[offset]; + } + return result; + } + public static void Z1WriteMemory_tokio(ushort address, byte value) + { + if (address <= 0x7fff) + { + slaverom[address] = value; + } + else if (address >= 0x8000 && address <= 0x97ff) + { + int offset = address - 0x8000; + Memory.mainram[offset] = value; + } + } + public static byte Z2ReadMemory_tokio(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x8fff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else if (address == 0x9000) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address == 0x9800) + { + result = 0; + } + else if (address == 0xb000) + { + result = YM2203.ym2203_status_port_0_r(); + } + else if (address == 0xb001) + { + result = YM2203.ym2203_read_port_0_r(); + } + else if (address >= 0xe000 && address <= 0xffff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static void Z2WriteMemory_tokio(ushort address, byte value) + { + if (address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0x8000 && address <= 0x8fff) + { + int offset = address - 0x8000; + Memory.audioram[offset] = value; + } + else if (address == 0x9000) + { + + } + else if (address == 0xa000) + { + bublbobl_sh_nmi_disable_w(); + } + else if (address == 0xa800) + { + bublbobl_sh_nmi_enable_w(); + } + else if (address == 0xb000) + { + YM2203.ym2203_control_port_0_w(value); + } + else if (address == 0xb001) + { + YM2203.ym2203_write_port_0_w(value); + } + else if (address >= 0xe000 && address <= 0xffff) + { + Memory.audiorom[address] = value; + } + } + public static byte Z0ReadOp_bublbobl(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.mainrom[basebankmain + offset]; + } + else + { + result = 0; + } + return result; + } + public static byte Z0ReadMemory_bublbobl(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + result = Memory.mainrom[basebankmain + offset]; + } + else if (address >= 0xc000 && address <= 0xdcff) + { + int offset = address - 0xc000; + result = videoram[offset]; + } + else if (address >= 0xdd00 && address <= 0xdfff) + { + int offset = address - 0xdd00; + result = bublbobl_objectram[offset]; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + result = Memory.mainram[offset]; + } + else if (address >= 0xfc00 && address <= 0xffff) + { + int offset = address - 0xfc00; + result = bublbobl_mcu_sharedram[offset]; + } + else + { + result = 0; + } + return result; + } + public static void Z0WriteMemory_bublbobl(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + int offset = address - 0x8000; + Memory.mainrom[basebankmain + offset] = value; + } + else if (address >= 0xc000 && address <= 0xdcff) + { + int offset = address - 0xc000; + videoram[offset] = value; + } + else if (address >= 0xdd00 && address <= 0xdfff) + { + int offset = address - 0xdd00; + bublbobl_objectram[offset] = value; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + Memory.mainram[offset] = value; + } + else if (address >= 0xf800 && address <= 0xf9ff) + { + int offset = address - 0xf800; + Generic.paletteram_RRRRGGGGBBBBxxxx_be_w(offset, value); + } + else if (address == 0xfa00) + { + bublbobl_sound_command_w(value); + } + else if (address == 0xfa80) + { + Watchdog.watchdog_reset(); + } + else if (address == 0xfb40) + { + bublbobl_bankswitch_w(value); + } + else if (address >= 0xfc00 && address <= 0xffff) + { + int offset = address - 0xfc00; + bublbobl_mcu_sharedram[offset] = value; + } + } + public static byte Z0ReadHardware(ushort address) + { + return 0; + } + public static void Z0WriteHardware(ushort address, byte value) + { + + } + public static int Z0IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[0].cpunum, 0); + } + public static byte Z1ReadOp_bublbobl(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = slaverom[address]; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + result = Memory.mainram[offset]; + } + return result; + } + public static byte Z1ReadMemory_bublbobl(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = slaverom[address]; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + result = Memory.mainram[offset]; + } + return result; + } + public static void Z1WriteMemory_bublbobl(ushort address, byte value) + { + if (address <= 0x7fff) + { + slaverom[address] = value; + } + else if (address >= 0xe000 && address <= 0xf7ff) + { + int offset = address - 0xe000; + Memory.mainram[offset] = value; + } + } + public static byte Z1ReadHardware(ushort address) + { + byte result = 0; + address &= 0xff; + return result; + } + public static void Z1WriteHardware(ushort address, byte value) + { + address &= 0xff; + + } + public static int Z1IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[1].cpunum, 0); + } + public static byte Z2ReadOp_bublbobl(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x8fff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + return result; + } + public static byte Z2ReadMemory_bublbobl(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x8000 && address <= 0x8fff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else if (address == 0x9000) + { + result = YM2203.ym2203_status_port_0_r(); + } + else if (address == 0x9001) + { + result = YM2203.ym2203_read_port_0_r(); + } + else if (address == 0xa000) + { + result = YM3812.ym3526_status_port_0_r(); + } + else if (address == 0xb000) + { + result = (byte)Sound.soundlatch_r(); + } + else if (address >= 0xe000 && address <= 0xffff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static void Z2WriteMemory_bublbobl(ushort address, byte value) + { + if (address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0x8000 && address <= 0x8fff) + { + int offset = address - 0x8000; + Memory.audioram[offset] = value; + } + else if (address == 0x9000) + { + YM2203.ym2203_control_port_0_w(value); + } + else if (address == 0x9001) + { + YM2203.ym2203_write_port_0_w(value); + } + else if (address == 0xa000) + { + YM3812.ym3526_control_port_0_w(value); + } + else if (address == 0xa001) + { + YM3812.ym3526_write_port_0_w(value); + } + else if (address == 0xb001) + { + bublbobl_sh_nmi_enable_w(); + } + else if (address == 0xb002) + { + bublbobl_sh_nmi_disable_w(); + } + else if (address >= 0xe000 && address <= 0xffff) + { + Memory.audiorom[address] = value; + } + } + public static byte Z2ReadHardware(ushort address) + { + byte result = 0; + address &= 0xff; + return result; + } + public static void Z2WriteHardware(ushort address, byte value) + { + address &= 0xff; + } + public static int Z2IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[2].cpunum, 0); + } + public static byte MReadOp_bublbobl(ushort address) + { + byte result = 0; + if (address >= 0x0040 && address <= 0x00ff) + { + int offset = address - 0x0040; + result = mcuram[offset]; + } + else if (address >= 0xf000 && address <= 0xffff) + { + result = mcurom[address]; + } + return result; + } + public static byte MReadMemory_bublbobl(ushort address) + { + byte result = 0; + if (address == 0x0000) + { + result = bublbobl_mcu_ddr1_r(); + } + else if (address == 0x0001) + { + result = bublbobl_mcu_ddr2_r(); + } + else if (address == 0x0002) + { + result = bublbobl_mcu_port1_r(); + } + else if (address == 0x0003) + { + result = bublbobl_mcu_port2_r(); + } + else if (address == 0x0004) + { + result = bublbobl_mcu_ddr3_r(); + } + else if (address == 0x0005) + { + result = bublbobl_mcu_ddr4_r(); + } + else if (address == 0x0006) + { + result = bublbobl_mcu_port3_r(); + } + else if (address == 0x0007) + { + result = bublbobl_mcu_port4_r(); + } + else if (address >= 0x0040 && address <= 0x00ff) + { + int offset = address - 0x0040; + result = mcuram[offset]; + } + else if (address >= 0xf000 && address <= 0xffff) + { + result = mcurom[address]; + } + return result; + } + public static void MWriteMemory_bublbobl(ushort address, byte value) + { + if (address == 0x0000) + { + bublbobl_mcu_ddr1_w(value); + } + else if (address == 0x0001) + { + bublbobl_mcu_ddr2_w(value); + } + else if (address == 0x0002) + { + bublbobl_mcu_port1_w(value); + } + else if (address == 0x0003) + { + bublbobl_mcu_port2_w(value); + } + else if (address == 0x0004) + { + bublbobl_mcu_ddr3_w(value); + } + else if (address == 0x0005) + { + bublbobl_mcu_ddr4_w(value); + } + else if (address == 0x0006) + { + bublbobl_mcu_port3_w(value); + } + else if (address == 0x0007) + { + bublbobl_mcu_port4_w(value); + } + else if (address >= 0x0040 && address <= 0x00ff) + { + int offset = address - 0x0040; + mcuram[offset] = value; + } + else if (address >= 0xf000 && address <= 0xffff) + { + mcurom[address] = value; + } + } + public static byte MReadOp_bootleg(ushort address) + { + byte result = 0; + address &= 0x7ff; + if (address >= 0x010 && address <= 0x07f) + { + result = mcuram[address]; + } + else if (address >= 0x080 && address <= 0x7ff) + { + result = mcurom[address]; + } + return result; + } + public static byte MReadMemory_bootleg(ushort address) + { + byte result = 0; + address &= 0x7ff; + if (address == 0x000) + { + result = bublbobl_68705_portA_r(); + } + else if (address == 0x001) + { + result = bublbobl_68705_portB_r(); + } + else if (address == 0x002) + { + result = (byte)sbyte0; + } + else if (address >= 0x010 && address <= 0x07f) + { + result = mcuram[address]; + } + else if (address >= 0x080 && address <= 0x7ff) + { + result = mcurom[address]; + } + return result; + } + public static void MWriteMemory_bootleg(ushort address, byte value) + { + address &= 0x7ff; + if (address == 0x000) + { + bublbobl_68705_portA_w(value); + } + else if (address == 0x001) + { + bublbobl_68705_portB_w(value); + } + else if (address == 0x004) + { + bublbobl_68705_ddrA_w(value); + } + else if (address == 0x005) + { + bublbobl_68705_ddrB_w(value); + } + else if (address == 0x006) + { + + } + else if (address >= 0x010 && address <= 0x07f) + { + mcuram[address] = value; + } + else if (address >= 0x080 && address <= 0x7ff) + { + mcurom[address] = value; + } + } + public static sbyte MReadOpByte_opwolf(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + return result; + } + public static sbyte MReadByte_opwolf(int address) + { + address &= 0xffffff; + sbyte result = 0; + int add1; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x0f0000 && address <= 0x0fffff) + { + add1 = address & 0xfff; + if (add1 >= 0 && add1 <= 0x7ff) + { + int offset = add1 / 2; + if (add1 % 2 == 0) + { + result = (sbyte)(opwolf_cchip_data_r(offset) >> 8); + } + else if (add1 % 2 == 1) + { + result = (sbyte)opwolf_cchip_data_r(offset); + } + } + else if (add1 >= 0x802 && add1 <= 0x803) + { + if (add1 == 0x802) + { + result = 0; + } + else if (add1 == 0x803) + { + result = (sbyte)opwolf_cchip_status_r(); + } + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x380000 && address <= 0x380003) + { + int offset = (address - 0x380000) / 2; + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)opwolf_dsw_r(offset); + } + } + else if (address >= 0x3a0000 && address <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(opwolf_lightgun_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)opwolf_lightgun_r(offset); + } + } + else if (address >= 0x3e0000 && address <= 0x3e0001) + { + result = 0; + } + else if (address >= 0x3e0002 && address <= 0x3e0003) + { + if (address % 2 == 0) + { + result = (sbyte)(Taitosnd.taitosound_comm16_msb_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Taitosnd.taitosound_comm16_msb_r(); + } + } + else if (address >= 0xc00000 && address <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(PC080SN_word_0_r(offset) >> 8); + } + else + { + result = (sbyte)PC080SN_word_0_r(offset); + } + } + else if (address >= 0xd00000 && address <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(PC090OJ_word_0_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)PC090OJ_word_0_r(offset); + } + } + return result; + } + public static short MReadOpWord_opwolf(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_opwolf(int address) + { + address &= 0xffffff; + short result = 0; + int add1; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x0f0000 && address <= 0x0fffff) + { + add1 = address & 0xfff; + if (add1 >= 0 && add1 <= 0x7ff) + { + int offset = add1 / 2; + result = (short)opwolf_cchip_data_r(offset); + } + else if (add1 >= 0x802 && add1 <= 0x803) + { + result = (short)opwolf_cchip_status_r(); + } + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x380000 && address + 1 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + result = (short)opwolf_dsw_r(offset); + } + else if (address >= 0x3a0000 && address + 1 <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + result = (short)opwolf_lightgun_r(offset); + } + else if (address >= 0x3e0000 && address + 1 <= 0x3e0001) + { + result = 0; + } + else if (address >= 0x3e0002 && address + 1 <= 0x3e0003) + { + result = (short)Taitosnd.taitosound_comm16_msb_r(); + } + else if (address >= 0xc00000 && address + 1 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + result = (short)PC080SN_word_0_r(offset); + } + else if (address >= 0xd00000 && address + 1 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + result = (short)PC090OJ_word_0_r(offset); + } + return result; + } + public static int MReadOpLong_opwolf(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MReadLong_opwolf(int address) + { + address &= 0xffffff; + int result = 0; + int add1; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x0f0000 && address <= 0x0fffff) + { + add1 = address & 0xfff; + if (add1 >= 0 && add1 <= 0x7ff) + { + int offset = add1 / 2; + result = (int)(opwolf_cchip_data_r(offset) * 0x10000 + opwolf_cchip_data_r(offset + 1)); + } + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x380000 && address + 3 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + result = (int)(opwolf_dsw_r(offset) * 0x10000 + opwolf_dsw_r(offset + 1)); + } + else if (address >= 0x3a0000 && address + 3 <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + result = (int)(opwolf_lightgun_r(offset) * 0x10000 + opwolf_lightgun_r(offset + 1)); + } + else if (address >= 0xc00000 && address + 3 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + result = (int)(PC080SN_word_0_r(offset) * 0x10000 + PC080SN_word_0_r(offset + 1)); + } + else if (address >= 0xd00000 && address + 3 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + result = (int)(PC090OJ_word_0_r(offset) * 0x10000 + PC090OJ_word_0_r(offset + 1)); + } + return result; + } + public static void MWriteByte_opwolf(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x000000 && address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)value; + } + } + else if (address >= 0x0ff000 && address <= 0x0ff7ff) + { + int offset = (address - 0x0ff000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + opwolf_cchip_data_w2(offset, (byte)value); + } + } + else if (address >= 0x0ff802 && address <= 0x0ff803) + { + opwolf_cchip_status_w(); + } + else if (address >= 0x0ffc00 && address <= 0x0ffc01) + { + if (address == 0x0ffc01) + { + opwolf_cchip_bank_w((byte)value); + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w2(offset, (byte)value); + } + } + else if (address >= 0x380000 && address <= 0x380003) + { + int offset = (address - 0x380000) / 2; + if (address % 2 == 1) + { + opwolf_spritectrl_w2(offset, (byte)value); + } + } + else if (address >= 0x3c0000 && address <= 0x3c0001) + { + int i1 = 1; + } + else if (address >= 0x3e0000 && address <= 0x3e0001) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_port16_msb_w1((byte)value); + } + } + else if (address >= 0x3e0002 && address <= 0x3e0003) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_comm16_msb_w1((byte)value); + } + } + else if (address >= 0xc00000 && address <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + if (address % 2 == 0) + { + PC080SN_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc10000 && address <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)value; + } + else if (address >= 0xc20000 && address <= 0xc20003) + { + int offset = (address - 0xc20000) / 2; + if (address % 2 == 0) + { + PC080SN_yscroll_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_yscroll_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc40000 && address <= 0xc40003) + { + int offset = (address - 0xc40000) / 2; + if (address % 2 == 0) + { + PC080SN_xscroll_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_xscroll_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc50000 && address <= 0xc50003) + { + int offset = (address - 0xc50000) / 2; + if (address % 2 == 0) + { + PC080SN_ctrl_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_ctrl_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xd00000 && address <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + if (address % 2 == 0) + { + PC090OJ_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC090OJ_word_0_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_opwolf(int address, short value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 1 <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; + } + } + else if (address >= 0x0ff000 && address + 1 <= 0x0ff7ff) + { + int offset = (address - 0x0ff000) / 2; + opwolf_cchip_data_w(offset, (ushort)value); + } + else if (address >= 0x0ff802 && address + 1 <= 0x0ff803) + { + opwolf_cchip_status_w(); + } + else if (address >= 0x0ffc00 && address + 1 <= 0x0ffc01) + { + opwolf_cchip_bank_w((byte)value); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)value); + } + else if (address >= 0x380000 && address + 1 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + opwolf_spritectrl_w(offset, (ushort)value); + } + else if (address >= 0x3c0000 && address + 1 <= 0x3c0001) + { + int i1 = 1; + } + else if (address >= 0x3e0000 && address + 1 <= 0x3e0001) + { + Taitosnd.taitosound_port16_msb_w((ushort)value); + } + else if (address >= 0x3e0002 && address + 1 <= 0x3e0003) + { + Taitosnd.taitosound_comm16_msb_w((ushort)value); + } + else if (address >= 0xc00000 && address + 1 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + PC080SN_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc10000 && address + 1 <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0xc20000 && address + 1 <= 0xc20003) + { + int offset = (address - 0xc20000) / 2; + PC080SN_yscroll_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc40000 && address + 1 <= 0xc40003) + { + int offset = (address - 0xc40000) / 2; + PC080SN_xscroll_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc50000 && address + 1 <= 0xc50003) + { + int offset = (address - 0xc50000) / 2; + PC080SN_ctrl_word_0_w(offset, (ushort)value); + } + else if (address >= 0xd00000 && address + 1 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + PC090OJ_word_0_w(offset, (ushort)value); + } + } + public static void MWriteLong_opwolf(int address, int value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 3 <= 0x03ffff) + { + 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; + } + } + else if (address >= 0x0ff000 && address + 3 <= 0x0ff7ff) + { + int offset = (address - 0x0ff000) / 2; + opwolf_cchip_data_w(offset, (ushort)(value >> 16)); + opwolf_cchip_data_w(offset + 1, (ushort)value); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x380000 && address + 3 <= 0x380003) + { + int i1 = 1; + } + else if (address >= 0xc00000 && address + 3 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + PC080SN_word_0_w(offset, (ushort)(value >> 16)); + PC080SN_word_0_w(offset + 1, (ushort)value); + } + else if (address >= 0xc10000 && address + 3 <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0xd00000 && address + 3 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + PC090OJ_word_0_w(offset, (ushort)(value >> 16)); + PC090OJ_word_0_w(offset + 1, (ushort)value); + } + } + public static sbyte MReadByte_opwolfb(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x0f0008 && address <= 0x0f000b) + { + int offset = (address - 0x0f0008) / 2; + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)opwolf_in_r(offset); + } + } + else if (address >= 0x0ff000 && address <= 0x0fffff) + { + int offset = (address - 0x0ff000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(cchip_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)cchip_r(offset); + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x380000 && address <= 0x380003) + { + int offset = (address - 0x380000) / 2; + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)opwolf_dsw_r(offset); + } + } + else if (address >= 0x3a0000 && address <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(opwolf_lightgun_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)opwolf_lightgun_r(offset); + } + } + else if (address >= 0x3e0000 && address <= 0x3e0001) + { + result = 0; + } + else if (address >= 0x3e0002 && address <= 0x3e0003) + { + if (address % 2 == 0) + { + result = (sbyte)(Taitosnd.taitosound_comm16_msb_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Taitosnd.taitosound_comm16_msb_r(); + } + } + else if (address >= 0xc00000 && address <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(PC080SN_word_0_r(offset) >> 8); + } + else + { + result = (sbyte)PC080SN_word_0_r(offset); + } + } + else if (address >= 0xd00000 && address <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(PC090OJ_word_0_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)PC090OJ_word_0_r(offset); + } + } + return result; + } + public static short MReadOpWord_opwolfb(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + return result; + } + public static short MReadWord_opwolfb(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x0f0008 && address + 1 <= 0x0f000b) + { + int offset = (address - 0x0f0008) / 2; + result = (short)opwolf_in_r(offset); + } + else if (address >= 0x0ff000 && address + 1 <= 0x0fffff) + { + int offset = (address - 0x0ff000) / 2; + result = (short)cchip_r(offset); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x380000 && address + 1 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + result = (short)opwolf_dsw_r(offset); + } + else if (address >= 0x3a0000 && address + 1 <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + result = (short)opwolf_lightgun_r(offset); + } + else if (address >= 0x3e0000 && address + 1 <= 0x3e0001) + { + result = 0; + } + else if (address >= 0x3e0002 && address + 1 <= 0x3e0003) + { + result = (short)Taitosnd.taitosound_comm16_msb_r(); + } + else if (address >= 0xc00000 && address + 1 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + result = (short)PC080SN_word_0_r(offset); + } + else if (address >= 0xd00000 && address + 1 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + result = (short)PC090OJ_word_0_r(offset); + } + return result; + } + public static int MReadOpLong_opwolfb(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + return result; + } + public static int MReadLong_opwolfb(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x0f0008 && address + 3 <= 0x0f000b) + { + int offset = (address - 0x0f0008) / 2; + result = (int)(opwolf_in_r(offset) * 0x10000 + opwolf_in_r(offset + 1)); + } + else if (address >= 0x0ff000 && address + 3 <= 0x0fffff) + { + int offset = (address - 0x0ff000) / 2; + result = (int)(cchip_r(offset) * 0x10000 + cchip_r(offset + 1)); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x380000 && address + 3 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + result = (int)(opwolf_dsw_r(offset) * 0x10000 + opwolf_dsw_r(offset + 1)); + } + else if (address >= 0x3a0000 && address + 3 <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + result = (int)(opwolf_lightgun_r(offset) * 0x10000 + opwolf_lightgun_r(offset + 1)); + } + else if (address >= 0xc00000 && address + 3 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + result = (int)(PC080SN_word_0_r(offset) * 0x10000 + PC080SN_word_0_r(offset + 1)); + } + else if (address >= 0xd00000 && address + 3 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + result = (int)(PC090OJ_word_0_r(offset) * 0x10000 + PC090OJ_word_0_r(offset + 1)); + } + return result; + } + public static void MWriteByte_opwolfb(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x000000 && address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)value; + } + } + else if (address >= 0x0ff000 && address <= 0x0fffff) + { + int offset = (address - 0x0ff000) / 2; + if (address % 2 == 0) + { + + } + else if (address % 2 == 1) + { + cchip_w(offset, (byte)value); + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w2(offset, (byte)value); + } + } + else if (address >= 0x380000 && address <= 0x380003) + { + int offset = (address - 0x380000) / 2; + if (address % 2 == 1) + { + opwolf_spritectrl_w2(offset, (byte)value); + } + } + else if (address >= 0x3c0000 && address <= 0x3c0001) + { + int i1 = 1; + } + else if (address >= 0x3e0000 && address <= 0x3e0001) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_port16_msb_w1((byte)value); + } + } + else if (address >= 0x3e0002 && address <= 0x3e0003) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_comm16_msb_w1((byte)value); + } + } + else if (address >= 0xc00000 && address <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + if (address % 2 == 0) + { + PC080SN_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc10000 && address <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)value; + } + else if (address >= 0xc20000 && address <= 0xc20003) + { + int offset = (address - 0xc20000) / 2; + if (address % 2 == 0) + { + PC080SN_yscroll_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_yscroll_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc40000 && address <= 0xc40003) + { + int offset = (address - 0xc40000) / 2; + if (address % 2 == 0) + { + PC080SN_xscroll_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_xscroll_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc50000 && address <= 0xc50003) + { + int offset = (address - 0xc50000) / 2; + if (address % 2 == 0) + { + PC080SN_ctrl_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_ctrl_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xd00000 && address <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + if (address % 2 == 0) + { + PC090OJ_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC090OJ_word_0_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_opwolfb(int address, short value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 1 <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; + } + } + else if (address >= 0x0ff000 && address + 1 <= 0x0fffff) + { + int offset = (address - 0x0ff000) / 2; + cchip_w(offset, (byte)value); + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)value); + } + else if (address >= 0x380000 && address + 1 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + opwolf_spritectrl_w(offset, (ushort)value); + } + else if (address >= 0x3c0000 && address + 1 <= 0x3c0001) + { + int i1 = 1; + } + else if (address >= 0x3e0000 && address + 1 <= 0x3e0001) + { + Taitosnd.taitosound_port16_msb_w((ushort)value); + } + else if (address >= 0x3e0002 && address + 1 <= 0x3e0003) + { + Taitosnd.taitosound_comm16_msb_w((ushort)value); + } + else if (address >= 0xc00000 && address + 1 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + PC080SN_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc10000 && address + 1 <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0xc20000 && address + 1 <= 0xc20003) + { + int offset = (address - 0xc20000) / 2; + PC080SN_yscroll_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc40000 && address + 1 <= 0xc40003) + { + int offset = (address - 0xc40000) / 2; + PC080SN_xscroll_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc50000 && address + 1 <= 0xc50003) + { + int offset = (address - 0xc50000) / 2; + PC080SN_ctrl_word_0_w(offset, (ushort)value); + } + else if (address >= 0xd00000 && address + 1 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + PC090OJ_word_0_w(offset, (ushort)value); + } + } + public static void MWriteLong_opwolfb(int address, int value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 3 <= 0x03ffff) + { + 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; + } + } + else if (address >= 0x0ff000 && address + 3 <= 0x0fffff) + { + int offset = (address - 0x0ff000) / 2; + cchip_w(offset, (byte)(value >> 16)); + cchip_w(offset + 1, (byte)value); + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x380000 && address + 3 <= 0x380003) + { + int i1 = 1; + } + else if (address >= 0xc00000 && address + 3 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + PC080SN_word_0_w(offset, (ushort)(value >> 16)); + PC080SN_word_0_w(offset + 1, (ushort)value); + } + else if (address >= 0xc10000 && address + 3 <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0xd00000 && address + 3 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + PC090OJ_word_0_w(offset, (ushort)(value >> 16)); + PC090OJ_word_0_w(offset + 1, (ushort)value); + } + } + public static sbyte MReadByte_opwolfp(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)(Memory.mainrom[address]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = address - 0x100000; + result = (sbyte)Memory.mainram[offset]; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x380000 && address <= 0x380003) + { + int offset = (address - 0x380000) / 2; + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)opwolf_dsw_r(offset); + } + } + else if (address >= 0x3a0000 && address <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(opwolf_lightgun_r_p(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)opwolf_lightgun_r_p(offset); + } + } + else if (address >= 0x3e0000 && address <= 0x3e0001) + { + result = 0; + } + else if (address >= 0x3e0002 && address <= 0x3e0003) + { + if (address % 2 == 0) + { + result = (sbyte)(Taitosnd.taitosound_comm16_msb_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Taitosnd.taitosound_comm16_msb_r(); + } + } + else if (address >= 0xc00000 && address <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(PC080SN_word_0_r(offset) >> 8); + } + else + { + result = (sbyte)PC080SN_word_0_r(offset); + } + } + else if (address >= 0xd00000 && address <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(PC090OJ_word_0_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)PC090OJ_word_0_r(offset); + } + } + return result; + } + public static short MReadWord_opwolfp(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x03ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = address - 0x100000; + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x380000 && address + 1 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + result = (short)opwolf_dsw_r(offset); + } + else if (address >= 0x3a0000 && address + 1 <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + result = (short)opwolf_lightgun_r_p(offset); + } + else if (address >= 0x3e0000 && address + 1 <= 0x3e0001) + { + result = 0; + } + else if (address >= 0x3e0002 && address + 1 <= 0x3e0003) + { + result = (short)Taitosnd.taitosound_comm16_msb_r(); + } + else if (address >= 0xc00000 && address + 1 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + result = (short)PC080SN_word_0_r(offset); + } + else if (address >= 0xd00000 && address + 1 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + result = (short)PC090OJ_word_0_r(offset); + } + return result; + } + public static int MReadLong_opwolfp(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x03ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = address - 0x100000; + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x380000 && address + 3 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + result = (int)(opwolf_dsw_r(offset) * 0x10000 + opwolf_dsw_r(offset + 1)); + } + else if (address >= 0x3a0000 && address + 3 <= 0x3a0003) + { + int offset = (address - 0x3a0000) / 2; + result = (int)(opwolf_lightgun_r(offset) * 0x10000 + opwolf_lightgun_r(offset + 1)); + } + else if (address >= 0xc00000 && address + 3 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + result = (int)(PC080SN_word_0_r(offset) * 0x10000 + PC080SN_word_0_r(offset + 1)); + } + else if (address >= 0xd00000 && address + 3 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + result = (int)(PC090OJ_word_0_r(offset) * 0x10000 + PC090OJ_word_0_r(offset + 1)); + } + return result; + } + public static void MWriteByte_opwolfp(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x000000 && address <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)value; + } + } + else if (address >= 0x100000 && address <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x200000 && address <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w2(offset, (byte)value); + } + } + else if (address >= 0x380000 && address <= 0x380003) + { + int offset = (address - 0x380000) / 2; + if (address % 2 == 1) + { + opwolf_spritectrl_w2(offset, (byte)value); + } + } + else if (address >= 0x3c0000 && address <= 0x3c0001) + { + int i1 = 1; + } + else if (address >= 0x3e0000 && address <= 0x3e0001) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_port16_msb_w1((byte)value); + } + } + else if (address >= 0x3e0002 && address <= 0x3e0003) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_comm16_msb_w1((byte)value); + } + } + else if (address >= 0xc00000 && address <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + if (address % 2 == 0) + { + PC080SN_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc10000 && address <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)value; + } + else if (address >= 0xc20000 && address <= 0xc20003) + { + int offset = (address - 0xc20000) / 2; + if (address % 2 == 0) + { + PC080SN_yscroll_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_yscroll_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc40000 && address <= 0xc40003) + { + int offset = (address - 0xc40000) / 2; + if (address % 2 == 0) + { + PC080SN_xscroll_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_xscroll_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xc50000 && address <= 0xc50003) + { + int offset = (address - 0xc50000) / 2; + if (address % 2 == 0) + { + PC080SN_ctrl_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC080SN_ctrl_word_0_w2(offset, (byte)value); + } + } + else if (address >= 0xd00000 && address <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + if (address % 2 == 0) + { + PC090OJ_word_0_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + PC090OJ_word_0_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_opwolfp(int address, short value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 1 <= 0x03ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; + } + } + else if (address >= 0x100000 && address + 1 <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x200000 && address + 1 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)value); + } + else if (address >= 0x380000 && address + 1 <= 0x380003) + { + int offset = (address - 0x380000) / 2; + opwolf_spritectrl_w(offset, (ushort)value); + } + else if (address >= 0x3c0000 && address + 1 <= 0x3c0001) + { + int i1 = 1; + } + else if (address >= 0x3e0000 && address + 1 <= 0x3e0001) + { + Taitosnd.taitosound_port16_msb_w((ushort)value); + } + else if (address >= 0x3e0002 && address + 1 <= 0x3e0003) + { + Taitosnd.taitosound_comm16_msb_w((ushort)value); + } + else if (address >= 0xc00000 && address + 1 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + PC080SN_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc10000 && address + 1 <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0xc20000 && address + 1 <= 0xc20003) + { + int offset = (address - 0xc20000) / 2; + PC080SN_yscroll_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc40000 && address + 1 <= 0xc40003) + { + int offset = (address - 0xc40000) / 2; + PC080SN_xscroll_word_0_w(offset, (ushort)value); + } + else if (address >= 0xc50000 && address + 1 <= 0xc50003) + { + int offset = (address - 0xc50000) / 2; + PC080SN_ctrl_word_0_w(offset, (ushort)value); + } + else if (address >= 0xd00000 && address + 1 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + PC090OJ_word_0_w(offset, (ushort)value); + } + } + public static void MWriteLong_opwolfp(int address, int value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 3 <= 0x03ffff) + { + 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; + } + } + else if (address >= 0x100000 && address + 3 <= 0x107fff) + { + int offset = address - 0x100000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x200000 && address + 3 <= 0x200fff) + { + int offset = (address - 0x200000) / 2; + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_xxxxRRRRGGGGBBBB_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x380000 && address + 3 <= 0x380003) + { + int i1 = 1; + } + else if (address >= 0xc00000 && address + 3 <= 0xc0ffff) + { + int offset = (address - 0xc00000) / 2; + PC080SN_word_0_w(offset, (ushort)(value >> 16)); + PC080SN_word_0_w(offset + 1, (ushort)value); + } + else if (address >= 0xc10000 && address + 3 <= 0xc1ffff) + { + int offset = address - 0xc10000; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0xd00000 && address + 3 <= 0xd03fff) + { + int offset = (address - 0xd00000) / 2; + PC090OJ_word_0_w(offset, (ushort)(value >> 16)); + PC090OJ_word_0_w(offset + 1, (ushort)value); + } + } + public static byte ZReadOp_opwolf(ushort address) + { + byte result = 0; + if (address <= 0x3fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x4000 && address <= 0x7fff) + { + int offset = address - 0x4000; + result = Memory.audiorom[basebanksnd + offset]; + } + return result; + } + public static byte ZReadMemory_opwolf(ushort address) + { + byte result = 0; + if (address <= 0x3fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x4000 && address <= 0x7fff) + { + int offset = address - 0x4000; + result = Memory.audiorom[basebanksnd + offset]; + } + else if (address >= 0x8000 && address <= 0x8fff) + { + int offset = address - 0x8000; + result = Memory.audioram[offset]; + } + else if (address == 0x9001) + { + result = YM2151.ym2151_status_port_0_r(); + } + else if (address >= 0x9002 && address <= 0x9100) + { + int offset = address - 0x9002; + result = Memory.audioram[offset]; + } + else if (address == 0xa001) + { + result = Taitosnd.taitosound_slave_comm_r(); + } + return result; + } + public static void ZWriteMemory_opwolf(ushort address, byte value) + { + if (address <= 0x3fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0x4000 && address <= 0x7fff) + { + int offset = address - 0x4000; + Memory.audiorom[basebanksnd + offset] = value; + } + else if (address >= 0x8000 && address <= 0x8fff) + { + int offset = address - 0x8000; + Memory.audioram[offset] = value; + } + else if (address == 0x9000) + { + YM2151.ym2151_register_port_0_w(value); + } + else if (address == 0x9001) + { + YM2151.ym2151_data_port_0_w(value); + } + else if (address == 0xa000) + { + Taitosnd.taitosound_slave_port_w(value); + } + else if (address == 0xa001) + { + Taitosnd.taitosound_slave_comm_w(value); + } + else if (address >= 0xb000 && address <= 0xb006) + { + int offset = address - 0xb000; + opwolf_adpcm_b_w(offset, value); + } + else if (address >= 0xc000 && address <= 0xc006) + { + int offset = address - 0xc000; + opwolf_adpcm_c_w(offset, value); + } + else if (address == 0xd000) + { + opwolf_adpcm_d_w(); + } + else if (address == 0xe000) + { + opwolf_adpcm_e_w(); + } + } + public static byte ZReadOp_opwolf_sub(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = subrom[address]; + } + return result; + } + public static byte ZReadMemory_opwolf_sub(ushort address) + { + byte result = 0; + if (address <= 0x7fff) + { + result = subrom[address]; + } + else if (address == 0x8800) + { + result = z80_input1_r(); + } + else if (address == 0x9800) + { + result = z80_input2_r(); + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + result = cchip_ram[offset]; + } + return result; + } + public static void ZWriteMemory_opwolf_sub(ushort address, byte value) + { + if (address <= 0x7fff) + { + subrom[address] = value; + } + else if (address == 0x8000) + { + int offset = address - 0x8000; + Memory.audioram[offset] = value; + } + else if (address == 0x9000) + { + int i1 = 1; + } + else if (address == 0xa000) + { + int i1 = 1; + } + else if (address >= 0xc000 && address <= 0xc7ff) + { + int offset = address - 0xc000; + cchip_ram[offset] = value; + } + } + public static byte MReadHardware(ushort address) + { + byte result = 0; + address &= 0xff; + if (address == 0x01) + { + result = (byte)Sound.soundlatch_r(); + } + return result; + } + public static void MWriteHardware(ushort address, byte value) + { + address &= 0xff; + } + public static int MIRQCallback() + { + return 0; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Memory.cs.meta new file mode 100644 index 00000000..230e04ea --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7079528269a26104fb9e79423d50c5fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Opwolf.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Opwolf.cs new file mode 100644 index 00000000..29c25c6c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Opwolf.cs @@ -0,0 +1,1026 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Taito + { + public static int opwolf_region; + public static byte[] cchip_ram, adpcmrom; + public static byte[] adpcm_b = new byte[0x08]; + public static byte[] adpcm_c = new byte[0x08]; + public static int opwolf_gun_xoffs, opwolf_gun_yoffs; + public static byte dswa, dswb, p1x, p1y; + public static int[] adpcm_pos = new int[2], adpcm_end = new int[2]; + public static int[] adpcm_data = new int[2]; + public static ushort m_sprite_ctrl; + public static ushort m_sprites_flipscreen; + public static byte current_bank = 0; + public static byte current_cmd = 0; + public static byte cchip_last_7a = 0; + public static byte cchip_last_04 = 0; + public static byte cchip_last_05 = 0; + public static byte[] cchip_coins_for_credit = new byte[2]; + public static byte[] cchip_credits_for_coin = new byte[2]; + public static byte[] cchip_coins = new byte[2]; + public static byte c588 = 0, c589 = 0, c58a = 0; + public static byte m_triggeredLevel1b; // These variables derived from comparison to unprotection version + public static byte m_triggeredLevel2; + public static byte m_triggeredLevel2b; + public static byte m_triggeredLevel2c; + public static byte m_triggeredLevel3b; + public static byte m_triggeredLevel13b; + public static byte m_triggeredLevel4; + public static byte m_triggeredLevel5; + public static byte m_triggeredLevel7; + public static byte m_triggeredLevel8; + public static byte m_triggeredLevel9; + public static ushort[] level_data_00 = new ushort[] + { + 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, + 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, + 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, + 0x0780, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0030, + 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0038, + 0x0780, 0x0309, 0x0300, 0x4d01, 0x0004, 0x0048, + 0x0980, 0x1108, 0x0300, 0x5a01, 0xc005, 0x0018, + 0x0980, 0x0109, 0x0300, 0x4b01, 0xc005, 0x0028, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0004, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8002, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0017, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8015, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x0007, 0x0034, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x0007, 0x8032, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x803e, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x803d, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x0008, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x000b, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001b, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001e, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x0038, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x003b, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8042, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8045, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x8007, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x801a, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x000c, 0x8037, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x0042, + 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x8009, + 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x801c, + 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x0044, + 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x0028, + 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x804b, + 0x0c00, 0x040b, 0x0000, 0xf501, 0x0008, 0x8026, + 0xffff + }; + public static ushort[] level_data_01 = new ushort[] + { + 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0010, + 0x0780, 0x0209, 0x0300, 0x4c01, 0x4004, 0x0020, + 0x0780, 0x0309, 0x0300, 0x4d01, 0xe003, 0x0030, + 0x0780, 0x0309, 0x0300, 0x4d01, 0x8003, 0x0040, + 0x0780, 0x0209, 0x0300, 0x4c01, 0x8004, 0x0018, + 0x0780, 0x0309, 0x0300, 0x4d01, 0xc003, 0x0028, + 0x0b80, 0x000b, 0x0000, 0x0b02, 0x8009, 0x0029, + 0x0b80, 0x0409, 0x0000, 0x0f02, 0x8008, 0x8028, + 0x0b80, 0x040a, 0x0000, 0x3502, 0x000a, 0x8028, + 0x0b80, 0x050a, 0x0000, 0x1002, 0x8006, 0x8028, + 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x004d, + 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x004f, + 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x0001, + 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x0003, + 0x0b80, 0x130a, 0x0000, 0x3a02, 0x0007, 0x0023, + 0x0b80, 0x130a, 0x0000, 0x3a02, 0x0007, 0x8025, + 0x0b80, 0x130a, 0x0000, 0x3a02, 0x8009, 0x0023, + 0x0b80, 0x130a, 0x0000, 0x3a02, 0x8009, 0x8025, + 0x0b80, 0x140a, 0x0000, 0x3e02, 0x0007, 0x000d, + 0x0b80, 0x140a, 0x0000, 0x3e02, 0x0007, 0x800f, + 0x0b80, 0x000b, 0x0000, 0x0102, 0x0007, 0x804e, + 0x0b80, 0xd24b, 0x0000, 0x0302, 0x0007, 0x000e, + 0x0b80, 0x000b, 0x0000, 0x0402, 0x8006, 0x0020, + 0x0b80, 0xd34b, 0x0000, 0x0502, 0x8006, 0x0024, + 0x0b80, 0x000b, 0x0000, 0x0602, 0x8009, 0x0001, + 0x0b80, 0xd44b, 0x0000, 0x0702, 0x800b, 0x800b, + 0x0b80, 0xd54b, 0x0000, 0x0802, 0x800b, 0x000e, + 0x0b80, 0x000b, 0x0000, 0x0902, 0x800b, 0x0010, + 0x0b80, 0x000b, 0x0000, 0x0a02, 0x0009, 0x0024, + 0x0b80, 0xd64b, 0x0000, 0x0c02, 0x000c, 0x8021, + 0x0b80, 0x000b, 0x0000, 0x0d02, 0x000c, 0x0025, + 0x0b80, 0x000b, 0x0000, 0x0e02, 0x8009, 0x004e, + 0x0b80, 0x000b, 0x0300, 0x4e01, 0x8006, 0x8012, + 0x0b80, 0x000b, 0x0300, 0x4e01, 0x0007, 0x8007, + 0xffff + }; + public static ushort[] level_data_02 = new ushort[] + { + 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0018, + 0x0480, 0x000b, 0x0300, 0x4501, 0x2001, 0x0030, + 0x0780, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0010, + 0x0780, 0x1208, 0x0300, 0x5d01, 0x2004, 0x001c, + 0x0780, 0x1208, 0x0300, 0x5d01, 0xe003, 0x0026, + 0x0780, 0x1208, 0x0300, 0x5d01, 0x8003, 0x0034, + 0x0780, 0x1208, 0x0300, 0x5d01, 0x3004, 0x0040, + 0x0780, 0x010c, 0x0300, 0x4601, 0x4004, 0x0022, + 0x0780, 0x010c, 0x0300, 0x4601, 0x6004, 0x0042, + 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0x0008, + 0x0780, 0x010c, 0x0300, 0x4601, 0x2004, 0x0008, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x0004, + 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x8003, + 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x000c, + 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x800b, + 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x001c, + 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x801b, + 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x002c, + 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x802b, + 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x0044, + 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x8043, + 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x004c, + 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x804b, + 0x0b80, 0x020c, 0x0300, 0x4801, 0xa009, 0x0010, + 0x0b80, 0x020c, 0x0300, 0x4801, 0xa009, 0x0028, + 0x0b80, 0x020c, 0x0300, 0x4801, 0xa009, 0x0036, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0xffff + }; + public static ushort[] level_data_03 = new ushort[] + { + 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0018, + 0x0480, 0x000b, 0x0300, 0x4501, 0x2001, 0x002b, + 0x0780, 0x010c, 0x0300, 0x4601, 0x0004, 0x000d, + 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0x0020, + 0x0780, 0x010c, 0x0300, 0x4601, 0x2004, 0x0020, + 0x0780, 0x010c, 0x0300, 0x4601, 0x8003, 0x0033, + 0x0780, 0x010c, 0x0300, 0x4601, 0x0004, 0x003c, + 0x0780, 0x010c, 0x0300, 0x4601, 0xd003, 0x0045, + 0x0780, 0x000c, 0x0500, 0x7b01, 0x900b, 0x0041, + 0x0780, 0x010c, 0x0300, 0x4601, 0x3004, 0x0041, + 0x0b80, 0x020c, 0x0300, 0x4801, 0x0007, 0x0000, + 0x0b80, 0x410a, 0x0000, 0x2b02, 0xe006, 0x4049, + 0x0b80, 0x020c, 0x0300, 0x4801, 0x8007, 0x000b, + 0x0b80, 0x000b, 0x0000, 0x2702, 0x800a, 0x8005, + 0x0b80, 0x000b, 0x0000, 0x1e02, 0x0008, 0x800e, + 0x0b80, 0x000b, 0x0000, 0x1f02, 0x8007, 0x0011, + 0x0b80, 0x000b, 0x0000, 0x2802, 0x000b, 0x0012, + 0x0b80, 0x000b, 0x0000, 0x2002, 0x0007, 0x8015, + 0x0b80, 0x000b, 0x0000, 0x2102, 0x0007, 0x801b, + 0x0b80, 0x000b, 0x0000, 0x2902, 0x800a, 0x001a, + 0x0b80, 0x000b, 0x0000, 0x2202, 0x8007, 0x001e, + 0x0b80, 0x000b, 0x0000, 0x1e02, 0x0008, 0x0025, + 0x0b80, 0x000b, 0x0000, 0x2302, 0x8007, 0x802c, + 0x0b80, 0x000b, 0x0000, 0x2802, 0x000b, 0x8028, + 0x0b80, 0x020c, 0x0300, 0x4801, 0x0007, 0x0030, + 0x0b80, 0x400a, 0x0000, 0x2e02, 0x4007, 0x002d, + 0x0b80, 0x000b, 0x0000, 0x2702, 0x800a, 0x8035, + 0x0b80, 0x020c, 0x0300, 0x4801, 0x8007, 0x0022, + 0x0b80, 0x000b, 0x0000, 0x2402, 0x8007, 0x0047, + 0x0b80, 0x000b, 0x0000, 0x2a02, 0x800a, 0x004b, + 0x0b80, 0x000b, 0x0000, 0x2502, 0x0007, 0x804b, + 0x0b80, 0x000b, 0x0000, 0x2602, 0x0007, 0x004e, + 0x0b80, 0x020c, 0x0300, 0x4801, 0x0007, 0x8043, + 0x0b80, 0x020c, 0x0300, 0x4801, 0x8007, 0x803d, + 0xffff + }; + public static ushort[] level_data_04 = new ushort[] + { + 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0010, + 0x0780, 0x0209, 0x0300, 0x4c01, 0x4004, 0x0020, + 0x0780, 0x0309, 0x0300, 0x4d01, 0xe003, 0x0030, + 0x0780, 0x0309, 0x0300, 0x4d01, 0x8003, 0x0040, + 0x0780, 0x0209, 0x0300, 0x4c01, 0x8004, 0x0018, + 0x0780, 0x0309, 0x0300, 0x4d01, 0xc003, 0x0028, + 0x0780, 0x000b, 0x0300, 0x5601, 0x8004, 0x0008, + 0x0780, 0x000b, 0x0300, 0x5601, 0x8004, 0x0038, + 0x0780, 0x000b, 0x0300, 0x5501, 0x8004, 0x0048, + 0x0980, 0x0509, 0x0f00, 0x0f01, 0x4005, 0x4007, + 0x0980, 0x0509, 0x0f00, 0x0f01, 0x4005, 0x4037, + 0x0b80, 0x030a, 0x0000, 0x1302, 0x8006, 0x0040, + 0x0b80, 0x110a, 0x0000, 0x1502, 0x8008, 0x8048, + 0x0b80, 0x110a, 0x0000, 0x1502, 0x8008, 0x8049, + 0x0b80, 0x000b, 0x0000, 0xf601, 0x0007, 0x8003, + 0x0b80, 0x000b, 0x0000, 0xf701, 0x0007, 0x0005, + 0x0b80, 0x000b, 0x0000, 0xf901, 0x0007, 0x8008, + 0x0b80, 0x000b, 0x0000, 0xf901, 0x0007, 0x0010, + 0x0b80, 0x000b, 0x0000, 0xfa01, 0x0007, 0x8013, + 0x0b80, 0x000b, 0x0000, 0xf801, 0x800b, 0x800b, + 0x0b80, 0x000b, 0x0000, 0x0002, 0x800b, 0x801a, + 0x0b80, 0x000b, 0x0000, 0xf901, 0x0007, 0x8017, + 0x0b80, 0x000b, 0x0000, 0xfa01, 0x0007, 0x001b, + 0x0b80, 0x000b, 0x0000, 0xf801, 0x800b, 0x0013, + 0x0b80, 0x000b, 0x0000, 0x4202, 0x800b, 0x0016, + 0x0b80, 0x000b, 0x0000, 0xfb01, 0x8007, 0x8020, + 0x0b80, 0x000b, 0x0000, 0xf601, 0x0007, 0x8023, + 0x0b80, 0x000b, 0x0000, 0x4202, 0x800b, 0x800e, + 0x0b80, 0x000b, 0x0000, 0x4302, 0x800b, 0x801d, + 0x0b80, 0x000b, 0x0000, 0xf701, 0x0007, 0x0025, + 0x0b80, 0x000b, 0x0000, 0xfd01, 0x8006, 0x003f, + 0x0b80, 0x000b, 0x0000, 0xfe01, 0x0007, 0x0046, + 0x0b80, 0x000b, 0x0000, 0xff01, 0x8007, 0x8049, + 0x0b80, 0x000b, 0x0000, 0xfc01, 0x8009, 0x0042, + 0xffff + }; + public static ushort[] level_data_05 = new ushort[] + { + 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, + 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, + 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, + 0x0780, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0030, + 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0038, + 0x0780, 0x0309, 0x0300, 0x4d01, 0x0004, 0x0048, + 0x0980, 0x1108, 0x0300, 0x5a01, 0xc005, 0x0018, + 0x0980, 0x0109, 0x0300, 0x4b01, 0xc005, 0x0028, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0004, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8002, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0017, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8015, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x0007, 0x0034, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x0007, 0x8032, + 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x803e, + 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x803d, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x0008, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x000b, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001b, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001e, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x0038, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x003b, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8042, + 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8045, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x8007, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x801a, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x000c, 0x8037, + 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x0042, + 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x8009, + 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x801c, + 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x0044, + 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x0028, + 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x804b, + 0x0c00, 0x040b, 0x0000, 0xf501, 0x0008, 0x8026, + 0xffff + }; + public static ushort[] level_data_06 = new ushort[] + { + 0x0000, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, + 0x0000, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0700, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, + 0x0700, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0030, + 0x0700, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0038, + 0x0700, 0x0309, 0x0300, 0x4d01, 0x0004, 0x0048, + 0x0900, 0x1108, 0x0300, 0x5a01, 0xc005, 0x0018, + 0x0900, 0x0109, 0x0300, 0x4b01, 0xc005, 0x0028, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0980, 0xdb4c, 0x0000, 0x3202, 0x0006, 0x0004, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, + 0xffff + }; + public static ushort[] level_data_07 = new ushort[]{ + 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0780, 0x0109, 0x0300, 0x4a01, 0x0004, 0x0004, + 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x000d, + 0x0780, 0x000c, 0x0500, 0x7b01, 0x000c, 0x0005, + 0x0780, 0x000c, 0x0540, 0x7b01, 0x000c, 0x0005, + 0x0780, 0x010c, 0x0300, 0x4601, 0x0005, 0x0005, + 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0xc00d, + 0x0780, 0x000c, 0x0540, 0x7b01, 0x800b, 0xc00d, + 0x0780, 0x010c, 0x0300, 0x4601, 0x8004, 0xc00d, + 0x0900, 0x0109, 0x0340, 0x4b01, 0x2006, 0x400c, + 0x0780, 0x020c, 0x0300, 0x4801, 0x8007, 0x0008, + 0x0780, 0x020c, 0x0300, 0x4801, 0x4007, 0xc00b, + 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x8007, + 0x0980, 0x0109, 0x0300, 0x4b01, 0x8007, 0x8008, + 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x800c, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0xffff + }; + public static ushort[] level_data_08 = new ushort[]{ + 0xffff + }; + public static ushort[] level_data_09 = new ushort[]{ + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0780, 0x0109, 0x0300, 0x4a01, 0x8003, 0x8003, + 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x800e, + 0x0780, 0x000c, 0x0500, 0x7b01, 0x000c, 0x0005, + 0x0780, 0x000c, 0x0540, 0x7b01, 0x000c, 0x0005, + 0x0780, 0x010c, 0x0300, 0x4601, 0x0005, 0x0005, + 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0xc00d, + 0x0780, 0x000c, 0x0540, 0x7b01, 0x800b, 0xc00d, + 0x0780, 0x010c, 0x0300, 0x4601, 0x8004, 0xc00d, + 0x0900, 0x0109, 0x0340, 0x4b01, 0x2006, 0x400c, + 0x0780, 0x020c, 0x0300, 0x4801, 0x8007, 0x0008, + 0x0780, 0x020c, 0x0300, 0x4801, 0x4007, 0xc00b, + 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x8007, + 0x0980, 0x0109, 0x0300, 0x4b01, 0x8007, 0x8008, + 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x800c, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, + 0xffff + }; + public static ushort[][] level_data_lookup = new ushort[][] + { + level_data_00, + level_data_01, + level_data_02, + level_data_03, + level_data_04, + level_data_05, + level_data_06, + level_data_07, + level_data_08, + level_data_09 + }; + public static byte cchip_r(int offset) + { + return cchip_ram[offset]; + } + public static void cchip_w(int offset, byte data) + { + cchip_ram[offset] = data; + } + public static byte opwolf_in_r(int offset) + { + byte result = 0; + if (offset == 0) + { + result = (byte)sbyte0; + } + else if (offset == 1) + { + result = (byte)sbyte1; + } + return result; + } + public static byte opwolf_dsw_r(int offset) + { + byte result = 0; + if (offset == 0) + { + result = dswa; + } + else if (offset == 1) + { + result = dswb; + } + return result; + } + public static ushort opwolf_lightgun_r(int offset) + { + ushort result = 0; + if (offset == 0) + { + result = (ushort)(0xfe00 | opwolf_gun_x_r()); + } + else if (offset == 1) + { + result = (ushort)(0xfe00 | opwolf_gun_y_r()); + } + return result; + } + public static ushort opwolf_lightgun_r_p(int offset) + { + ushort result = 0; + if (offset == 0) + { + result = (ushort)((sbyte2 << 8) | opwolf_gun_x_r()); + } + else if (offset == 1) + { + result = (ushort)((sbyte3 << 8) | opwolf_gun_y_r()); + } + return result; + } + public static byte z80_input1_r() + { + byte result; + result = (byte)sbyte0; + return result; + } + public static byte z80_input2_r() + { + byte result; + result = (byte)sbyte0; + return result; + } + public static void sound_bankswitch_w(int offset, byte data) + { + basebanksnd = 0x10000 + 0x4000 * ((data - 1) & 0x03); + } + public static void machine_reset_opwolf() + { + adpcm_b[0] = adpcm_b[1] = 0; + adpcm_c[0] = adpcm_c[1] = 0; + adpcm_pos[0] = adpcm_pos[1] = 0; + adpcm_end[0] = adpcm_end[1] = 0; + adpcm_data[0] = adpcm_data[1] = -1; + m_sprite_ctrl = 0; + m_sprites_flipscreen = 0; + MSM5205.msm5205_reset_w(0, 1); + MSM5205.msm5205_reset_w(1, 1); + } + public static void opwolf_msm5205_vck(int chip) + { + if (adpcm_data[chip] != -1) + { + MSM5205.msm5205_data_w(chip, adpcm_data[chip] & 0x0f); + adpcm_data[chip] = -1; + if (adpcm_pos[chip] == adpcm_end[chip]) + { + MSM5205.msm5205_reset_w(chip, 1); + } + } + else + { + adpcm_data[chip] = adpcmrom[adpcm_pos[chip]]; + adpcm_pos[chip] = (adpcm_pos[chip] + 1) & 0x7ffff; + MSM5205.msm5205_data_w(chip, adpcm_data[chip] >> 4); + } + } + public static void opwolf_adpcm_b_w(int offset, byte data) + { + int start; + int end; + adpcm_b[offset] = data; + if (offset == 0x04) //trigger ? + { + start = adpcm_b[0] + adpcm_b[1] * 256; + end = adpcm_b[2] + adpcm_b[3] * 256; + start *= 16; + end *= 16; + adpcm_pos[0] = start; + adpcm_end[0] = end; + MSM5205.msm5205_reset_w(0, 0); + } + } + public static void opwolf_adpcm_c_w(int offset, byte data) + { + int start; + int end; + adpcm_c[offset] = data; + if (offset == 0x04) //trigger ? + { + start = adpcm_c[0] + adpcm_c[1] * 256; + end = adpcm_c[2] + adpcm_c[3] * 256; + start *= 16; + end *= 16; + adpcm_pos[1] = start; + adpcm_end[1] = end; + MSM5205.msm5205_reset_w(1, 0); + } + } + public static void opwolf_adpcm_d_w() + { + + } + public static void opwolf_adpcm_e_w() + { + + } + public static int opwolf_gun_x_r() + { + p1x = (byte)Inptport.input_port_read_direct(Inptport.analog_p1x); + int scaled = (p1x * 320) / 256; + return (scaled + 0x15 + opwolf_gun_xoffs); + } + public static int opwolf_gun_y_r() + { + p1y = (byte)Inptport.input_port_read_direct(Inptport.analog_p1y); + return (p1y - 0x24 + opwolf_gun_yoffs); + } + public static void irq_handler(int irq) + { + Cpuint.cpunum_set_input_line(1, 0, irq != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void opwolf_timer_callback() + { + if (current_cmd == 0xf5) + { + int level = cchip_ram[0x1b] % 10; + int i = 0; + Array.Clear(cchip_ram, 0x200, 0x200); + for (i = 0; (i < 0x200) && (level_data_lookup[level][i] != 0xffff); i += 3) + { + cchip_ram[0x200 + i * 2 + 0] = (byte)(level_data_lookup[level][i] >> 8); + cchip_ram[0x200 + i * 2 + 1] = (byte)(level_data_lookup[level][i] & 0xff); + cchip_ram[0x200 + i * 2 + 2] = (byte)(level_data_lookup[level][i + 1] >> 8); + cchip_ram[0x200 + i * 2 + 3] = (byte)(level_data_lookup[level][i + 1] & 0xff); + cchip_ram[0x200 + i * 2 + 4] = (byte)(level_data_lookup[level][i + 2] >> 8); + cchip_ram[0x200 + i * 2 + 5] = (byte)(level_data_lookup[level][i + 2] & 0xff); + } + // The bootleg cchip writes 0 to these locations - hard to tell what the real one writes + cchip_ram[0x0] = 0; + cchip_ram[0x76] = 0; + cchip_ram[0x75] = 0; + cchip_ram[0x74] = 0; + cchip_ram[0x72] = 0; + cchip_ram[0x71] = 0; + //cchip_ram[0x70]=0; + cchip_ram[0x66] = 0; + cchip_ram[0x2b] = 0; + cchip_ram[0x30] = 0; + cchip_ram[0x31] = 0; + cchip_ram[0x32] = 0; + cchip_ram[0x27] = 0; + c588 = 0; + c589 = 0; + c58a = 0; + m_triggeredLevel1b = 0; + m_triggeredLevel13b = 0; + m_triggeredLevel2 = 0; + m_triggeredLevel2b = 0; + m_triggeredLevel2c = 0; + m_triggeredLevel3b = 0; + m_triggeredLevel4 = 0; + m_triggeredLevel5 = 0; + m_triggeredLevel7 = 0; + m_triggeredLevel8 = 0; + m_triggeredLevel9 = 0; + cchip_ram[0x1a] = 0; + cchip_ram[0x7a] = 1; // Signal command complete + } + current_cmd = 0; + } + public static void updateDifficulty(int mode) + { + // The game is made up of 6 rounds, when you complete the + // sixth you return to the start but with harder difficulty. + if (mode == 0) + { + switch (cchip_ram[0x15] & 3) // Dipswitch B + { + case 3: + cchip_ram[0x2c] = 0x31; + cchip_ram[0x77] = 0x05; + cchip_ram[0x25] = 0x0f; + cchip_ram[0x26] = 0x0b; + break; + case 0: + cchip_ram[0x2c] = 0x20; + cchip_ram[0x77] = 0x06; + cchip_ram[0x25] = 0x07; + cchip_ram[0x26] = 0x03; + break; + case 1: + cchip_ram[0x2c] = 0x31; + cchip_ram[0x77] = 0x05; + cchip_ram[0x25] = 0x0f; + cchip_ram[0x26] = 0x0b; + break; + case 2: + cchip_ram[0x2c] = 0x3c; + cchip_ram[0x77] = 0x04; + cchip_ram[0x25] = 0x13; + cchip_ram[0x26] = 0x0f; + break; + } + } + else + { + switch (cchip_ram[0x15] & 3) // Dipswitch B + { + case 3: + cchip_ram[0x2c] = 0x46; + cchip_ram[0x77] = 0x05; + cchip_ram[0x25] = 0x11; + cchip_ram[0x26] = 0x0e; + break; + case 0: + cchip_ram[0x2c] = 0x30; + cchip_ram[0x77] = 0x06; + cchip_ram[0x25] = 0x0b; + cchip_ram[0x26] = 0x03; + break; + case 1: + cchip_ram[0x2c] = 0x3a; + cchip_ram[0x77] = 0x05; + cchip_ram[0x25] = 0x0f; + cchip_ram[0x26] = 0x09; + break; + case 2: + cchip_ram[0x2c] = 0x4c; + cchip_ram[0x77] = 0x04; + cchip_ram[0x25] = 0x19; + cchip_ram[0x26] = 0x11; + break; + } + } + } + public static void opwolf_cchip_status_w() + { + cchip_ram[0x3d] = 1; + cchip_ram[0x7a] = 1; + updateDifficulty(0); + } + public static void opwolf_cchip_bank_w(byte data) + { + current_bank = (byte)(data & 7); + } + public static void opwolf_cchip_data_w(int offset, ushort data) + { + cchip_ram[(current_bank * 0x400) + offset] = (byte)(data & 0xff); + if (current_bank == 0) + { + // Dip switch A is written here by the 68k - precalculate the coinage values + // Shouldn't we directly read the values from the ROM area ? + if (offset == 0x14) + { + int[] coin_table = new int[] { 0, 0 }; + byte[] coin_offset = new byte[2]; + int slot; + + if ((opwolf_region == 1) || (opwolf_region == 2)) + { + coin_table[0] = 0x03ffce; + coin_table[1] = 0x03ffce; + } + if ((opwolf_region == 3) || (opwolf_region == 4)) + { + coin_table[0] = 0x03ffde; + coin_table[1] = 0x03ffee; + } + coin_offset[0] = (byte)(12 - (4 * ((data & 0x30) >> 4))); + coin_offset[1] = (byte)(12 - (4 * ((data & 0xc0) >> 6))); + for (slot = 0; slot < 2; slot++) + { + if (coin_table[slot] != 0) + { + cchip_coins_for_credit[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2 + 1]) & 0xff); + cchip_credits_for_coin[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2 + 1]) & 0xff); + } + } + } + // Dip switch B + if (offset == 0x15) + { + updateDifficulty(0); + } + } + } + public static void opwolf_cchip_data_w2(int offset, byte data) + { + cchip_ram[(current_bank * 0x400) + offset] = (byte)(data & 0xff); + if (current_bank == 0) + { + // Dip switch A is written here by the 68k - precalculate the coinage values + // Shouldn't we directly read the values from the ROM area ? + if (offset == 0x14) + { + int[] coin_table = new int[] { 0, 0 }; + byte[] coin_offset = new byte[2]; + int slot; + + if ((opwolf_region == 1) || (opwolf_region == 2)) + { + coin_table[0] = 0x03ffce; + coin_table[1] = 0x03ffce; + } + if ((opwolf_region == 3) || (opwolf_region == 4)) + { + coin_table[0] = 0x03ffde; + coin_table[1] = 0x03ffee; + } + coin_offset[0] = (byte)(12 - (4 * ((data & 0x30) >> 4))); + coin_offset[1] = (byte)(12 - (4 * ((data & 0xc0) >> 6))); + for (slot = 0; slot < 2; slot++) + { + if (coin_table[slot] != 0) + { + cchip_coins_for_credit[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2 + 1]) & 0xff); + cchip_credits_for_coin[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2 + 1]) & 0xff); + } + } + } + // Dip switch B + if (offset == 0x15) + { + updateDifficulty(0); + } + } + } + public static ushort opwolf_cchip_status_r() + { + return 0x1; + } + public static ushort opwolf_cchip_data_r(int offset) + { + return cchip_ram[(current_bank * 0x400) + offset]; + } + public static void cchip_timer() + { + cchip_ram[0x4] = (byte)sbyte0; + cchip_ram[0x5] = (byte)sbyte1; + if (cchip_ram[0x4] != cchip_last_04) + { + int slot = -1; + if ((cchip_ram[0x4] & 1) != 0) + { + slot = 0; + } + if ((cchip_ram[0x4] & 2) != 0) + { + slot = 1; + } + if (slot != -1) + { + cchip_coins[slot]++; + if (cchip_coins[slot] >= cchip_coins_for_credit[slot]) + { + cchip_ram[0x53] += cchip_credits_for_coin[slot]; + cchip_ram[0x51] = 0x55; + cchip_ram[0x52] = 0x55; + cchip_coins[slot] -= cchip_coins_for_credit[slot]; + } + Generic.coin_counter_w(slot, 1); + } + if (cchip_ram[0x53] > 9) + { + cchip_ram[0x53] = 9; + } + } + cchip_last_04 = cchip_ram[0x4]; + if (cchip_ram[0x5] != cchip_last_05) + { + if ((cchip_ram[0x5] & 4) == 0) + { + cchip_ram[0x53]++; + cchip_ram[0x51] = 0x55; + cchip_ram[0x52] = 0x55; + } + } + cchip_last_05 = cchip_ram[0x5]; + Generic.coin_lockout_w(1, cchip_ram[0x53] == 9 ? 1 : 0); + Generic.coin_lockout_w(0, cchip_ram[0x53] == 9 ? 1 : 0); + Generic.coin_counter_w(0, 0); + Generic.coin_counter_w(1, 0); + if (cchip_ram[0x34] < 2) + { + updateDifficulty(0); + cchip_ram[0x76] = 0; + cchip_ram[0x75] = 0; + cchip_ram[0x74] = 0; + cchip_ram[0x72] = 0; + cchip_ram[0x71] = 0; + cchip_ram[0x70] = 0; + cchip_ram[0x66] = 0; + cchip_ram[0x2b] = 0; + cchip_ram[0x30] = 0; + cchip_ram[0x31] = 0; + cchip_ram[0x32] = 0; + cchip_ram[0x27] = 0; + c588 = 0; + c589 = 0; + c58a = 0; + } + if (cchip_ram[0x1c] == 0 && cchip_ram[0x1d] == 0 && cchip_ram[0x1e] == 0 && cchip_ram[0x1f] == 0 && cchip_ram[0x20] == 0) + { + if (cchip_ram[0x1b] == 0x6) + { + if (cchip_ram[0x27] == 0x1) + cchip_ram[0x32] = 1; + } + else if (cchip_ram[0x1b] == 0x2) + { + if (m_triggeredLevel2 == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f) + { + cchip_ram[0x5f] = 4; // 0xBE at 68K side + m_triggeredLevel2 = 1; + } + if (m_triggeredLevel2 != 0 && cchip_ram[0x5d] != 0) + { + cchip_ram[0x32] = 1; + cchip_ram[0x5d] = 0; // acknowledge 68K command + } + } + else if (cchip_ram[0x1b] == 0x4) + { + cchip_ram[0x32] = 1; + if (m_triggeredLevel4 == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + cchip_ram[0x5f] = 10; + m_triggeredLevel4 = 1; + } + } + else + { + cchip_ram[0x32] = 1; + } + } + if (cchip_ram[0x1c] == 0 && cchip_ram[0x1d] == 0) + { + if (cchip_ram[0x1b] == 0x1 && m_triggeredLevel1b == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + cchip_ram[0x5f] = 7; + m_triggeredLevel1b = 1; + } + if (cchip_ram[0x1b] == 0x3 && m_triggeredLevel3b == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + cchip_ram[0x5f] = 8; + m_triggeredLevel3b = 1; + } + if ((cchip_ram[0x1b] != 0x1 && cchip_ram[0x1b] != 0x3) && m_triggeredLevel13b == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + cchip_ram[0x5f] = 9; + m_triggeredLevel13b = 1; + } + } + if (cchip_ram[0x1b] == 0x2) + { + int numMen = (cchip_ram[0x1d] << 8) + cchip_ram[0x1c]; + if (numMen < 0x25 && m_triggeredLevel2b == 1 && m_triggeredLevel2c == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + cchip_ram[0x5f] = 6; + m_triggeredLevel2c = 1; + } + if (numMen < 0x45 && m_triggeredLevel2b == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + cchip_ram[0x5f] = 5; + m_triggeredLevel2b = 1; + } + } + if (cchip_ram[0x1b] == 0x5) + { + if (cchip_ram[0x1c] == 0 && cchip_ram[0x1d] == 0 && m_triggeredLevel5 == 0) + { + cchip_ram[0x2f] = 1; + m_triggeredLevel5 = 1; + } + } + if (cchip_ram[0x1b] == 0x6) + { + if (c58a == 0) + { + if ((cchip_ram[0x72] & 0x7f) >= 8 && cchip_ram[0x74] == 0 && cchip_ram[0x1c] == 0 && cchip_ram[0x1d] == 0 && cchip_ram[0x1f] == 0) + { + cchip_ram[0x30] = 1; + cchip_ram[0x74] = 1; + c58a = 1; + } + } + if (cchip_ram[0x1a] == 0x90) + { + cchip_ram[0x74] = 0; + } + if (c58a != 0) + { + if (c589 == 0 && cchip_ram[0x27] == 0 && cchip_ram[0x75] == 0 && cchip_ram[0x1c] == 0 && cchip_ram[0x1d] == 0 && cchip_ram[0x1e] == 0 && cchip_ram[0x1f] == 0) + { + cchip_ram[0x31] = 1; + cchip_ram[0x75] = 1; + c589 = 1; + } + } + if (cchip_ram[0x2b] == 0x1) + { + cchip_ram[0x2b] = 0; + if (cchip_ram[0x30] == 0x1) + { + if (cchip_ram[0x1a] != 0x90) + { + cchip_ram[0x1a]--; + } + } + if (cchip_ram[0x72] == 0x9) + { + if (cchip_ram[0x76] != 0x4) + { + cchip_ram[0x76] = 3; + } + } + else + { + c588 |= 0x80; + cchip_ram[0x72] = c588; + c588++; + cchip_ram[0x1a]--; + cchip_ram[0x1a]--; + cchip_ram[0x1a]--; + } + } + if (cchip_ram[0x76] == 0) + { + cchip_ram[0x76] = 1; + updateDifficulty(1); + } + } + if (cchip_ram[0x1b] == 0x7 && m_triggeredLevel7 == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + m_triggeredLevel7 = 1; + cchip_ram[0x5f] = 1; + } + if (cchip_ram[0x1b] == 0x8 && m_triggeredLevel8 == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + m_triggeredLevel8 = 1; + cchip_ram[0x5f] = 2; + } + if (cchip_ram[0x1b] == 0x9 && m_triggeredLevel9 == 0 && cchip_ram[0x5f] == 0) // Don't write unless 68K is ready (0 at 0x5f)) + { + m_triggeredLevel9 = 1; + cchip_ram[0x5f] = 3; + } + if (cchip_ram[0xe] == 1) + { + cchip_ram[0xe] = 0xfd; + cchip_ram[0x61] = 0x04; + } + if (cchip_ram[0x7a] == 0 && cchip_last_7a != 0 && current_cmd != 0xf5) + { + current_cmd = 0xf5; + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Taito_opwolf_timer_callback, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(80000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + } + cchip_last_7a = cchip_ram[0x7a]; + if (cchip_ram[0x7f] == 0xa) + { + cchip_ram[0xfe] = 0xf7; + cchip_ram[0xff] = 0x6e; + } + cchip_ram[0x64] = 0; + cchip_ram[0x66] = 0; + } + public static void opwolf_cchip_init() + { + m_triggeredLevel1b = 0; + m_triggeredLevel2 = 0; + m_triggeredLevel2b = 0; + m_triggeredLevel2c = 0; + m_triggeredLevel3b = 0; + m_triggeredLevel13b = 0; + m_triggeredLevel4 = 0; + m_triggeredLevel5 = 0; + m_triggeredLevel7 = 0; + m_triggeredLevel8 = 0; + m_triggeredLevel9 = 0; + current_bank = 0; + current_cmd = 0; + cchip_last_7a = 0; + cchip_last_04 = 0xfc; + cchip_last_05 = 0xff; + c588 = 0; + c589 = 0; + c58a = 0; + cchip_coins[0] = 0; + cchip_coins[1] = 0; + cchip_coins_for_credit[0] = 1; + cchip_credits_for_coin[0] = 1; + cchip_coins_for_credit[1] = 1; + cchip_credits_for_coin[1] = 1; + EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 60)), EmuTimer.TIME_ACT.Taito_cchip_timer); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Opwolf.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Opwolf.cs.meta new file mode 100644 index 00000000..fca4e57b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Opwolf.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d319f7679ef955c418280b69436454fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/State.cs new file mode 100644 index 00000000..ec339a3a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/State.cs @@ -0,0 +1,735 @@ +using cpu.m6800; +using cpu.m68000; +using cpu.m6805; +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Taito + { + public static void SaveStateBinary_tokio(BinaryWriter writer) + { + int i; + writer.Write(dsw0); + writer.Write(dsw1); + writer.Write(basebankmain); + writer.Write(videoram, 0, 0x1d00); + writer.Write(bublbobl_objectram, 0, 0x300); + writer.Write(Generic.paletteram, 0, 0x200); + writer.Write(bublbobl_video_enable); + writer.Write(tokio_prot_count); + writer.Write(sound_nmi_enable); + writer.Write(pending_nmi); + for (i = 0; i < 0x100; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x1800); + writer.Write(Memory.audioram, 0, 0x1000); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].SaveStateBinary(writer); + } + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.vblank_start_time.seconds); + writer.Write(Video.screenstate.vblank_start_time.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + YM2203.FF2203[0].SaveStateBinary(writer); + for (i = 0; i < 2; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_tokio(BinaryReader reader) + { + int i; + dsw0 = reader.ReadByte(); + dsw1 = reader.ReadByte(); + basebankmain = reader.ReadInt32(); + videoram = reader.ReadBytes(0x1d00); + bublbobl_objectram = reader.ReadBytes(0x300); + Generic.paletteram_set = reader.ReadBytes(0x200); + bublbobl_video_enable = reader.ReadInt32(); + tokio_prot_count = reader.ReadInt32(); + sound_nmi_enable = reader.ReadInt32(); + pending_nmi = reader.ReadInt32(); + for (i = 0; i < 0x100; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x1800)); + Memory.Set_audioram(reader.ReadBytes(0x1000)); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].LoadStateBinary(reader); + } + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); + Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + YM2203.FF2203[0].LoadStateBinary(reader); + for (i = 0; i < 2; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_bublbobl(BinaryWriter writer) + { + int i; + writer.Write(dsw0); + writer.Write(dsw1); + writer.Write(basebankmain); + writer.Write(videoram, 0, 0x1d00); + writer.Write(bublbobl_objectram, 0, 0x300); + writer.Write(Generic.paletteram, 0, 0x200); + writer.Write(bublbobl_mcu_sharedram, 0, 0x400); + writer.Write(bublbobl_video_enable); + writer.Write(ddr1); + writer.Write(ddr2); + writer.Write(ddr3); + writer.Write(ddr4); + writer.Write(port1_in); + writer.Write(port2_in); + writer.Write(port3_in); + writer.Write(port4_in); + writer.Write(port1_out); + writer.Write(port2_out); + writer.Write(port3_out); + writer.Write(port4_out); + for (i = 0; i < 0x100; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x1800); + writer.Write(Memory.audioram, 0, 0x1000); + writer.Write(mcuram, 0, 0xc0); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].SaveStateBinary(writer); + } + M6800.m1.SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.vblank_start_time.seconds); + writer.Write(Video.screenstate.vblank_start_time.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + YM2203.FF2203[0].SaveStateBinary(writer); + YM3812.SaveStateBinary_YM3526(writer); + for (i = 0; i < 2; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_base_sampindex); + writer.Write(Sound.ym3526stream.output_sampindex); + writer.Write(Sound.ym3526stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_bublbobl(BinaryReader reader) + { + int i; + dsw0 = reader.ReadByte(); + dsw1 = reader.ReadByte(); + basebankmain = reader.ReadInt32(); + videoram = reader.ReadBytes(0x1d00); + bublbobl_objectram = reader.ReadBytes(0x300); + Generic.paletteram_set = reader.ReadBytes(0x200); + bublbobl_mcu_sharedram = reader.ReadBytes(0x400); + bublbobl_video_enable = reader.ReadInt32(); + ddr1 = reader.ReadByte(); + ddr2 = reader.ReadByte(); + ddr3 = reader.ReadByte(); + ddr4 = reader.ReadByte(); + port1_in = reader.ReadByte(); + port2_in = reader.ReadByte(); + port3_in = reader.ReadByte(); + port4_in = reader.ReadByte(); + port1_out = reader.ReadByte(); + port2_out = reader.ReadByte(); + port3_out = reader.ReadByte(); + port4_out = reader.ReadByte(); + for (i = 0; i < 0x100; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x1800)); + Memory.Set_audioram(reader.ReadBytes(0x1000)); + mcuram = reader.ReadBytes(0xc0); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].LoadStateBinary(reader); + } + M6800.m1.LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); + Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + YM2203.FF2203[0].LoadStateBinary(reader); + YM3812.LoadStateBinary_YM3526(reader); + for (i = 0; i < 2; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_base_sampindex = reader.ReadInt32(); + Sound.ym3526stream.output_sampindex = reader.ReadInt32(); + Sound.ym3526stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_boblbobl(BinaryWriter writer) + { + int i; + writer.Write(dsw0); + writer.Write(dsw1); + writer.Write(basebankmain); + writer.Write(videoram, 0, 0x1d00); + writer.Write(bublbobl_objectram, 0, 0x300); + writer.Write(Generic.paletteram, 0, 0x200); + writer.Write(bublbobl_video_enable); + writer.Write(ic43_a); + writer.Write(ic43_b); + for (i = 0; i < 0x100; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x1800); + writer.Write(mainram2, 0, 0x100); + writer.Write(mainram3, 0, 0x100); + writer.Write(Memory.audioram, 0, 0x1000); + writer.Write(mcuram, 0, 0xc0); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].SaveStateBinary(writer); + } + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.vblank_start_time.seconds); + writer.Write(Video.screenstate.vblank_start_time.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + YM2203.FF2203[0].SaveStateBinary(writer); + YM3812.SaveStateBinary_YM3526(writer); + for (i = 0; i < 2; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_base_sampindex); + writer.Write(Sound.ym3526stream.output_sampindex); + writer.Write(Sound.ym3526stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_boblbobl(BinaryReader reader) + { + int i; + dsw0 = reader.ReadByte(); + dsw1 = reader.ReadByte(); + basebankmain = reader.ReadInt32(); + videoram = reader.ReadBytes(0x1d00); + bublbobl_objectram = reader.ReadBytes(0x300); + Generic.paletteram_set = reader.ReadBytes(0x200); + bublbobl_video_enable = reader.ReadInt32(); + ic43_a = reader.ReadInt32(); + ic43_b = reader.ReadInt32(); + for (i = 0; i < 0x100; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x1800)); + mainram2_set = reader.ReadBytes(0x100); + mainram3 = reader.ReadBytes(0x100); + Memory.Set_audioram(reader.ReadBytes(0x1000)); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].LoadStateBinary(reader); + } + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); + Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + YM2203.FF2203[0].LoadStateBinary(reader); + YM3812.LoadStateBinary_YM3526(reader); + for (i = 0; i < 2; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_base_sampindex = reader.ReadInt32(); + Sound.ym3526stream.output_sampindex = reader.ReadInt32(); + Sound.ym3526stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_bub68705(BinaryWriter writer) + { + int i; + writer.Write(dsw0); + writer.Write(dsw1); + writer.Write(basebankmain); + writer.Write(videoram, 0, 0x1d00); + writer.Write(bublbobl_objectram, 0, 0x300); + writer.Write(Generic.paletteram, 0, 0x200); + writer.Write(bublbobl_mcu_sharedram, 0, 0x400); + writer.Write(bublbobl_video_enable); + writer.Write(portA_in); + writer.Write(portA_out); + writer.Write(ddrA); + writer.Write(portB_in); + writer.Write(portB_out); + writer.Write(ddrB); + for (i = 0; i < 0x100; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x1800); + writer.Write(Memory.audioram, 0, 0x1000); + writer.Write(mcuram, 0, 0xc0); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].SaveStateBinary(writer); + } + M6805.m1.SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + writer.Write(Video.screenstate.vblank_start_time.seconds); + writer.Write(Video.screenstate.vblank_start_time.attoseconds); + writer.Write(Video.screenstate.frame_number); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + YM2203.FF2203[0].SaveStateBinary(writer); + YM3812.SaveStateBinary_YM3526(writer); + for (i = 0; i < 2; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_sampindex); + writer.Write(YM2203.FF2203[0].stream.output_base_sampindex); + writer.Write(Sound.ym3526stream.output_sampindex); + writer.Write(Sound.ym3526stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_bub68705(BinaryReader reader) + { + int i; + dsw0 = reader.ReadByte(); + dsw1 = reader.ReadByte(); + basebankmain = reader.ReadInt32(); + videoram = reader.ReadBytes(0x1d00); + bublbobl_objectram = reader.ReadBytes(0x300); + Generic.paletteram_set = reader.ReadBytes(0x200); + bublbobl_mcu_sharedram = reader.ReadBytes(0x400); + bublbobl_video_enable = reader.ReadInt32(); + portA_in = reader.ReadByte(); + portA_out = reader.ReadByte(); + ddrA = reader.ReadByte(); + portB_in = reader.ReadByte(); + portB_out = reader.ReadByte(); + ddrB = reader.ReadByte(); + for (i = 0; i < 0x100; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x1800)); + Memory.Set_audioram(reader.ReadBytes(0x1000)); + mcuram = reader.ReadBytes(0xc0); + for (i = 0; i < 3; i++) + { + Z80A.zz1[i].LoadStateBinary(reader); + } + M6805.m1.LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); + Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); + Video.screenstate.frame_number = reader.ReadInt64(); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + YM2203.FF2203[0].LoadStateBinary(reader); + YM3812.LoadStateBinary_YM3526(reader); + for (i = 0; i < 2; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_sampindex = reader.ReadInt32(); + YM2203.FF2203[0].stream.output_base_sampindex = reader.ReadInt32(); + Sound.ym3526stream.output_sampindex = reader.ReadInt32(); + Sound.ym3526stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + public static void SaveStateBinary_opwolf(BinaryWriter writer) + { + int i; + writer.Write(dswa); + writer.Write(dswb); + writer.Write(Inptport.analog_p1x.accum); + writer.Write(Inptport.analog_p1x.previous); + writer.Write(Inptport.analog_p1x.lastdigital); + writer.Write(Inptport.analog_p1y.accum); + writer.Write(Inptport.analog_p1y.previous); + writer.Write(Inptport.analog_p1y.lastdigital); + writer.Write(Inptport.portdata.last_frame_time.seconds); + writer.Write(Inptport.portdata.last_frame_time.attoseconds); + writer.Write(Inptport.portdata.last_delta_nsec); + writer.Write(basebanksnd); + writer.Write(PC080SN_chips); + for (i = 0; i < 8; i++) + { + writer.Write(PC080SN_ctrl[0][i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(PC080SN_bg_ram_offset[0][i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(PC080SN_bgscroll_ram_offset[0][i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(PC080SN_bgscrollx[0][i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(PC080SN_bgscrolly[0][i]); + } + for (i = 0; i < 0x8000; i++) + { + writer.Write(PC080SN_ram[0][i]); + } + writer.Write(PC080SN_xoffs); + writer.Write(PC080SN_yoffs); + writer.Write(PC080SN_yinvert); + writer.Write(PC080SN_dblwidth); + writer.Write(PC090OJ_ctrl); + writer.Write(PC090OJ_buffer); + writer.Write(PC090OJ_gfxnum); + writer.Write(PC090OJ_sprite_ctrl); + for (i = 0; i < 0x2000; i++) + { + writer.Write(PC090OJ_ram[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(PC090OJ_ram_buffered[i]); + } + writer.Write(PC090OJ_xoffs); + writer.Write(PC090OJ_yoffs); + writer.Write(opwolf_region); + writer.Write(cchip_ram, 0, 0x2000); + writer.Write(adpcm_b, 0, 8); + writer.Write(adpcm_c, 0, 8); + writer.Write(opwolf_gun_xoffs); + writer.Write(opwolf_gun_yoffs); + for (i = 0; i < 2; i++) + { + writer.Write(adpcm_pos[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(adpcm_end[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(adpcm_data[i]); + } + writer.Write(m_sprite_ctrl); + writer.Write(m_sprites_flipscreen); + writer.Write(current_bank); + writer.Write(current_cmd); + writer.Write(cchip_last_7a); + writer.Write(cchip_last_04); + writer.Write(cchip_last_05); + writer.Write(cchip_coins_for_credit, 0, 2); + writer.Write(cchip_credits_for_coin, 0, 2); + writer.Write(cchip_coins, 0, 2); + writer.Write(c588); + writer.Write(c589); + writer.Write(c58a); + writer.Write(m_triggeredLevel1b); + writer.Write(m_triggeredLevel2); + writer.Write(m_triggeredLevel2b); + writer.Write(m_triggeredLevel2c); + writer.Write(m_triggeredLevel3b); + writer.Write(m_triggeredLevel13b); + writer.Write(m_triggeredLevel4); + writer.Write(m_triggeredLevel5); + writer.Write(m_triggeredLevel7); + writer.Write(m_triggeredLevel8); + writer.Write(m_triggeredLevel9); + for (i = 0; i < 0x800; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x2000; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x8000); + writer.Write(mainram2, 0, 0x10000); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x1000); + for (i = 0; i < Z80A.nZ80; i++) + { + Z80A.zz1[i].SaveStateBinary(writer); + } + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + YM2151.SaveStateBinary(writer); + MSM5205.mm1[0].SaveStateBinary(writer); + MSM5205.mm1[1].SaveStateBinary(writer); + writer.Write(Sound.latched_value[0]); + writer.Write(Sound.utempdata[0]); + writer.Write(Sound.ym2151stream.output_sampindex); + writer.Write(Sound.ym2151stream.output_base_sampindex); + writer.Write(MSM5205.mm1[0].voice.stream.output_sampindex); + writer.Write(MSM5205.mm1[0].voice.stream.output_base_sampindex); + writer.Write(MSM5205.mm1[1].voice.stream.output_sampindex); + writer.Write(MSM5205.mm1[1].voice.stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_opwolf(BinaryReader reader) + { + int i; + dswa = reader.ReadByte(); + dswb = reader.ReadByte(); + Inptport.analog_p1x.accum = reader.ReadInt32(); + Inptport.analog_p1x.previous = reader.ReadInt32(); + Inptport.analog_p1x.lastdigital = reader.ReadByte(); + Inptport.analog_p1y.accum = reader.ReadInt32(); + Inptport.analog_p1y.previous = reader.ReadInt32(); + Inptport.analog_p1y.lastdigital = reader.ReadByte(); + Inptport.portdata.last_frame_time.seconds = reader.ReadInt32(); + Inptport.portdata.last_frame_time.attoseconds = reader.ReadInt64(); + Inptport.portdata.last_delta_nsec = reader.ReadInt64(); + basebanksnd = reader.ReadInt32(); + PC080SN_chips = reader.ReadInt32(); + for (i = 0; i < 8; i++) + { + PC080SN_ctrl[0][i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + PC080SN_bg_ram_offset[0][i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + PC080SN_bgscroll_ram_offset[0][i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + PC080SN_bgscrollx[0][i] = reader.ReadInt32(); + } + for (i = 0; i < 2; i++) + { + PC080SN_bgscrolly[0][i] = reader.ReadInt32(); + } + for (i = 0; i < 0x8000; i++) + { + PC080SN_ram[0][i] = reader.ReadUInt16(); + } + PC080SN_xoffs = reader.ReadInt32(); + PC080SN_yoffs = reader.ReadInt32(); + PC080SN_yinvert = reader.ReadInt32(); + PC080SN_dblwidth = reader.ReadInt32(); + PC090OJ_ctrl = reader.ReadUInt16(); + PC090OJ_buffer = reader.ReadUInt16(); + PC090OJ_gfxnum = reader.ReadUInt16(); + PC090OJ_sprite_ctrl = reader.ReadUInt16(); + for (i = 0; i < 0x2000; i++) + { + PC090OJ_ram[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + PC090OJ_ram_buffered[i] = reader.ReadUInt16(); + } + PC090OJ_xoffs = reader.ReadInt32(); + PC090OJ_yoffs = reader.ReadInt32(); + opwolf_region = reader.ReadInt32(); + cchip_ram = reader.ReadBytes(0x2000); + adpcm_b = reader.ReadBytes(8); + adpcm_c = reader.ReadBytes(8); + opwolf_gun_xoffs = reader.ReadInt32(); + opwolf_gun_yoffs = reader.ReadInt32(); + for (i = 0; i < 2; i++) + { + adpcm_pos[i] = reader.ReadInt32(); + } + for (i = 0; i < 2; i++) + { + adpcm_end[i] = reader.ReadInt32(); + } + for (i = 0; i < 2; i++) + { + adpcm_data[i] = reader.ReadInt32(); + } + m_sprite_ctrl = reader.ReadUInt16(); + m_sprites_flipscreen = reader.ReadUInt16(); + current_bank = reader.ReadByte(); + current_cmd = reader.ReadByte(); + cchip_last_7a = reader.ReadByte(); + cchip_last_04 = reader.ReadByte(); + cchip_last_05 = reader.ReadByte(); + cchip_coins_for_credit = reader.ReadBytes(2); + cchip_credits_for_coin = reader.ReadBytes(2); + cchip_coins = reader.ReadBytes(2); + c588 = reader.ReadByte(); + c589 = reader.ReadByte(); + c58a = reader.ReadByte(); + m_triggeredLevel1b = reader.ReadByte(); + m_triggeredLevel2 = reader.ReadByte(); + m_triggeredLevel2b = reader.ReadByte(); + m_triggeredLevel2c = reader.ReadByte(); + m_triggeredLevel3b = reader.ReadByte(); + m_triggeredLevel13b = reader.ReadByte(); + m_triggeredLevel4 = reader.ReadByte(); + m_triggeredLevel5 = reader.ReadByte(); + m_triggeredLevel7 = reader.ReadByte(); + m_triggeredLevel8 = reader.ReadByte(); + m_triggeredLevel9 = reader.ReadByte(); + for (i = 0; i < 0x800; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x2000; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x8000)); + mainram2_set = reader.ReadBytes(0x10000); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x1000)); + for (i = 0; i < Z80A.nZ80; i++) + { + Z80A.zz1[i].LoadStateBinary(reader); + } + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + YM2151.LoadStateBinary(reader); + MSM5205.mm1[0].LoadStateBinary(reader); + MSM5205.mm1[1].LoadStateBinary(reader); + Sound.latched_value[0] = reader.ReadUInt16(); + Sound.utempdata[0] = reader.ReadUInt16(); + Sound.ym2151stream.output_sampindex = reader.ReadInt32(); + Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); + MSM5205.mm1[0].voice.stream.output_sampindex = reader.ReadInt32(); + MSM5205.mm1[0].voice.stream.output_base_sampindex = reader.ReadInt32(); + MSM5205.mm1[1].voice.stream.output_sampindex = reader.ReadInt32(); + MSM5205.mm1[1].voice.stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/State.cs.meta new file mode 100644 index 00000000..78a94826 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4da14e02d8de5ab44abaa29f2d98cffc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taito.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taito.cs new file mode 100644 index 00000000..a3d609e2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taito.cs @@ -0,0 +1,369 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Taito + { + public static int basebankmain, basebanksnd; + public static byte[] bb1, bublbobl_mcu_sharedram, videoram, bublbobl_objectram, slaverom,/* mcurom,*/ mcuram, /*mainram2,*/ mainram3, subrom; + + + #region //指针化 mcurom + static byte[] mcurom_src; + static GCHandle mcurom_handle; + public static byte* mcurom; + public static int mcuromLength; + public static bool mcurom_IsNull => mcurom == null; + public static byte[] mcurom_set + { + set + { + mcurom_handle.ReleaseGCHandle(); + mcurom_src = value; + mcuromLength = value.Length; + mcurom_src.GetObjectPtr(ref mcurom_handle, ref mcurom); + } + } + #endregion + + #region //指针化 mainram2 + static byte[] mainram2_src; + static GCHandle mainram2_handle; + public static byte* mainram2; + public static int mainram2Length; + public static bool mainram2_IsNull => mainram2 == null; + public static byte[] mainram2_set + { + set + { + mainram2_handle.ReleaseGCHandle(); + mainram2_src = value; + mainram2Length = value.Length; + mainram2_src.GetObjectPtr(ref mainram2_handle, ref mainram2); + } + } + #endregion + + public static void TaitoInit() + { + int i, n; + Machine.bRom = true; + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + videoram = new byte[0x1d00]; + bublbobl_objectram = new byte[0x300]; + Memory.Set_mainram(new byte[0x1800]); + Memory.Set_audioram(new byte[0x1000]); + Generic.paletteram_set = new byte[0x200]; + //bublbobl_mcu_sharedram = new byte[0x400]; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + slaverom = Machine.GetRom("slave.rom"); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + prom_set = Machine.GetRom("proms.rom"); + bublbobl_video_enable = 1; + if (Memory.mainrom_IsNull || slaverom == null || Memory.audiorom_IsNull || gfx1rom == null || prom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + dsw0 = 0xfe; + dsw1 = 0x7e; + } + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "bub68705": + case "bublcave": + case "bublcave11": + case "bublcave10": + videoram = new byte[0x1d00]; + bublbobl_objectram = new byte[0x300]; + Memory.Set_mainram(new byte[0x1800]); + Memory.Set_audioram(new byte[0x1000]); + mcuram = new byte[0xc0]; + Generic.paletteram_set = new byte[0x200]; + bublbobl_mcu_sharedram = new byte[0x400]; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + slaverom = Machine.GetRom("slave.rom"); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + mcurom_set = Machine.GetRom("mcu.rom"); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + prom_set = Machine.GetRom("proms.rom"); + bublbobl_video_enable = 0; + if (Memory.mainrom_IsNull || slaverom == null || Memory.audiorom_IsNull || mcurom == null || gfx1rom == null || prom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + dsw0 = 0xfe; + dsw1 = 0xff; + } + break; + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "dland": + case "bbredux": + mainram2_set = new byte[0x100]; + mainram3 = new byte[0x100]; + videoram = new byte[0x1d00]; + bublbobl_objectram = new byte[0x300]; + Memory.Set_mainram(new byte[0x1800]); + Memory.Set_audioram(new byte[0x1000]); + Generic.paletteram_set = new byte[0x200]; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + slaverom = Machine.GetRom("slave.rom"); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + prom_set = Machine.GetRom("proms.rom"); + bublbobl_video_enable = 0; + if (Memory.mainrom_IsNull || slaverom == null || Memory.audiorom_IsNull || gfx1rom == null || prom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + dsw0 = 0xfe; + dsw1 = 0x3f; + } + break; + case "bublboblb": + case "boblcave": + mainram2_set = new byte[0x100]; + mainram3 = new byte[0x100]; + videoram = new byte[0x1d00]; + bublbobl_objectram = new byte[0x300]; + Memory.Set_mainram(new byte[0x1800]); + Memory.Set_audioram(new byte[0x1000]); + Generic.paletteram_set = new byte[0x200]; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + slaverom = Machine.GetRom("slave.rom"); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + prom_set = Machine.GetRom("proms.rom"); + bublbobl_video_enable = 0; + if (Memory.mainrom_IsNull || slaverom == null || Memory.audiorom_IsNull || gfx1rom == null || prom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + dsw0 = 0xfe; + dsw1 = 0xc0; + } + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + { + mainram2_set = new byte[0x10000]; + cchip_ram = new byte[0x2000]; + Generic.paletteram16_set = new ushort[0x800]; + Memory.Set_mainram(new byte[0x8000]); + Memory.Set_audioram(new byte[0x1000]); + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + bb1 = Machine.GetRom("audiocpu.rom"); + //Memory.audiorom_set = new byte[0x20000]; + //Array.Copy(bb1, 0, Memory.audiorom, 0, 0x10000); + byte[] temprom = new byte[0x20000]; + Array.Copy(bb1, 0, temprom, 0, 0x10000); + Memory.Set_audiorom(temprom); + + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + gfx22rom_set = Machine.GetRom("gfx2.rom"); + n = gfx22romLength; + gfx2rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx2rom[i * 2] = (byte)(gfx22rom[i] >> 4); + gfx2rom[i * 2 + 1] = (byte)(gfx22rom[i] & 0x0f); + } + adpcmrom = Machine.GetRom("adpcm.rom"); + Taitosnd.taitosnd_start(); + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || gfx1rom == null || gfx2rom == null || adpcmrom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + dswa = 0xff; + dswb = 0x7f; + } + } + break; + case "opwolfb": + { + mainram2_set = new byte[0x10000]; + cchip_ram = new byte[0x2000]; + Generic.paletteram16_set = new ushort[0x800]; + Memory.Set_mainram(new byte[0x8000]); + Memory.Set_audioram(new byte[0x1000]); + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + bb1 = Machine.GetRom("audiocpu.rom"); + //Memory.audiorom_set = new byte[0x20000]; + //Array.Copy(bb1, 0, Memory.audiorom, 0, 0x10000); + byte[] temprom_set = new byte[0x20000]; + Array.Copy(bb1, 0, temprom_set, 0, 0x10000); + Memory.Set_audiorom(temprom_set); + + subrom = Machine.GetRom("sub.rom"); + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + gfx22rom_set = Machine.GetRom("gfx2.rom"); + n = gfx22romLength; + gfx2rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx2rom[i * 2] = (byte)(gfx22rom[i] >> 4); + gfx2rom[i * 2 + 1] = (byte)(gfx22rom[i] & 0x0f); + } + adpcmrom = Machine.GetRom("adpcm.rom"); + Taitosnd.taitosnd_start(); + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || subrom == null || gfx1rom == null || gfx2rom == null || adpcmrom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + dswa = 0xff; + dswb = 0xff; + } + } + break; + case "opwolfp": + { + mainram2_set = new byte[0x10000]; + cchip_ram = new byte[0x2000]; + Generic.paletteram16_set = new ushort[0x800]; + Memory.Set_mainram(new byte[0x8000]); + Memory.Set_audioram(new byte[0x1000]); + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + bb1 = Machine.GetRom("audiocpu.rom"); + //Memory.audiorom_set = new byte[0x20000]; + //Array.Copy(bb1, 0, Memory.audiorom, 0, 0x10000); + byte[] temprom = new byte[0x20000]; + Array.Copy(bb1, 0, temprom, 0, 0x10000); + Memory.Set_audiorom(temprom); + + gfx12rom_set = Machine.GetRom("gfx1.rom"); + n = gfx12romLength; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfx12rom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfx12rom[i] & 0x0f); + } + gfx22rom_set = Machine.GetRom("gfx2.rom"); + n = gfx22romLength; + gfx2rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx2rom[i * 2] = (byte)(gfx22rom[i] >> 4); + gfx2rom[i * 2 + 1] = (byte)(gfx22rom[i] & 0x0f); + } + adpcmrom = Machine.GetRom("adpcm.rom"); + Taitosnd.taitosnd_start(); + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || gfx1rom == null || gfx2rom == null || adpcmrom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + dswa = 0xff; + dswb = 0xff; + } + } + break; + } + } + public static void machine_reset_null() + { + + } + public static void irqhandler(int irq) + { + Cpuint.cpunum_set_input_line(2, 0, irq != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public unsafe static void driver_init_opwolf() + { + opwolf_region = Memory.mainrom[0x03ffff]; + opwolf_cchip_init(); + 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_gun_xoffs = -2; + opwolf_gun_yoffs = 17; + basebanksnd = 0x10000; + } + public unsafe static void driver_init_opwolfp() + { + opwolf_region = Memory.mainrom[0x03ffff]; + opwolf_gun_xoffs = 5; + opwolf_gun_yoffs = 30; + basebanksnd = 0x10000; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taito.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taito.cs.meta new file mode 100644 index 00000000..779ac2f4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taito.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 244252222966fc84badb34deed07cca1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taitoic.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taitoic.cs new file mode 100644 index 00000000..9cdbfb62 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taitoic.cs @@ -0,0 +1,664 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Taito + { + public static int PC080SN_chips; + public static ushort[][] PC080SN_ctrl; + public static ushort[][] PC080SN_ram; + public static ushort[][] PC080SN_bg_ram_offset, PC080SN_bgscroll_ram_offset; + public static int[][] PC080SN_bgscrollx, PC080SN_bgscrolly; + public static int PC080SN_xoffs, PC080SN_yoffs; + public static Tmap[][] PC080SN_tilemap; + public static int PC080SN_yinvert, PC080SN_dblwidth; + public static ushort PC090OJ_ctrl, PC090OJ_buffer, PC090OJ_gfxnum; + public static ushort PC090OJ_sprite_ctrl; + public static ushort[] PC090OJ_ram, PC090OJ_ram_buffered; + public static int PC090OJ_xoffs, PC090OJ_yoffs; + public static void taitoic_init() + { + int i; + PC080SN_ctrl = new ushort[2][]; + PC080SN_ram = new ushort[2][]; + PC080SN_bg_ram_offset = new ushort[2][]; + PC080SN_bgscroll_ram_offset = new ushort[2][]; + PC080SN_bgscrollx = new int[2][]; + PC080SN_bgscrolly = new int[2][]; + PC080SN_tilemap = new Tmap[2][]; + for (i = 0; i < 2; i++) + { + PC080SN_ctrl[i] = new ushort[8]; + PC080SN_bg_ram_offset[i] = new ushort[2]; + PC080SN_bgscroll_ram_offset[i] = new ushort[2]; + PC080SN_bgscrollx[i] = new int[2]; + PC080SN_bgscrolly[i] = new int[2]; + PC080SN_tilemap[i] = new Tmap[2]; + } + } + public static void tilemap_init() + { + switch (Machine.sName) + { + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + taitoic_init(); + break; + } + } + public static void PC080SN_vh_start(int chips, int gfxnum, int x_offset, int y_offset, int y_invert, int opaque, int dblwidth) + { + int i, j, k; + PC080SN_chips = chips; + PC080SN_yinvert = y_invert; + PC080SN_dblwidth = dblwidth; + PC080SN_xoffs = x_offset; + PC080SN_yoffs = y_offset; + for (i = 0; i < chips; i++) + { + int xd, yd; + for (j = 0; j < 2; j++) + { + PC080SN_tilemap[i][j] = new Tmap(); + if (PC080SN_dblwidth == 0) /* standard tilemaps */ + { + PC080SN_tilemap[i][j].cols = 64; + PC080SN_tilemap[i][j].rows = 64; + PC080SN_tilemap[i][j].tilewidth = 8; + PC080SN_tilemap[i][j].tileheight = 8; + PC080SN_tilemap[i][j].width = 0x200; + PC080SN_tilemap[i][j].height = 0x200; + PC080SN_tilemap[i][j].enable = true; + PC080SN_tilemap[i][j].all_tiles_dirty = true; + PC080SN_tilemap[i][j].total_elements = gfx1romLength / 0x40; + PC080SN_tilemap[i][j].pixmap = new ushort[0x200 * 0x200]; + PC080SN_tilemap[i][j].flagsmap = new byte[0x200, 0x200]; + PC080SN_tilemap[i][j].tileflags = new byte[64, 64]; + PC080SN_tilemap[i][j].pen_data_set = new byte[0x40]; + PC080SN_tilemap[i][j].pen_to_flags = new byte[1, 16]; + PC080SN_tilemap[i][j].pen_to_flags[0, 0] = 0; + for (k = 1; k < 16; k++) + { + PC080SN_tilemap[i][j].pen_to_flags[0, k] = 0x10; + } + PC080SN_tilemap[i][j].scrollrows = 1; + PC080SN_tilemap[i][j].scrollcols = 1; + PC080SN_tilemap[i][j].rowscroll = new int[PC080SN_tilemap[i][j].scrollrows]; + PC080SN_tilemap[i][j].colscroll = new int[PC080SN_tilemap[i][j].scrollcols]; + PC080SN_tilemap[i][j].tilemap_draw_instance3 = PC080SN_tilemap[i][j].tilemap_draw_instanceTaito_opwolf; + } + else /* double width tilemaps */ + { + PC080SN_tilemap[i][j].cols = 128; + PC080SN_tilemap[i][j].rows = 64; + PC080SN_tilemap[i][j].tilewidth = 8; + PC080SN_tilemap[i][j].tileheight = 8; + PC080SN_tilemap[i][j].width = 0x400; + PC080SN_tilemap[i][j].height = 0x200; + PC080SN_tilemap[i][j].enable = true; + PC080SN_tilemap[i][j].all_tiles_dirty = true; + PC080SN_tilemap[i][j].total_elements = gfx1romLength / 0x40; + PC080SN_tilemap[i][j].pixmap = new ushort[0x200 * 0x400]; + PC080SN_tilemap[i][j].flagsmap = new byte[0x200, 0x400]; + PC080SN_tilemap[i][j].tileflags = new byte[128, 64]; + PC080SN_tilemap[i][j].pen_data_set = new byte[0x40]; + PC080SN_tilemap[i][j].pen_to_flags = new byte[1, 16]; + PC080SN_tilemap[i][j].pen_to_flags[0, 0] = 0; + for (k = 1; k < 16; k++) + { + PC080SN_tilemap[i][j].pen_to_flags[0, k] = 0x10; + } + PC080SN_tilemap[i][j].scrollrows = 1; + PC080SN_tilemap[i][j].scrollcols = 1; + PC080SN_tilemap[i][j].rowscroll = new int[PC080SN_tilemap[i][j].scrollrows]; + PC080SN_tilemap[i][j].colscroll = new int[PC080SN_tilemap[i][j].scrollcols]; + PC080SN_tilemap[i][j].tilemap_draw_instance3 = PC080SN_tilemap[i][j].tilemap_draw_instanceTaito_opwolf; + } + } + PC080SN_tilemap[i][0].tile_update3 = PC080SN_tilemap[i][0].tile_updateTaitobg_opwolf; + PC080SN_tilemap[i][1].tile_update3 = PC080SN_tilemap[i][1].tile_updateTaitofg_opwolf; + PC080SN_ram[i] = new ushort[0x8000]; + PC080SN_bg_ram_offset[i][0] = 0x0000 / 2; + PC080SN_bg_ram_offset[i][1] = 0x8000 / 2; + PC080SN_bgscroll_ram_offset[i][0] = 0x4000 / 2; + PC080SN_bgscroll_ram_offset[i][1] = 0xc000 / 2; + Array.Clear(PC080SN_ram[i], 0, 0x8000); + /*state_save_register_item_pointer("PC080SN", i, PC080SN_ram[i], PC080SN_RAM_SIZE / 2); + state_save_register_item_array("PC080SN", i, PC080SN_ctrl[i]); + state_save_register_postload(machine, PC080SN_restore_scroll, (void*)(FPTR)i);*/ + + //tilemap_set_transparent_pen(PC080SN_tilemap[i][0], 0); + //tilemap_set_transparent_pen(PC080SN_tilemap[i][1], 0); + + /* I'm setting optional chip #2 with the same offsets (Topspeed) */ + xd = (i == 0) ? -x_offset : -x_offset; + yd = (i == 0) ? y_offset : y_offset; + PC080SN_tilemap[i][0].tilemap_set_scrolldx(-16 + xd, -16 - xd); + PC080SN_tilemap[i][0].tilemap_set_scrolldy(yd, -yd); + PC080SN_tilemap[i][1].tilemap_set_scrolldx(-16 + xd, -16 - xd); + PC080SN_tilemap[i][1].tilemap_set_scrolldy(yd, -yd); + if (PC080SN_dblwidth == 0) + { + PC080SN_tilemap[i][0].scrollrows = 512; + PC080SN_tilemap[i][0].rowscroll = new int[PC080SN_tilemap[i][0].scrollrows]; + PC080SN_tilemap[i][1].scrollrows = 512; + PC080SN_tilemap[i][1].rowscroll = new int[PC080SN_tilemap[i][1].scrollrows]; + } + } + } + public static ushort PC080SN_word_0_r(int offset) + { + return PC080SN_ram[0][offset]; + } + public static ushort PC080SN_word_1_r(int offset) + { + return PC080SN_ram[1][offset]; + } + public static void PC080SN_word_w(int chip, int offset, ushort data) + { + int row, col, memindex; + PC080SN_ram[chip][offset] = data; + if (PC080SN_dblwidth == 0) + { + if (offset < 0x2000) + { + memindex = offset / 2; + row = memindex / PC080SN_tilemap[chip][0].cols; + col = memindex % PC080SN_tilemap[chip][0].cols; + PC080SN_tilemap[chip][0].tilemap_mark_tile_dirty(row, col); + } + else if (offset >= 0x4000 && offset < 0x6000) + { + memindex = (offset & 0x1fff) / 2; + row = memindex / PC080SN_tilemap[chip][1].cols; + col = memindex % PC080SN_tilemap[chip][1].cols; + PC080SN_tilemap[chip][1].tilemap_mark_tile_dirty(row, col); + } + } + else + { + if (offset < 0x4000) + { + memindex = offset & 0x1fff; + row = memindex / PC080SN_tilemap[chip][0].cols; + col = memindex % PC080SN_tilemap[chip][0].cols; + PC080SN_tilemap[chip][0].tilemap_mark_tile_dirty(row, col); + } + else if (offset >= 0x4000 && offset < 0x8000) + { + memindex = offset & 0x1fff; + row = memindex / PC080SN_tilemap[chip][1].cols; + col = memindex % PC080SN_tilemap[chip][1].cols; + PC080SN_tilemap[chip][1].tilemap_mark_tile_dirty(row, col); + } + } + } + public static void PC080SN_word_w1(int chip, int offset, byte data) + { + int row, col, memindex; + PC080SN_ram[chip][offset] = (ushort)((data << 8) | (PC080SN_ram[chip][offset] & 0xff)); + if (PC080SN_dblwidth == 0) + { + if (offset < 0x2000) + { + memindex = offset / 2; + row = memindex / PC080SN_tilemap[chip][0].cols; + col = memindex % PC080SN_tilemap[chip][0].cols; + PC080SN_tilemap[chip][0].tilemap_mark_tile_dirty(row, col); + } + else if (offset >= 0x4000 && offset < 0x6000) + { + memindex = (offset & 0x1fff) / 2; + row = memindex / PC080SN_tilemap[chip][1].cols; + col = memindex % PC080SN_tilemap[chip][1].cols; + PC080SN_tilemap[chip][1].tilemap_mark_tile_dirty(row, col); + } + } + else + { + if (offset < 0x4000) + { + memindex = offset & 0x1fff; + row = memindex / PC080SN_tilemap[chip][0].cols; + col = memindex % PC080SN_tilemap[chip][0].cols; + PC080SN_tilemap[chip][0].tilemap_mark_tile_dirty(row, col); + } + else if (offset >= 0x4000 && offset < 0x8000) + { + memindex = offset & 0x1fff; + row = memindex / PC080SN_tilemap[chip][1].cols; + col = memindex % PC080SN_tilemap[chip][1].cols; + PC080SN_tilemap[chip][1].tilemap_mark_tile_dirty(row, col); + } + } + } + public static void PC080SN_word_w2(int chip, int offset, byte data) + { + int row, col, memindex; + PC080SN_ram[chip][offset] = (ushort)((PC080SN_ram[chip][offset] & 0xff00) | data); + if (PC080SN_dblwidth == 0) + { + if (offset < 0x2000) + { + memindex = offset / 2; + row = memindex / PC080SN_tilemap[chip][0].cols; + col = memindex % PC080SN_tilemap[chip][0].cols; + PC080SN_tilemap[chip][0].tilemap_mark_tile_dirty(row, col); + } + else if (offset >= 0x4000 && offset < 0x6000) + { + memindex = (offset & 0x1fff) / 2; + row = memindex / PC080SN_tilemap[chip][1].cols; + col = memindex % PC080SN_tilemap[chip][1].cols; + PC080SN_tilemap[chip][1].tilemap_mark_tile_dirty(row, col); + } + } + else + { + if (offset < 0x4000) + { + memindex = offset & 0x1fff; + row = memindex / PC080SN_tilemap[chip][0].cols; + col = memindex % PC080SN_tilemap[chip][0].cols; + PC080SN_tilemap[chip][0].tilemap_mark_tile_dirty(row, col); + } + else if (offset >= 0x4000 && offset < 0x8000) + { + memindex = offset & 0x1fff; + row = memindex / PC080SN_tilemap[chip][1].cols; + col = memindex % PC080SN_tilemap[chip][1].cols; + PC080SN_tilemap[chip][1].tilemap_mark_tile_dirty(row, col); + } + } + } + public static void PC080SN_word_0_w(int offset, ushort data) + { + PC080SN_word_w(0, offset, data); + } + public static void PC080SN_word_0_w1(int offset, byte data) + { + PC080SN_word_w1(0, offset, data); + } + public static void PC080SN_word_0_w2(int offset, byte data) + { + PC080SN_word_w2(0, offset, data); + } + public static void PC080SN_word_1_w(int offset, ushort data) + { + PC080SN_word_w(1, offset, data); + } + public static void PC080SN_word_1_w1(int offset, byte data) + { + PC080SN_word_w1(1, offset, data); + } + public static void PC080SN_word_1_w2(int offset, byte data) + { + PC080SN_word_w2(1, offset, data); + } + public static void PC080SN_xscroll_word_w(int chip, int offset, ushort data) + { + ushort data1; + PC080SN_ctrl[chip][offset] = data; + data1 = PC080SN_ctrl[chip][offset]; + switch (offset) + { + case 0x00: + PC080SN_bgscrollx[chip][0] = -data1; + break; + case 0x01: + PC080SN_bgscrollx[chip][1] = -data1; + break; + } + } + public static void PC080SN_xscroll_word_w1(int chip, int offset, byte data) + { + ushort data1; + PC080SN_ctrl[chip][offset] = (ushort)((data << 8) | (PC080SN_ctrl[chip][offset] & 0xff)); + data1 = PC080SN_ctrl[chip][offset]; + switch (offset) + { + case 0x00: + PC080SN_bgscrollx[chip][0] = -data1; + break; + case 0x01: + PC080SN_bgscrollx[chip][1] = -data1; + break; + } + } + public static void PC080SN_xscroll_word_w2(int chip, int offset, byte data) + { + ushort data1; + PC080SN_ctrl[chip][offset] = (ushort)((PC080SN_ctrl[chip][offset] & 0xff00) | data); + data1 = PC080SN_ctrl[chip][offset]; + switch (offset) + { + case 0x00: + PC080SN_bgscrollx[chip][0] = -data1; + break; + case 0x01: + PC080SN_bgscrollx[chip][1] = -data1; + break; + } + } + public static void PC080SN_yscroll_word_w(int chip, int offset, ushort data) + { + int data1; + PC080SN_ctrl[chip][offset + 2] = data; + data1 = PC080SN_ctrl[chip][offset + 2]; + if (PC080SN_yinvert != 0) + { + data1 = -data1; + } + switch (offset) + { + case 0x00: + PC080SN_bgscrolly[chip][0] = -data1; + break; + case 0x01: + PC080SN_bgscrolly[chip][1] = -data1; + break; + } + } + public static void PC080SN_yscroll_word_w1(int chip, int offset, byte data) + { + int data1; + PC080SN_ctrl[chip][offset + 2] = (ushort)((data << 8) | (PC080SN_ctrl[chip][offset + 2] & 0xff)); + data1 = PC080SN_ctrl[chip][offset + 2]; + if (PC080SN_yinvert != 0) + { + data1 = -data1; + } + switch (offset) + { + case 0x00: + PC080SN_bgscrolly[chip][0] = -data1; + break; + case 0x01: + PC080SN_bgscrolly[chip][1] = -data1; + break; + } + } + public static void PC080SN_yscroll_word_w2(int chip, int offset, byte data) + { + int data1; + PC080SN_ctrl[chip][offset + 2] = (ushort)((PC080SN_ctrl[chip][offset + 2] & 0xff00) | data); + data1 = PC080SN_ctrl[chip][offset + 2]; + if (PC080SN_yinvert != 0) + { + data1 = -data1; + } + switch (offset) + { + case 0x00: + PC080SN_bgscrolly[chip][0] = -data1; + break; + case 0x01: + PC080SN_bgscrolly[chip][1] = -data1; + break; + } + } + public static void PC080SN_ctrl_word_w(int chip, int offset, ushort data) + { + ushort data1; + PC080SN_ctrl[chip][offset + 4] = data; + data1 = PC080SN_ctrl[chip][offset + 4]; + switch (offset) + { + case 0x00: + { + int flip = (data1 & 0x01) != 0 ? (Tilemap.TILEMAP_FLIPX | Tilemap.TILEMAP_FLIPY) : 0; + //tilemap_set_flip(PC080SN_tilemap[chip][0],flip); + //tilemap_set_flip(PC080SN_tilemap[chip][1],flip); + break; + } + } + } + public static void PC080SN_ctrl_word_w1(int chip, int offset, byte data) + { + ushort data1; + PC080SN_ctrl[chip][offset + 4] = (ushort)((data << 8) | (PC080SN_ctrl[chip][offset + 4] & 0xff)); + data1 = PC080SN_ctrl[chip][offset + 4]; + switch (offset) + { + case 0x00: + { + int flip = (data1 & 0x01) != 0 ? (Tilemap.TILEMAP_FLIPX | Tilemap.TILEMAP_FLIPY) : 0; + break; + } + } + } + public static void PC080SN_ctrl_word_w2(int chip, int offset, byte data) + { + ushort data1; + PC080SN_ctrl[chip][offset + 4] = (ushort)((PC080SN_ctrl[chip][offset + 4] & 0xff00) | data); + data1 = PC080SN_ctrl[chip][offset + 4]; + switch (offset) + { + case 0x00: + { + int flip = (data1 & 0x01) != 0 ? (Tilemap.TILEMAP_FLIPX | Tilemap.TILEMAP_FLIPY) : 0; + break; + } + } + } + public static void PC080SN_xscroll_word_0_w(int offset, ushort data) + { + PC080SN_xscroll_word_w(0, offset, data); + } + public static void PC080SN_xscroll_word_0_w1(int offset, byte data) + { + PC080SN_xscroll_word_w1(0, offset, data); + } + public static void PC080SN_xscroll_word_0_w2(int offset, byte data) + { + PC080SN_xscroll_word_w2(0, offset, data); + } + public static void PC080SN_xscroll_word_1_w(int offset, ushort data) + { + PC080SN_xscroll_word_w(1, offset, data); + } + public static void PC080SN_xscroll_word_1_w1(int offset, byte data) + { + PC080SN_xscroll_word_w1(1, offset, data); + } + public static void PC080SN_xscroll_word_1_w2(int offset, byte data) + { + PC080SN_xscroll_word_w2(1, offset, data); + } + public static void PC080SN_yscroll_word_0_w(int offset, ushort data) + { + PC080SN_yscroll_word_w(0, offset, data); + } + public static void PC080SN_yscroll_word_0_w1(int offset, byte data) + { + PC080SN_yscroll_word_w1(0, offset, data); + } + public static void PC080SN_yscroll_word_0_w2(int offset, byte data) + { + PC080SN_yscroll_word_w2(0, offset, data); + } + public static void PC080SN_yscroll_word_1_w(int offset, ushort data) + { + PC080SN_yscroll_word_w(1, offset, data); + } + public static void PC080SN_yscroll_word_1_w1(int offset, byte data) + { + PC080SN_yscroll_word_w1(1, offset, data); + } + public static void PC080SN_yscroll_word_1_w2(int offset, byte data) + { + PC080SN_yscroll_word_w2(1, offset, data); + } + public static void PC080SN_ctrl_word_0_w(int offset, ushort data) + { + PC080SN_ctrl_word_w(0, offset, data); + } + public static void PC080SN_ctrl_word_0_w1(int offset, byte data) + { + PC080SN_ctrl_word_w1(0, offset, data); + } + public static void PC080SN_ctrl_word_0_w2(int offset, byte data) + { + PC080SN_ctrl_word_w2(0, offset, data); + } + public static void PC080SN_ctrl_word_1_w(int offset, ushort data) + { + PC080SN_ctrl_word_w(1, offset, data); + } + public static void PC080SN_ctrl_word_1_w1(int offset, byte data) + { + PC080SN_ctrl_word_w1(1, offset, data); + } + public static void PC080SN_ctrl_word_1_w2(int offset, byte data) + { + PC080SN_ctrl_word_w2(1, offset, data); + } + public static void PC080SN_tilemap_update() + { + int chip, j; + for (chip = 0; chip < PC080SN_chips; chip++) + { + PC080SN_tilemap[chip][0].tilemap_set_scrolly(0, PC080SN_bgscrolly[chip][0]); + PC080SN_tilemap[chip][1].tilemap_set_scrolly(0, PC080SN_bgscrolly[chip][1]); + if (PC080SN_dblwidth == 0) + { + for (j = 0; j < 256; j++) + { + PC080SN_tilemap[chip][0].tilemap_set_scrollx((j + PC080SN_bgscrolly[chip][0]) & 0x1ff, PC080SN_bgscrollx[chip][0] - PC080SN_ram[chip][PC080SN_bgscroll_ram_offset[chip][0] + j]); + //PC080SN_tilemap[chip][0].tilemap_set_scrollx(j, PC080SN_bgscrollx[chip][0]); + + } + for (j = 0; j < 256; j++) + { + PC080SN_tilemap[chip][1].tilemap_set_scrollx((j + PC080SN_bgscrolly[chip][1]) & 0x1ff, PC080SN_bgscrollx[chip][1] - PC080SN_ram[chip][PC080SN_bgscroll_ram_offset[chip][1] + j]); + //PC080SN_tilemap[chip][1].tilemap_set_scrollx(j, PC080SN_bgscrollx[chip][1]); + } + } + else + { + PC080SN_tilemap[chip][0].tilemap_set_scrollx(0, PC080SN_bgscrollx[chip][0]); + PC080SN_tilemap[chip][1].tilemap_set_scrollx(0, PC080SN_bgscrollx[chip][1]); + } + } + } + public static void PC080SN_tilemap_draw(int chip, int layer, int flags, byte priority) + { + PC080SN_tilemap[chip][layer].tilemap_draw_primask(Video.screenstate.visarea, flags, priority); + } + public static void PC090OJ_vh_start(int gfxnum, int x_offset, int y_offset, int use_buffer) + { + PC090OJ_gfxnum = (ushort)gfxnum; + PC090OJ_xoffs = x_offset; + PC090OJ_yoffs = y_offset; + PC090OJ_buffer = (ushort)use_buffer; + PC090OJ_ram = new ushort[0x2000]; + PC090OJ_ram_buffered = new ushort[0x2000]; + Array.Clear(PC090OJ_ram, 0, 0x2000); + Array.Clear(PC090OJ_ram_buffered, 0, 0x2000); + } + public static ushort PC090OJ_word_0_r(int offset) + { + return PC090OJ_ram[offset]; + } + public static void PC090OJ_word_w(int offset, ushort data) + { + PC090OJ_ram[offset] = data; + if (PC090OJ_buffer == 0) + { + PC090OJ_ram_buffered[offset] = PC090OJ_ram[offset]; + } + if (offset == 0xdff) + { + PC090OJ_ctrl = data; + } + } + public static void PC090OJ_word_w1(int offset, byte data) + { + PC090OJ_ram[offset] = (ushort)((data << 8) | (PC090OJ_ram[offset] & 0xff)); + if (PC090OJ_buffer == 0) + { + PC090OJ_ram_buffered[offset] = PC090OJ_ram[offset]; + } + if (offset == 0xdff) + { + PC090OJ_ctrl = (ushort)((data << 8) | (PC090OJ_ctrl & 0xff)); + } + } + public static void PC090OJ_word_w2(int offset, byte data) + { + PC090OJ_ram[offset] = (ushort)((PC090OJ_ram[offset] & 0xff00) | data); + if (PC090OJ_buffer == 0) + { + PC090OJ_ram_buffered[offset] = PC090OJ_ram[offset]; + } + if (offset == 0xdff) + { + PC090OJ_ctrl = (ushort)((PC090OJ_ctrl & 0xff00) | data); + } + } + public static void PC090OJ_word_0_w(int offset, ushort data) + { + PC090OJ_word_w(offset, data); + } + public static void PC090OJ_word_0_w1(int offset, byte data) + { + PC090OJ_word_w1(offset, data); + } + public static void PC090OJ_word_0_w2(int offset, byte data) + { + PC090OJ_word_w2(offset, data); + } + public static void PC090OJ_draw_sprites(int pri_type) + { + int offs, priority = 0; + int sprite_colbank = (PC090OJ_sprite_ctrl & 0xf) << 4; /* top nibble */ + switch (pri_type) + { + case 0x00: + priority = 0; /* sprites over top bg layer */ + break; + case 0x01: + priority = 1; /* sprites under top bg layer */ + break; + case 0x02: + priority = PC090OJ_sprite_ctrl >> 15; /* variable sprite/tile priority */ + break; + } + for (offs = 0; offs < 0x800 / 2; offs += 4) + { + int flipx, flipy; + int x, y; + int data, code, color; + data = PC090OJ_ram_buffered[offs + 0]; + flipy = (data & 0x8000) >> 15; + flipx = (data & 0x4000) >> 14; + color = (data & 0x000f) | sprite_colbank; + code = PC090OJ_ram_buffered[offs + 2] & 0x1fff; + x = PC090OJ_ram_buffered[offs + 3] & 0x1ff; /* mask verified with Rainbowe board */ + y = PC090OJ_ram_buffered[offs + 1] & 0x1ff; /* mask verified with Rainbowe board */ + if (x > 0x140) + { + x -= 0x200; + } + if (y > 0x140) + { + y -= 0x200; + } + if ((PC090OJ_ctrl & 1) == 0) + { + x = 320 - x - 16; + y = 256 - y - 16; + flipx = (flipx == 0 ? 1 : 0); + flipy = (flipy == 0 ? 1 : 0); + } + x += PC090OJ_xoffs; + y += PC090OJ_yoffs; + Drawgfx.common_drawgfx_opwolf(gfx2rom, code, color, flipx, flipy, x, y, cliprect, (uint)((priority != 0 ? 0xfc : 0xf0) | (1 << 31))); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taitoic.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taitoic.cs.meta new file mode 100644 index 00000000..1f5ac13a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Taitoic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0235a9b1292e92444b26ad501a84a2dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Tilemap.cs new file mode 100644 index 00000000..e3f167fc --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Tilemap.cs @@ -0,0 +1,204 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Tmap + { + public void tilemap_draw_instanceTaito_opwolf(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + continue; + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x140 + xpos + x_start, x_end - x_start); + if (priority != 0) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x140 + i] = pixmap[offsety2 * width + i - xpos]; + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tile_updateTaitobg_opwolf(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color, attr; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + if (Taito.PC080SN_dblwidth == 0) + { + code = (Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][0] + 2 * tile_index + 1] & 0x3fff); + attr = Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][0] + 2 * tile_index]; + } + else + { + code = (Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][0] + tile_index + 0x2000] & 0x3fff); + attr = Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][0] + tile_index]; + } + color = attr & 0x1ff; + code = code % Taito.PC080SN_tilemap[0][0].total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x10 * color; + group = 0; + flags = (((attr & 0xc000) >> 14) & 3) ^ (attributes & 0x03); + tileflags[row, col] = tile_drawTaitobg_opwolf(Taito.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateTaitofg_opwolf(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, color, attr; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + if (Taito.PC080SN_dblwidth == 0) + { + code = (Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][1] + 2 * tile_index + 1] & 0x3fff); + attr = Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][1] + 2 * tile_index]; + } + else + { + code = (Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][1] + tile_index + 0x2000] & 0x3fff); + attr = Taito.PC080SN_ram[0][Taito.PC080SN_bg_ram_offset[0][1] + tile_index]; + } + color = attr & 0x1ff; + code = code % Taito.PC080SN_tilemap[0][1].total_elements; + pen_data_offset = code * 0x40; + palette_base = 0x10 * color; + group = 0; + flags = (((attr & 0xc000) >> 14) & 3) ^ (attributes & 0x03); + tileflags[row, col] = tile_drawTaitobg_opwolf(Taito.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public byte tile_drawTaitobg_opwolf(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Tilemap.cs.meta new file mode 100644 index 00000000..b4327588 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a1176cc4cd32a847820207885cd2638 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Video.cs new file mode 100644 index 00000000..31ddf040 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Video.cs @@ -0,0 +1,225 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Taito + { + //public static byte[] /*gfx1rom, *//*gfx2rom,*/ /*gfx12rom,*/ /*gfx22rom*//*, prom*/; + public static int bublbobl_objectram_size = 0x300; + public static RECT cliprect; + public static ushort[] uuFF; + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + #region //指针化 gfx12rom + static byte[] gfx12rom_src; + static GCHandle gfx12rom_handle; + public static byte* gfx12rom; + public static int gfx12romLength; + public static bool gfx12rom_IsNull => gfx12rom == null; + public static byte[] gfx12rom_set + { + set + { + gfx12rom_handle.ReleaseGCHandle(); + gfx12rom_src = value; + gfx12romLength = value.Length; + gfx12rom_src.GetObjectPtr(ref gfx12rom_handle, ref gfx12rom); + } + } + #endregion + + #region //指针化 gfx22rom + static byte[] gfx22rom_src; + static GCHandle gfx22rom_handle; + public static byte* gfx22rom; + public static int gfx22romLength; + public static bool gfx22rom_IsNull => gfx22rom == null; + public static byte[] gfx22rom_set + { + set + { + gfx22rom_handle.ReleaseGCHandle(); + gfx22rom_src = value; + gfx22romLength = value.Length; + gfx22rom_src.GetObjectPtr(ref gfx22rom_handle, ref gfx22rom); + } + } + #endregion + + #region //指针化 prom + static byte[] prom_src; + static GCHandle prom_handle; + public static byte* prom; + public static int promLength; + public static bool prom_IsNull => prom == null; + public static byte[] prom_set + { + set + { + prom_handle.ReleaseGCHandle(); + prom_src = value; + promLength = value.Length; + prom_src.GetObjectPtr(ref prom_handle, ref prom); + } + } + #endregion + + public static void video_start_bublbobl() + { + int i; + uuFF = new ushort[0x100 * 0x100]; + for (i = 0; i < 0x10000; i++) + { + uuFF[i] = 0xff; + } + cliprect = new RECT(); + cliprect.min_x = 0; + cliprect.max_x = 255; + cliprect.min_y = 16; + cliprect.max_y = 239; + } + public static void video_update_bublbobl() + { + int offs; + int sx, sy, xc, yc; + int gfx_num, gfx_attr, gfx_offs; + int prom_line_offset; + Array.Copy(uuFF, Video.bitmapbase[Video.curbitmap], 0x10000); + if (bublbobl_video_enable == 0) + { + return; + } + sx = 0; + if (videoram[0xe86] == 0x7b) + { + int i1 = 1; + } + for (offs = 0; offs < bublbobl_objectram_size; offs += 4) + { + if (bublbobl_objectram[offs] == 0 && bublbobl_objectram[offs + 1] == 0 && bublbobl_objectram[offs + 2] == 0 && bublbobl_objectram[offs + 3] == 0) + { + continue; + } + gfx_num = bublbobl_objectram[offs + 1]; + gfx_attr = bublbobl_objectram[offs + 3]; + prom_line_offset = 0x80 + ((gfx_num & 0xe0) >> 1); + gfx_offs = ((gfx_num & 0x1f) * 0x80); + if ((gfx_num & 0xa0) == 0xa0) + { + gfx_offs |= 0x1000; + } + sy = -bublbobl_objectram[offs + 0]; + for (yc = 0; yc < 32; yc++) + { + if ((prom[prom_line_offset + yc / 2] & 0x08) != 0) + { + continue; + } + if ((prom[prom_line_offset + yc / 2] & 0x04) == 0) + { + sx = bublbobl_objectram[offs + 2]; + if ((gfx_attr & 0x40) != 0) + { + sx -= 256; + } + } + for (xc = 0; xc < 2; xc++) + { + int goffs, code, color, flipx, flipy, x, y; + goffs = gfx_offs + xc * 0x40 + (yc & 7) * 0x02 + (prom[prom_line_offset + yc / 2] & 0x03) * 0x10; + code = videoram[goffs] + 256 * (videoram[goffs + 1] & 0x03) + 1024 * (gfx_attr & 0x0f); + color = (videoram[goffs + 1] & 0x3c) >> 2; + flipx = videoram[goffs + 1] & 0x40; + flipy = videoram[goffs + 1] & 0x80; + x = sx + xc * 8; + y = (sy + yc * 8) & 0xff; + if (Generic.flip_screen_get() != 0) + { + x = 248 - x; + y = 248 - y; + flipx = (flipx == 0) ? 1 : 0; + flipy = (flipy == 0) ? 1 : 0; + } + Drawgfx.common_drawgfx_bublbobl(gfx1rom, code, color, flipx, flipy, x, y, cliprect); + } + } + sx += 16; + } + } + public static void video_eof_taito() + { + + } + public static void video_start_opwolf() + { + cliprect = new RECT(); + cliprect.min_x = 0; + cliprect.max_x = 319; + cliprect.min_y = 8; + cliprect.max_y = 247; + PC080SN_vh_start(1, 1, 0, 0, 0, 0, 0); + PC090OJ_vh_start(0, 0, 0, 0); + } + public static void video_update_opwolf() + { + int[] layer = new int[2]; + PC080SN_tilemap_update(); + layer[0] = 0; + layer[1] = 1; + Array.Clear(Tilemap.priority_bitmap, 0, 0x14000); + PC080SN_tilemap_draw(0, layer[0], 0, 1); + PC080SN_tilemap_draw(0, layer[1], 0x10, 2); + PC090OJ_draw_sprites(1); + } + public static void opwolf_spritectrl_w(int offset, ushort data) + { + if (offset == 0) + { + PC090OJ_sprite_ctrl = (ushort)((data & 0xe0) >> 5); + } + } + public static void opwolf_spritectrl_w2(int offset, byte data) + { + if (offset == 0) + { + PC090OJ_sprite_ctrl = (ushort)((data & 0xe0) >> 5); + } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Video.cs.meta new file mode 100644 index 00000000..dcb5757b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taito/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b972e9e1282a1e2438c4a2b004c9310c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob.meta new file mode 100644 index 00000000..907f634d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e9d363cda1a7654bb662350861cae0b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Drawgfx.cs new file mode 100644 index 00000000..5cd969fc --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Drawgfx.cs @@ -0,0 +1,211 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfxzoom_taitob(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip, int transparent_color, int scalex, int scaley) + { + if ((scalex == 0) || (scaley == 0)) + { + return; + } + if (scalex == 0x10000 && scaley == 0x10000) + { + common_drawgfx_taitob(bb1, code, color, flipx, flipy, sx, sy, clip); + return; + } + RECT myclip; + myclip.min_x = clip.min_x; + myclip.max_x = clip.max_x; + myclip.min_y = clip.min_y; + myclip.max_y = clip.max_y; + if (myclip.min_x < 0) + { + myclip.min_x = 0; + } + if (myclip.max_x >= 0x200) + { + myclip.max_x = 0x200 - 1; + } + if (myclip.min_y < 0) + { + myclip.min_y = 0; + } + if (myclip.max_y >= 0x100) + { + myclip.max_y = 0x100 - 1; + } + int colorbase = 0x10 * (color % 0x100); + int source_baseoffset = code * 0x100;//totalelement + int sprite_screen_height = (scaley * 0x10 + 0x8000) >> 16; + int sprite_screen_width = (scalex * 0x10 + 0x8000) >> 16; + int countx, county, i, j, srcoffset, dstoffset; + if (sprite_screen_width != 0 && sprite_screen_height != 0) + { + int dx = (0x10 << 16) / sprite_screen_width; + int dy = (0x10 << 16) / sprite_screen_height; + int ex = sx + sprite_screen_width; + int ey = sy + sprite_screen_height; + int x_index_base; + int y_index; + if (flipx != 0) + { + x_index_base = (sprite_screen_width - 1) * dx; + dx = -dx; + } + else + x_index_base = 0; + + if (flipy != 0) + { + y_index = (sprite_screen_height - 1) * dy; + dy = -dy; + } + else + { + y_index = 0; + } + if (sx < myclip.min_x) + { + int pixels = myclip.min_x - sx; + sx += pixels; + x_index_base += pixels * dx; + } + if (sy < myclip.min_y) + { + int pixels = myclip.min_y - sy; + sy += pixels; + y_index += pixels * dy; + } + if (ex > myclip.max_x + 1) + { + int pixels = ex - myclip.max_x - 1; + ex -= pixels; + } + if (ey > myclip.max_y + 1) + { + int pixels = ey - myclip.max_y - 1; + ey -= pixels; + } + if (ex > sx) + { + int y; + countx = ex - sx; + county = ey - sy; + for (i = 0; i < county; i++) + { + for (j = 0; j < countx; j++) + { + int c; + srcoffset = ((y_index + dy * i) >> 16) * 0x10 + ((x_index_base + dx * j) >> 16); + dstoffset = (sy + i) * 0x200 + sx + j; + c = bb1[source_baseoffset + srcoffset]; + if (c != transparent_color) + { + Taitob.framebuffer[Taitob.framebuffer_page][0x200 * (sy + i) + sx + j] = (ushort)(color + c); + } + } + } + } + } + } + public static void common_drawgfx_taitob(byte* bb1, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + ox = sx; + oy = sy; + ex = sx + 0x10 - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x200) + { + ex = 0x200 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + 0x10 - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = 0x10; + int sh = 0x10; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = color; + blockmove_8toN_transpen_raw16_taitob(bb1, code, sw, sh, 0x10, ls, ts, flipx, flipy, dw, dh, colorbase, sx, sy); + } + public static void blockmove_8toN_transpen_raw16_taitob(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int sx, int sy) + { + int ydir, xdir, col, i, j, offsetx, offsety; + int srcdata_offset = code * 0x100; + offsetx = sx; + offsety = sy; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0) + { + Taitob.framebuffer[Taitob.framebuffer_page][(offsety + ydir * i) * 0x200 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Drawgfx.cs.meta new file mode 100644 index 00000000..30f284c5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8cc352aed1899c4dba4103b91d59d19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Input.cs new file mode 100644 index 00000000..626c0f4b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Input.cs @@ -0,0 +1,452 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class Taitob + { + public static void loop_inputports_taitob_common() + { + + } + public static void loop_inputports_taitob_pbobble() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + dswb &= unchecked((byte)~0x10); + } + else + { + dswb |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + dswb &= unchecked((byte)~0x20); + } + else + { + dswb |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + sbyte1 &= ~0x40; + } + else + { + sbyte1 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + } + public static void loop_inputports_taitob_silentd() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + sbyte1 &= ~0x10; + } + else + { + sbyte1 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + sbyte1 &= ~0x20; + } + else + { + sbyte1 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + sbyte1 &= ~0x04; + } + else + { + sbyte1 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + sbyte1 &= ~0x08; + } + else + { + sbyte1 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_RIGHT))//if (Keyboard.IsPressed(Corekey.D)) + { + sbyte2 &= ~0x08; + } + else + { + sbyte2 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P1_LEFT))//if (Keyboard.IsPressed(Corekey.A)) + { + sbyte2 &= ~0x04; + } + else + { + sbyte2 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P1_DOWN))//if (Keyboard.IsPressed(Corekey.S)) + { + sbyte2 &= ~0x02; + } + else + { + sbyte2 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_UP))//if (Keyboard.IsPressed(Corekey.W)) + { + sbyte2 &= ~0x01; + } + else + { + sbyte2 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + sbyte0 &= ~0x01; + } + else + { + sbyte0 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + sbyte0 &= ~0x02; + } + else + { + sbyte0 |= 0x02; + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + sbyte0 &= ~0x04; + } + else + { + sbyte0 |= 0x04; + } + if (Keyboard.IsPressed(MotionKey.P2_RIGHT))//if (Keyboard.IsPressed(Corekey.Right)) + { + sbyte2 &= unchecked((sbyte)~0x80); + } + else + { + sbyte2 |= unchecked((sbyte)0x80); + } + if (Keyboard.IsPressed(MotionKey.P2_LEFT))//if (Keyboard.IsPressed(Corekey.Left)) + { + sbyte2 &= ~0x40; + } + else + { + sbyte2 |= 0x40; + } + if (Keyboard.IsPressed(MotionKey.P2_DOWN)) //if (Keyboard.IsPressed(Corekey.Down)) + { + sbyte2 &= ~0x20; + } + else + { + sbyte2 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.P2_UP))//if (Keyboard.IsPressed(Corekey.Up)) + { + sbyte2 &= ~0x10; + } + else + { + sbyte2 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + sbyte0 &= ~0x08; + } + else + { + sbyte0 |= 0x08; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + sbyte0 &= ~0x10; + } + else + { + sbyte0 |= 0x10; + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + sbyte0 &= ~0x20; + } + else + { + sbyte0 |= 0x20; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_R)) //if (Keyboard.IsPressed(Corekey.R)) + { + sbyte1 &= ~0x01; + } + else + { + sbyte1 |= 0x01; + } + if (Keyboard.IsPressed(MotionKey.UNKNOW_T)) //if (Keyboard.IsPressed(Corekey.T)) + { + sbyte1 &= ~0x02; + } + else + { + sbyte1 |= 0x02; + } + } + public static void record_port() + { + if (sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old || sbyte3 != sbyte3_old || sbyte4 != sbyte4_old || sbyte5 != sbyte5_old) + { + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + sbyte3_old = sbyte3; + sbyte4_old = sbyte4; + sbyte5_old = sbyte5; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbyte3); + Mame.bwRecord.Write(sbyte4); + Mame.bwRecord.Write(sbyte5); + } + } + public static void replay_port() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbyte3_old = Mame.brRecord.ReadSByte(); + sbyte4_old = Mame.brRecord.ReadSByte(); + sbyte5_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + //Mame.mame_pause(true); + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + sbyte3 = sbyte3_old; + sbyte4 = sbyte4_old; + sbyte5 = sbyte5_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + public static void record_port_pbobble() + { + if (dswb != dswb_old || sbyte0 != sbyte0_old || sbyte1 != sbyte1_old || sbyte2 != sbyte2_old || sbyte3 != sbyte3_old || sbyte4 != sbyte4_old || sbyte5 != sbyte5_old) + { + dswb_old = dswb; + sbyte0_old = sbyte0; + sbyte1_old = sbyte1; + sbyte2_old = sbyte2; + sbyte3_old = sbyte3; + sbyte4_old = sbyte4; + sbyte5_old = sbyte5; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(dswb); + Mame.bwRecord.Write(sbyte0); + Mame.bwRecord.Write(sbyte1); + Mame.bwRecord.Write(sbyte2); + Mame.bwRecord.Write(sbyte3); + Mame.bwRecord.Write(sbyte4); + Mame.bwRecord.Write(sbyte5); + } + } + public static void replay_port_pbobble() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + dswb_old = Mame.brRecord.ReadByte(); + sbyte0_old = Mame.brRecord.ReadSByte(); + sbyte1_old = Mame.brRecord.ReadSByte(); + sbyte2_old = Mame.brRecord.ReadSByte(); + sbyte3_old = Mame.brRecord.ReadSByte(); + sbyte4_old = Mame.brRecord.ReadSByte(); + sbyte5_old = Mame.brRecord.ReadSByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + //Mame.mame_pause(true); + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + dswb = dswb_old; + sbyte0 = sbyte0_old; + sbyte1 = sbyte1_old; + sbyte2 = sbyte2_old; + sbyte3 = sbyte3_old; + sbyte4 = sbyte4_old; + sbyte5 = sbyte5_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Input.cs.meta new file mode 100644 index 00000000..5628ee44 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e36b0f22c5b205745aa3060a9f993c3d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Mb87078.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Mb87078.cs new file mode 100644 index 00000000..d051b014 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Mb87078.cs @@ -0,0 +1,109 @@ +namespace MAME.Core +{ + public partial class Taitob + { + public struct MB87078 + { + public int[] gain; /* gain index 0-63,64,65 */ + public int channel_latch; /* current channel */ + public byte[] latch; /* 6bit+3bit 4 data latches */ + public byte reset_comp; + }; + public static MB87078[] c; + public static int[] MB87078_gain_percent = new int[66]{ + 100,94,89,84,79,74,70,66, + 63,59,56,53,50,47,44,42, + 39,37,35,33,31,29,28,26, + 25,23,22,21,19,18,17,16, + 15,14,14,13,12,11,11,10, + 10, 9, 8, 8, 7, 7, 7, 6, + 6, 5, 5, 5, 5, 4, 4, 4, + 3, 3, 3, 3, 3, 2, 2, 2, + 2, 0 + }; + public static int calc_gain_index(int data0, int data1) + { + if ((data1 & 4) == 0) + { + return 65; + } + else + { + if ((data1 & 16) != 0) + { + return 64; + } + else + { + if ((data1 & 8) != 0) + { + return 0; + } + else + { + return (data0 ^ 0x3f); + } + } + } + } + public static void gain_recalc(int which) + { + int i; + for (i = 0; i < 4; i++) + { + int old_index = c[which].gain[i]; + c[which].gain[i] = calc_gain_index(c[which].latch[i], c[which].latch[4 + i]); + if (old_index != c[which].gain[i]) + { + mb87078_gain_changed(i, MB87078_gain_percent[c[which].gain[i]]); + } + } + } + public static void MB87078_start(int which) + { + c = new MB87078[1]; + c[0] = new MB87078(); + c[0].gain = new int[4]; + c[0].latch = new byte[8]; + if (which >= 4) + { + return; + } + MB87078_reset_comp_w(which, 0); + MB87078_reset_comp_w(which, 1); + } + public static void MB87078_reset_comp_w(int which, int level) + { + c[which].reset_comp = (byte)level; + if (level == 0) + { + c[which].latch[0] = 0x3f; + c[which].latch[1] = 0x3f; + c[which].latch[2] = 0x3f; + c[which].latch[3] = 0x3f; + c[which].latch[4] = 0x0 | 0x4; + c[which].latch[5] = 0x1 | 0x4; + c[which].latch[6] = 0x2 | 0x4; + c[which].latch[7] = 0x3 | 0x4; + } + gain_recalc(which); + } + public static void MB87078_data_w(int which, int data, int dsel) + { + if (c[which].reset_comp == 0) + { + return; + } + if (dsel == 0) + { + c[which].latch[0 + c[which].channel_latch] = (byte)(data & 0x3f); + } + else + { + c[which].channel_latch = data & 3; + c[which].latch[4 + c[which].channel_latch] = (byte)(data & 0x1f); + } + gain_recalc(which); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Mb87078.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Mb87078.cs.meta new file mode 100644 index 00000000..92f9fc48 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Mb87078.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e7a5fd193af3b5a40aa9b98303d4aa26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory.cs new file mode 100644 index 00000000..81df7952 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory.cs @@ -0,0 +1,802 @@ +using cpu.z80; + +namespace MAME.Core +{ + public unsafe partial class Taitob + { + public static sbyte sbyte0, sbyte1, sbyte2, sbyte3, sbyte4, sbyte5; + public static sbyte sbyte0_old, sbyte1_old, sbyte2_old, sbyte3_old, sbyte4_old, sbyte5_old; + public static sbyte MReadOpByte_pbobble(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + result = (sbyte)(Memory.mainrom[address]); + } + else if (address >= 0x800000 && address <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x900000 && address <= 0x90ffff) + { + result = (sbyte)Memory.mainram[address - 0x900000]; + } + return result; + } + public static sbyte MReadByte_pbobble(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address <= 0x40ffff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(TC0180VCU_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)TC0180VCU_word_r(offset); + } + } + else if (address >= 0x410000 && address <= 0x41197f) + { + int offset = (address - 0x410000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(taitob_spriteram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)taitob_spriteram[offset]; + } + } + else if (address >= 0x411980 && address <= 0x4137ff) + { + result = (sbyte)mainram2[address - 0x411980]; + } + else if (address >= 0x413800 && address <= 0x413fff) + { + int offset = (address - 0x413800) / 2; + if (address % 2 == 0) + { + result = (sbyte)(taitob_scroll[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)taitob_scroll[offset]; + } + } + else if (address >= 0x418000 && address <= 0x41801f) + { + int offset = (address - 0x418000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(taitob_v_control_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)taitob_v_control_r(offset); + } + } + else if (address >= 0x440000 && address <= 0x47ffff) + { + int offset = (address - 0x440000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(TC0180VCU_framebuffer_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)TC0180VCU_framebuffer_word_r(offset); + } + } + else if (address >= 0x500000 && address <= 0x50000f) + { + int offset = (address - 0x500000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(pbobble_input_bypass_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = 0; + } + } + else if (address >= 0x500024 && address <= 0x500025) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte3; + } + } + else if (address >= 0x500026 && address <= 0x500027) + { + if (address % 2 == 0) + { + result = (sbyte)(eep_latch_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)eep_latch_r(); + } + } + else if (address >= 0x50002e && address <= 0x50002f) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte4; + } + } + else if (address >= 0x700000 && address <= 0x700001) + { + result = 0;//NOP + } + else if (address >= 0x700002 && address <= 0x700003) + { + if (address % 2 == 0) + { + result = (sbyte)(Taitosnd.taitosound_comm16_msb_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Taitosnd.taitosound_comm16_msb_r(); + } + } + else if (address >= 0x800000 && address <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x900000 && address <= 0x90ffff) + { + result = (sbyte)Memory.mainram[address - 0x900000]; + } + return result; + } + public static short MReadOpWord_pbobble(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 1 <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x900000 && address + 1 <= 0x90ffff) + { + result = (short)(Memory.mainram[address - 0x900000] * 0x100 + Memory.mainram[address - 0x900000 + 1]); + } + return result; + } + public static short MReadWord_pbobble(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address + 1 <= 0x40ffff) + { + int offset = (address - 0x400000) / 2; + result = (short)TC0180VCU_word_r(offset); + } + else if (address >= 0x410000 && address + 1 <= 0x41197f) + { + int offset = (address - 0x410000) / 2; + result = (short)taitob_spriteram[offset]; + } + else if (address >= 0x411980 && address + 1 <= 0x4137ff) + { + int offset = address - 0x410000; + result = (short)(mainram2[offset] * 0x100 + mainram2[offset + 1]); + } + else if (address >= 0x413800 && address <= 0x413fff) + { + int offset = (address - 0x413800) / 2; + result = (short)(taitob_scroll[offset]); + } + else if (address >= 0x418000 && address + 1 <= 0x41801f) + { + int offset = (address - 0x418000) / 2; + result = (short)taitob_v_control_r(offset); + } + else if (address >= 0x440000 && address + 1 <= 0x47ffff) + { + int offset = (address - 0x440000) / 2; + result = (short)TC0180VCU_framebuffer_word_r(offset); + } + else if (address >= 0x500000 && address + 1 <= 0x50000f) + { + int offset = (address - 0x500000) / 2; + result = (short)pbobble_input_bypass_r(offset); + } + else if (address >= 0x500024 && address + 1 <= 0x500025) + { + result = (short)sbyte3; + } + else if (address >= 0x500026 && address + 1 <= 0x500027) + { + result = (short)eep_latch_r(); + } + else if (address >= 0x50002e && address + 1 <= 0x50002f) + { + result = (short)sbyte4; + } + else if (address >= 0x700000 && address + 1 <= 0x700001) + { + result = 0;//NOP + } + else if (address >= 0x700002 && address + 1 <= 0x700003) + { + result = (short)Taitosnd.taitosound_comm16_msb_r(); + } + else if (address >= 0x800000 && address + 1 <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x900000 && address + 1 <= 0x90ffff) + { + result = (short)(Memory.mainram[address - 0x900000] * 0x100 + Memory.mainram[address - 0x900000 + 1]); + } + return result; + } + public static int MReadOpLong_pbobble(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x800000 && address + 3 <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x900000 && address + 3 <= 0x90ffff) + { + result = (int)(Memory.mainram[address - 0x900000] * 0x1000000 + Memory.mainram[address - 0x900000 + 1] * 0x10000 + Memory.mainram[address - 0x900000 + 2] * 0x100 + Memory.mainram[address - 0x900000 + 3]); + } + return result; + } + public static int MReadLong_pbobble(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x400000 && address + 1 <= 0x40ffff) + { + int offset = (address - 0x400000) / 2; + result = (int)(TC0180VCU_word_r(offset) * 0x10000 + TC0180VCU_word_r(offset + 1)); + } + else if (address >= 0x410000 && address + 1 <= 0x41197f) + { + int offset = (address - 0x410000) / 2; + result = (int)(taitob_spriteram[offset] * 0x10000 + taitob_spriteram[offset + 1]); + } + else if (address >= 0x411980 && address <= 0x4137ff) + { + int offset = address - 0x411980; + result = (int)(mainram2[offset] * 0x1000000 + mainram2[offset + 1] * 0x10000 + mainram2[offset + 2] * 0x100 + mainram2[offset + 3]); + } + else if (address >= 0x413800 && address <= 0x413fff) + { + int offset = (address - 0x413800) / 2; + result = (int)(taitob_scroll[offset] * 0x10000 + taitob_scroll[offset + 1]); + } + else if (address >= 0x418000 && address + 1 <= 0x41801f) + { + int offset = (address - 0x418000) / 2; + result = (int)(taitob_v_control_r(offset) * 0x10000 + taitob_v_control_r(offset + 1)); + } + else if (address >= 0x440000 && address + 1 <= 0x47ffff) + { + int offset = (address - 0x440000) / 2; + result = (int)(TC0180VCU_framebuffer_word_r(offset) * 0x10000 + TC0180VCU_framebuffer_word_r(offset + 1)); + } + else if (address >= 0x500000 && address + 1 <= 0x50000f) + { + int offset = (address - 0x500000) / 2; + result = (int)(pbobble_input_bypass_r(offset) * 0x10000 + pbobble_input_bypass_r(offset + 1)); + } + else if (address >= 0x800000 && address + 3 <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x900000 && address + 3 <= 0x90ffff) + { + result = (int)(Memory.mainram[address - 0x900000] * 0x1000000 + Memory.mainram[address - 0x900000 + 1] * 0x10000 + Memory.mainram[address - 0x900000 + 2] * 0x100 + Memory.mainram[address - 0x900000 + 3]); + } + return result; + } + public static void MWriteByte_pbobble(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)value; + } + } + else if (address >= 0x400000 && address <= 0x40ffff) + { + int offset = (address - 0x400000) / 2; + if (address % 2 == 0) + { + TC0180VCU_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + TC0180VCU_word_w2(offset, (byte)value); + } + } + else if (address >= 0x410000 && address <= 0x41197f) + { + int offset = (address - 0x410000) / 2; + if (address % 2 == 0) + { + taitob_spriteram[offset] = (ushort)((value << 8) | (taitob_spriteram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + taitob_spriteram[offset] = (ushort)((taitob_spriteram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x411980 && address <= 0x4137ff) + { + int offset = address - 0x411980; + mainram2[offset] = (byte)value; + } + else if (address >= 0x413800 && address <= 0x413fff) + { + int offset = (address - 0x413800) / 2; + if (address % 2 == 0) + { + taitob_scroll[offset] = (ushort)((value << 8) | (taitob_scroll[offset] & 0xff)); + } + else if (address % 2 == 1) + { + taitob_scroll[offset] = (ushort)((taitob_scroll[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x418000 && address <= 0x41801f) + { + int offset = (address - 0x418000) / 2; + if (address % 2 == 0) + { + taitob_v_control_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + taitob_v_control_w2(offset, (byte)value); + } + } + else if (address >= 0x440000 && address <= 0x47ffff) + { + int offset = (address - 0x440000) / 2; + if (address % 2 == 0) + { + TC0180VCU_framebuffer_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + TC0180VCU_framebuffer_word_w2(offset, (byte)value); + } + } + else if (address >= 0x500000 && address <= 0x50000f) + { + int offset = (address - 0x500000) / 2; + TC0640FIO_halfword_byteswap_w1(offset, (byte)value); + } + else if (address >= 0x500026 && address <= 0x500027) + { + if (address % 2 == 0) + { + eeprom_w1((byte)value); + } + else if (address % 2 == 1) + { + eeprom_w2((byte)value); + } + } + else if (address >= 0x500028 && address <= 0x500029) + { + player_34_coin_ctrl_w((ushort)value); + } + else if (address >= 0x600000 && address <= 0x600003) + { + int offset = (address - 0x600000) / 2; + if (address % 2 == 0) + { + gain_control_w1(offset, (byte)value); + } + } + else if (address >= 0x700000 && address <= 0x700001) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_port16_msb_w1((byte)value); + } + } + else if (address >= 0x700002 && address <= 0x700003) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_comm16_msb_w1((byte)value); + } + } + else if (address >= 0x800000 && address <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w2(offset, (byte)value); + } + } + else if (address >= 0x900000 && address <= 0x90ffff) + { + int offset = address - 0x900000; + Memory.mainram[offset] = (byte)value; + } + } + public static void MWriteWord_pbobble(int address, short value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; + } + } + else if (address >= 0x400000 && address + 1 <= 0x40ffff) + { + int offset = (address - 0x400000) / 2; + TC0180VCU_word_w(offset, (ushort)value); + } + else if (address >= 0x410000 && address + 1 <= 0x41197f) + { + int offset = (address - 0x410000) / 2; + taitob_spriteram[offset] = (ushort)value; + } + else if (address >= 0x411980 && address + 1 <= 0x4137ff) + { + int offset = address - 0x411980; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0x413800 && address + 1 <= 0x413fff) + { + int offset = (address - 0x413800) / 2; + taitob_scroll[offset] = (ushort)value; + } + else if (address >= 0x418000 && address + 1 <= 0x41801f) + { + int offset = (address - 0x418000) / 2; + taitob_v_control_w(offset, (ushort)value); + } + else if (address >= 0x440000 && address + 1 <= 0x47ffff) + { + int offset = (address - 0x440000) / 2; + TC0180VCU_framebuffer_word_w(offset, (ushort)value); + } + else if (address >= 0x500000 && address + 1 <= 0x50000f) + { + int offset = (address - 0x500000) / 2; + TC0640FIO_halfword_byteswap_w(offset, (ushort)value); + } + else if (address >= 0x500026 && address + 1 <= 0x500027) + { + eeprom_w((ushort)value); + } + else if (address >= 0x500028 && address + 1 <= 0x500029) + { + player_34_coin_ctrl_w((ushort)value); + } + else if (address >= 0x600000 && address + 1 <= 0x600003) + { + int offset = (address - 0x600000) / 2; + gain_control_w(offset, (ushort)value); + } + else if (address >= 0x700000 && address + 1 <= 0x700001) + { + Taitosnd.taitosound_port16_msb_w((ushort)value); + } + else if (address >= 0x700002 && address + 1 <= 0x700003) + { + Taitosnd.taitosound_comm16_msb_w((ushort)value); + } + else if (address >= 0x800000 && address + 1 <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w(offset, (ushort)value); + } + else if (address >= 0x900000 && address + 1 <= 0x90ffff) + { + int offset = address - 0x900000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + } + public static void MWriteLong_pbobble(int address, int value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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; + } + } + else if (address >= 0x400000 && address + 3 <= 0x40ffff) + { + int offset = (address - 0x400000) / 2; + TC0180VCU_word_w(offset, (ushort)(value >> 16)); + TC0180VCU_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x410000 && address + 3 <= 0x41197f) + { + int offset = (address - 0x410000) / 2; + taitob_spriteram[offset] = (ushort)(value >> 16); + taitob_spriteram[offset + 1] = (ushort)value; + } + else if (address >= 0x411980 && address + 3 <= 0x4137ff) + { + int offset = address - 0x411980; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0x413800 && address + 3 <= 0x413fff) + { + int offset = (address - 0x413800) / 2; + taitob_scroll[offset] = (ushort)(value >> 16); + taitob_scroll[offset + 1] = (ushort)value; + } + else if (address >= 0x418000 && address + 3 <= 0x41801f) + { + int offset = (address - 0x418000) / 2; + taitob_v_control_w(offset, (ushort)(value >> 16)); + taitob_v_control_w(offset + 1, (ushort)value); + } + else if (address >= 0x440000 && address + 3 <= 0x47ffff) + { + int offset = (address - 0x440000) / 2; + TC0180VCU_framebuffer_word_w(offset, (ushort)(value >> 16)); + TC0180VCU_framebuffer_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x500000 && address + 3 <= 0x50000f) + { + int offset = (address - 0x500000) / 2; + TC0640FIO_halfword_byteswap_w(offset, (ushort)(value >> 16)); + TC0640FIO_halfword_byteswap_w(offset + 1, (ushort)value); + } + else if (address >= 0x600000 && address + 3 <= 0x600003) + { + int offset = (address - 0x600000) / 2; + gain_control_w(offset, (ushort)(value >> 16)); + gain_control_w(offset + 1, (ushort)value); + } + else if (address >= 0x800000 && address + 3 <= 0x801fff) + { + int offset = (address - 0x800000) / 2; + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x900000 && address + 3 <= 0x90ffff) + { + int offset = address - 0x900000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + } + public static byte ZReadOp(ushort address) + { + byte result = 0; + if (address <= 0x3fff) + { + result = Memory.audiorom[address & 0x7fff]; + } + else + { + result = 0; + } + return result; + } + public static byte ZReadMemory(ushort address) + { + byte result = 0; + if (address <= 0x3fff) + { + result = Memory.audiorom[address & 0x7fff]; + } + else if (address >= 0x4000 && address <= 0x7fff) + { + result = Memory.audiorom[basebanksnd + (address & 0x3fff)]; + } + else if (address >= 0xc000 && address <= 0xdfff) + { + result = Memory.audioram[address - 0xc000]; + } + else if (address >= 0xe000 && address <= 0xe000) + { + result = YM2610.F2610.ym2610_read(0); + } + else if (address >= 0xe001 && address <= 0xe001) + { + result = YM2610.F2610.ym2610_read(1); + } + else if (address >= 0xe002 && address <= 0xe002) + { + result = YM2610.F2610.ym2610_read(2); + } + else if (address >= 0xe200 && address <= 0xe200) + { + + } + else if (address >= 0xe201 && address <= 0xe201) + { + result = Taitosnd.taitosound_slave_comm_r(); + } + else if (address >= 0xea00 && address <= 0xea00) + { + + } + return result; + } + public static void ZWriteMemory(ushort address, byte value) + { + if (address <= 0x7fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0xc000 && address <= 0xdfff) + { + Memory.audioram[address - 0xc000] = value; + } + else if (address >= 0xe000 && address <= 0xe000) + { + YM2610.F2610.ym2610_write(0, value); + } + else if (address >= 0xe001 && address <= 0xe001) + { + YM2610.F2610.ym2610_write(1, value); + } + else if (address >= 0xe002 && address <= 0xe002) + { + YM2610.F2610.ym2610_write(2, value); + } + else if (address >= 0xe003 && address <= 0xe003) + { + YM2610.F2610.ym2610_write(3, value); + } + else if (address >= 0xe200 && address <= 0xe200) + { + Taitosnd.taitosound_slave_port_w(value); + } + else if (address >= 0xe201 && address <= 0xe201) + { + Taitosnd.taitosound_slave_comm_w(value); + } + else if (address >= 0xe400 && address <= 0xe403) + { + + } + else if (address >= 0xe600 && address <= 0xe600) + { + + } + else if (address >= 0xee00 && address <= 0xee00) + { + + } + else if (address >= 0xf000 && address <= 0xf000) + { + + } + else if (address >= 0xf200 && address <= 0xf200) + { + bankswitch_w(value); + } + } + public static byte ZReadHardware(ushort address) + { + byte result = 0; + return result; + } + public static void ZWriteHardware(ushort address, byte value) + { + + } + public static int ZIRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[0].cpunum, 0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory.cs.meta new file mode 100644 index 00000000..b5a520ae --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a1033e7fdbea84f49a06f229c7cad5c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory2.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory2.cs new file mode 100644 index 00000000..f66f350b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory2.cs @@ -0,0 +1,647 @@ +namespace MAME.Core +{ + public unsafe partial class Taitob + { + public static sbyte MReadOpByte_silentd(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x300000 && address <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x400000 && address <= 0x403fff) + { + result = (sbyte)Memory.mainram[address - 0x400000]; + } + return result; + } + public static sbyte MReadByte_silentd(int address) + { + address &= 0xffffff; + sbyte result = 0; + if (address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + result = (sbyte)Memory.mainrom[address]; + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address <= 0x100001) + { + result = 0; + } + else if (address >= 0x100002 && address <= 0x100003) + { + if (address % 2 == 0) + { + result = (sbyte)(Taitosnd.taitosound_comm16_msb_r() >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Taitosnd.taitosound_comm16_msb_r(); + } + } + else if (address >= 0x200000 && address <= 0x20000f) + { + int offset = (address - 0x200000) / 2; + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = (sbyte)TC0220IOC_halfword_r(offset); + } + } + else if (address >= 0x210000 && address <= 0x210001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte3; + } + } + else if (address >= 0x220000 && address <= 0x220001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte4; + } + } + else if (address >= 0x230000 && address <= 0x230001) + { + if (address % 2 == 0) + { + result = 0; + } + else if (address % 2 == 1) + { + result = sbyte5; + } + } + else if (address >= 0x300000 && address <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(Generic.paletteram16[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)Generic.paletteram16[offset]; + } + } + else if (address >= 0x400000 && address <= 0x403fff) + { + result = (sbyte)Memory.mainram[address - 0x400000]; + } + else if (address >= 0x500000 && address <= 0x50ffff) + { + int offset = (address - 0x500000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(TC0180VCU_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)TC0180VCU_word_r(offset); + } + } + else if (address >= 0x510000 && address <= 0x51197f) + { + int offset = (address - 0x510000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(taitob_spriteram[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)taitob_spriteram[offset]; + } + } + else if (address >= 0x511980 && address <= 0x5137ff) + { + result = (sbyte)mainram2[address - 0x511980]; + } + else if (address >= 0x513800 && address <= 0x513fff) + { + int offset = (address - 0x513800) / 2; + if (address % 2 == 0) + { + result = (sbyte)(taitob_scroll[offset] >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)taitob_scroll[offset]; + } + } + else if (address >= 0x518000 && address <= 0x51801f) + { + int offset = (address - 0x518000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(taitob_v_control_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)taitob_v_control_r(offset); + } + } + else if (address >= 0x540000 && address <= 0x57ffff) + { + int offset = (address - 0x540000) / 2; + if (address % 2 == 0) + { + result = (sbyte)(TC0180VCU_framebuffer_word_r(offset) >> 8); + } + else if (address % 2 == 1) + { + result = (sbyte)TC0180VCU_framebuffer_word_r(offset); + } + } + return result; + } + public static short MReadOpWord_silentd(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x300000 && address + 1 <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x400000 && address + 1 <= 0x403fff) + { + result = (short)(Memory.mainram[address - 0x400000] * 0x100 + Memory.mainram[address - 0x400000 + 1]); + } + return result; + } + public static short MReadWord_silentd(int address) + { + address &= 0xffffff; + short result = 0; + if (address <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); + } + else + { + result = 0; + } + } + else if (address >= 0x100000 && address + 1 <= 0x100001) + { + result = 0; + } + else if (address >= 0x100002 && address + 1 <= 0x100003) + { + result = (short)Taitosnd.taitosound_comm16_msb_r(); + } + else if (address >= 0x200000 && address + 1 <= 0x20000f) + { + int offset = (address - 0x200000) / 2; + result = (short)TC0220IOC_halfword_r(offset); + } + else if (address >= 0x210000 && address + 1 <= 0x210001) + { + result = (short)sbyte3; + } + else if (address >= 0x220000 && address + 1 <= 0x220001) + { + result = (short)sbyte4; + } + else if (address >= 0x230000 && address + 1 <= 0x230001) + { + result = (short)sbyte5; + } + else if (address >= 0x300000 && address + 1 <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + result = (short)Generic.paletteram16[offset]; + } + else if (address >= 0x400000 && address + 1 <= 0x403fff) + { + result = (short)(Memory.mainram[address - 0x400000] * 0x100 + Memory.mainram[address - 0x400000 + 1]); + } + else if (address >= 0x500000 && address + 1 <= 0x50ffff) + { + int offset = (address - 0x500000) / 2; + result = (short)TC0180VCU_word_r(offset); + } + else if (address >= 0x510000 && address + 1 <= 0x51197f) + { + int offset = (address - 0x510000) / 2; + result = (short)taitob_spriteram[offset]; + } + else if (address >= 0x511980 && address + 1 <= 0x5137ff) + { + result = (short)(mainram2[address - 0x511980] * 0x100 + mainram2[address - 0x511980 + 1]); + } + else if (address >= 0x513800 && address + 1 <= 0x513fff) + { + int offset = (address - 0x513800) / 2; + result = (short)taitob_scroll[offset]; + } + else if (address >= 0x518000 && address + 1 <= 0x51801f) + { + int offset = (address - 0x518000) / 2; + result = (short)taitob_v_control_r(offset); + } + else if (address >= 0x540000 && address + 1 <= 0x57ffff) + { + int offset = (address - 0x540000) / 2; + result = (short)TC0180VCU_framebuffer_word_r(offset); + } + return result; + } + public static int MReadOpLong_silentd(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x300000 && address + 3 <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x400000 && address + 3 <= 0x403fff) + { + result = (int)(Memory.mainram[address - 0x400000] * 0x1000000 + Memory.mainram[address - 0x400000 + 1] * 0x10000 + Memory.mainram[address - 0x400000 + 2] * 0x100 + Memory.mainram[address - 0x400000 + 3]); + } + return result; + } + public static int MReadLong_silentd(int address) + { + address &= 0xffffff; + int result = 0; + if (address <= 0x07ffff) + { + 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]); + } + else + { + result = 0; + } + } + else if (address >= 0x200000 && address + 3 <= 0x20000f) + { + int offset = (address - 0x200000) / 2; + result = (int)(TC0220IOC_halfword_r(offset) * 0x10000 + TC0220IOC_halfword_r(offset + 1)); + } + else if (address >= 0x300000 && address + 1 <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + result = (int)(Generic.paletteram16[offset] * 0x10000 + Generic.paletteram16[offset + 1]); + } + else if (address >= 0x400000 && address + 1 <= 0x403fff) + { + result = (int)(Memory.mainram[address - 0x400000] * 0x1000000 + Memory.mainram[address - 0x400000 + 1] * 0x10000 + Memory.mainram[address - 0x400000 + 2] * 0x100 + Memory.mainram[address - 0x400000 + 3]); + } + else if (address >= 0x500000 && address + 1 <= 0x50ffff) + { + int offset = (address - 0x500000) / 2; + result = (int)(TC0180VCU_word_r(offset) * 0x10000 + TC0180VCU_word_r(offset + 1)); + } + else if (address >= 0x510000 && address + 1 <= 0x51197f) + { + int offset = (address - 0x510000) / 2; + result = (int)(taitob_spriteram[offset] * 0x10000 + taitob_spriteram[offset + 1]); + } + else if (address >= 0x511980 && address + 1 <= 0x5137ff) + { + result = (int)(mainram2[address - 0x511980] * 0x1000000 + mainram2[address - 0x511980 + 1] * 0x10000 + mainram2[address - 0x511980 + 2] * 0x100 + mainram2[address - 0x511980 + 3]); + } + else if (address >= 0x513800 && address + 1 <= 0x513fff) + { + int offset = (address - 0x513800) / 2; + result = (int)(taitob_scroll[offset] * 0x10000 + taitob_scroll[offset + 1]); + } + else if (address >= 0x518000 && address + 1 <= 0x51801f) + { + int offset = (address - 0x518000) / 2; + result = (int)(taitob_v_control_r(offset) * 0x10000 + taitob_v_control_r(offset + 1)); + } + else if (address >= 0x540000 && address + 1 <= 0x57ffff) + { + int offset = (address - 0x540000) / 2; + result = (int)(TC0180VCU_framebuffer_word_r(offset) * 0x10000 + TC0180VCU_framebuffer_word_r(offset + 1)); + } + return result; + } + public static void MWriteByte_silentd(int address, sbyte value) + { + address &= 0xffffff; + if (address >= 0x000000 && address <= 0x07ffff) + { + if (address < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)value; + } + } + else if (address >= 0x100000 && address <= 0x100001) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_port16_msb_w1((byte)value); + } + } + else if (address >= 0x100002 && address <= 0x100003) + { + if (address % 2 == 0) + { + Taitosnd.taitosound_comm16_msb_w1((byte)value); + } + } + else if (address >= 0x200000 && address <= 0x20000f) + { + int offset = (address - 0x200000) / 2; + TC0220IOC_halfword_w1(offset, (byte)value); + } + else if (address >= 0x240000 && address <= 0x240001) + { + + } + else if (address >= 0x300000 && address <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + if (address % 2 == 0) + { + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w2(offset, (byte)value); + } + } + else if (address >= 0x400000 && address <= 0x403fff) + { + int offset = address - 0x400000; + Memory.mainram[offset] = (byte)value; + } + else if (address >= 0x500000 && address <= 0x50ffff) + { + int offset = (address - 0x500000) / 2; + if (address % 2 == 0) + { + TC0180VCU_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + TC0180VCU_word_w2(offset, (byte)value); + } + } + else if (address >= 0x510000 && address <= 0x51197f) + { + int offset = (address - 0x510000) / 2; + if (address % 2 == 0) + { + taitob_spriteram[offset] = (ushort)((value << 8) | (taitob_spriteram[offset] & 0xff)); + } + else if (address % 2 == 1) + { + taitob_spriteram[offset] = (ushort)((taitob_spriteram[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x511980 && address <= 0x5137ff) + { + int offset = address - 0x511980; + mainram2[offset] = (byte)value; + } + else if (address >= 0x513800 && address <= 0x513fff) + { + int offset = (address - 0x513800) / 2; + if (address % 2 == 0) + { + taitob_scroll[offset] = (ushort)((value << 8) | (taitob_scroll[offset] & 0xff)); + } + else if (address % 2 == 1) + { + taitob_scroll[offset] = (ushort)((taitob_scroll[offset] & 0xff00) | (byte)value); + } + } + else if (address >= 0x518000 && address <= 0x51801f) + { + int offset = (address - 0x518000) / 2; + if (address % 2 == 0) + { + taitob_v_control_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + taitob_v_control_w2(offset, (byte)value); + } + } + else if (address >= 0x540000 && address <= 0x57ffff) + { + int offset = (address - 0x540000) / 2; + if (address % 2 == 0) + { + TC0180VCU_framebuffer_word_w1(offset, (byte)value); + } + else if (address % 2 == 1) + { + TC0180VCU_framebuffer_word_w2(offset, (byte)value); + } + } + } + public static void MWriteWord_silentd(int address, short value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 1 <= 0x07ffff) + { + if (address + 1 < Memory.mainromLength) + { + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; + } + } + else if (address >= 0x100000 && address + 1 <= 0x100001) + { + Taitosnd.taitosound_port16_msb_w((byte)value); + } + else if (address >= 0x100002 && address + 1 <= 0x100003) + { + Taitosnd.taitosound_comm16_msb_w((ushort)value); + } + else if (address >= 0x200000 && address + 1 <= 0x20000f) + { + int offset = (address - 0x200000) / 2; + TC0220IOC_halfword_w(offset, (ushort)value); + } + else if (address >= 0x240000 && address + 1 <= 0x240001) + { + + } + else if (address >= 0x300000 && address + 1 <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w(offset, (ushort)value); + } + else if (address >= 0x400000 && address + 1 <= 0x403fff) + { + int offset = address - 0x400000; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; + } + else if (address >= 0x500000 && address + 1 <= 0x50ffff) + { + int offset = (address - 0x500000) / 2; + TC0180VCU_word_w(offset, (ushort)value); + } + else if (address >= 0x510000 && address + 1 <= 0x51197f) + { + int offset = (address - 0x510000) / 2; + taitob_spriteram[offset] = (ushort)value; + } + else if (address >= 0x511980 && address + 1 <= 0x5137ff) + { + int offset = address - 0x511980; + mainram2[offset] = (byte)(value >> 8); + mainram2[offset + 1] = (byte)value; + } + else if (address >= 0x513800 && address + 1 <= 0x513fff) + { + int offset = (address - 0x513800) / 2; + taitob_scroll[offset] = (ushort)value; + } + else if (address >= 0x518000 && address + 1 <= 0x51801f) + { + int offset = (address - 0x518000) / 2; + taitob_v_control_w(offset, (ushort)value); + } + else if (address >= 0x540000 && address + 1 <= 0x57ffff) + { + int offset = (address - 0x540000) / 2; + TC0180VCU_framebuffer_word_w(offset, (ushort)value); + } + } + public static void MWriteLong_silentd(int address, int value) + { + address &= 0xffffff; + if (address >= 0x000000 && address + 3 <= 0x07ffff) + { + 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; + } + } + else if (address >= 0x200000 && address + 3 <= 0x20000f) + { + int offset = (address - 0x200000) / 2; + TC0220IOC_halfword_w(offset, (ushort)(value >> 16)); + TC0220IOC_halfword_w(offset + 1, (ushort)value); + } + else if (address >= 0x300000 && address + 3 <= 0x301fff) + { + int offset = (address - 0x300000) / 2; + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w(offset, (ushort)(value >> 16)); + Generic.paletteram16_RRRRGGGGBBBBRGBx_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x400000 && address + 3 <= 0x403fff) + { + int offset = address - 0x400000; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; + } + else if (address >= 0x500000 && address + 3 <= 0x50ffff) + { + int offset = (address - 0x500000) / 2; + TC0180VCU_word_w(offset, (ushort)(value >> 16)); + TC0180VCU_word_w(offset + 1, (ushort)value); + } + else if (address >= 0x510000 && address + 3 <= 0x51197f) + { + int offset = (address - 0x510000) / 2; + taitob_spriteram[offset] = (ushort)(value >> 16); + taitob_spriteram[offset + 1] = (ushort)value; + } + else if (address >= 0x511980 && address + 3 <= 0x5137ff) + { + int offset = address - 0x511980; + mainram2[offset] = (byte)(value >> 24); + mainram2[offset + 1] = (byte)(value >> 16); + mainram2[offset + 2] = (byte)(value >> 8); + mainram2[offset + 3] = (byte)value; + } + else if (address >= 0x513800 && address + 3 <= 0x513fff) + { + int offset = (address - 0x513800) / 2; + taitob_scroll[offset] = (ushort)(value >> 16); + taitob_scroll[offset + 1] = (ushort)value; + } + else if (address >= 0x518000 && address + 3 <= 0x51801f) + { + int offset = (address - 0x518000) / 2; + taitob_v_control_w(offset, (ushort)(value >> 16)); + taitob_v_control_w(offset + 1, (ushort)value); + } + else if (address >= 0x540000 && address + 3 <= 0x57ffff) + { + int offset = (address - 0x540000) / 2; + TC0180VCU_framebuffer_word_w(offset, (ushort)(value >> 16)); + TC0180VCU_framebuffer_word_w(offset + 1, (ushort)value); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory2.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory2.cs.meta new file mode 100644 index 00000000..ef8def6b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Memory2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41e17356371982441b0ff4bd966f408b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/State.cs new file mode 100644 index 00000000..6b8618f4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/State.cs @@ -0,0 +1,187 @@ +using cpu.m68000; +using cpu.z80; +using System; +using System.IO; + +namespace MAME.Core +{ + public unsafe partial class Taitob + { + public static void SaveStateBinary(BinaryWriter writer) + { + //pixel_scroll + int i; + writer.Write(dswa); + writer.Write(dswb); + writer.Write(basebanksnd); + writer.Write(eep_latch); + writer.Write(coin_word); + for (i = 0; i < 0x1000; i++) + { + writer.Write(Generic.paletteram16[i]); + } + for (i = 0; i < 0x400; i++) + { + writer.Write(taitob_scroll[i]); + } + for (i = 0; i < 0x8000; i++) + { + writer.Write(TC0180VCU_ram[i]); + } + for (i = 0; i < 0x10; i++) + { + writer.Write(TC0180VCU_ctrl[i]); + } + writer.Write(TC0220IOC_regs, 0, 8); + writer.Write(TC0220IOC_port); + writer.Write(TC0640FIO_regs, 0, 8); + for (i = 0; i < 0xcc0; i++) + { + writer.Write(taitob_spriteram[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(bg_rambank[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(fg_rambank[i]); + } + writer.Write(tx_rambank); + writer.Write(video_control); + for (i = 0; i < 0x1000; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x10000); + writer.Write(mainram2, 0, 0x1e80); + MC68000.m1.SaveStateBinary(writer); + writer.Write(Memory.audioram, 0, 0x2000); + Z80A.zz1[0].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + AY8910.AA8910[0].SaveStateBinary(writer); + YM2610.F2610.SaveStateBinary(writer); + for (i = 0; i < 2; i++) + { + writer.Write(Sound.latched_value[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(Sound.utempdata[i]); + } + writer.Write(AY8910.AA8910[0].stream.sample_rate); + writer.Write(AY8910.AA8910[0].stream.new_sample_rate); + writer.Write(AY8910.AA8910[0].stream.gain); + writer.Write(AY8910.AA8910[0].stream.output_sampindex); + writer.Write(AY8910.AA8910[0].stream.output_base_sampindex); + writer.Write(Sound.ym2610stream.output_sampindex); + writer.Write(Sound.ym2610stream.output_base_sampindex); + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + for (i = 0; i < 4; i++) + { + writer.Write(c[0].gain[i]); + } + writer.Write(c[0].channel_latch); + for (i = 0; i < 8; i++) + { + writer.Write(c[0].latch[i]); + } + writer.Write(c[0].reset_comp); + Eeprom.SaveStateBinary(writer); + Taitosnd.SaveStateBinary(writer); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + dswa = reader.ReadByte(); + dswb = reader.ReadByte(); + basebanksnd = reader.ReadInt32(); + eep_latch = reader.ReadUInt16(); + coin_word = reader.ReadUInt16(); + for (i = 0; i < 0x1000; i++) + { + Generic.paletteram16[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x400; i++) + { + taitob_scroll[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x8000; i++) + { + TC0180VCU_ram[i] = reader.ReadUInt16(); + } + for (i = 0; i < 0x10; i++) + { + TC0180VCU_ctrl[i] = reader.ReadUInt16(); + } + TC0220IOC_regs = reader.ReadBytes(8); + TC0220IOC_port = reader.ReadByte(); + TC0640FIO_regs = reader.ReadBytes(8); + for (i = 0; i < 0xcc0; i++) + { + taitob_spriteram[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + bg_rambank[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + fg_rambank[i] = reader.ReadUInt16(); + } + tx_rambank = reader.ReadUInt16(); + video_control = reader.ReadByte(); + for (i = 0; i < 0x1000; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x10000)); + mainram2_set = reader.ReadBytes(0x1e80); + MC68000.m1.LoadStateBinary(reader); + Memory.Set_audioram(reader.ReadBytes(0x2000)); + Z80A.zz1[0].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + AY8910.AA8910[0].LoadStateBinary(reader); + YM2610.F2610.LoadStateBinary(reader); + for (i = 0; i < 2; i++) + { + Sound.latched_value[i] = reader.ReadUInt16(); + } + for (i = 0; i < 2; i++) + { + Sound.utempdata[i] = reader.ReadUInt16(); + } + AY8910.AA8910[0].stream.sample_rate = reader.ReadInt32(); + AY8910.AA8910[0].stream.new_sample_rate = reader.ReadInt32(); + AY8910.AA8910[0].stream.gain = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[0].stream.output_base_sampindex = reader.ReadInt32(); + Sound.ym2610stream.output_sampindex = reader.ReadInt32(); + Sound.ym2610stream.output_base_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + for (i = 0; i < 4; i++) + { + c[0].gain[i] = reader.ReadInt32(); + } + c[0].channel_latch = reader.ReadInt32(); + c[0].latch = reader.ReadBytes(8); + c[0].reset_comp = reader.ReadByte(); + Eeprom.LoadStateBinary(reader); + Taitosnd.LoadStateBinary(reader); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/State.cs.meta new file mode 100644 index 00000000..5462d7f8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae0bd70ca9d3e0e42b7166dbca33187f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Taitob.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Taitob.cs new file mode 100644 index 00000000..50587bb6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Taitob.cs @@ -0,0 +1,381 @@ +using System; +using System.Runtime.InteropServices; +using static MAME.Core.EmuTimer; + +namespace MAME.Core +{ + public unsafe partial class Taitob + { + //public static byte[] /*gfxrom,*/ /*gfx0rom,*/ /*gfx1rom,*/ mainram2, mainram3; + + #region //指针化 gfxrom + static byte[] gfxrom_src; + static GCHandle gfxrom_handle; + public static byte* gfxrom; + public static int gfxromLength; + public static bool gfxrom_IsNull => gfxrom == null; + public static byte[] gfxrom_set + { + set + { + gfxrom_handle.ReleaseGCHandle(); + gfxrom_src = value; + gfxromLength = value.Length; + gfxrom_src.GetObjectPtr(ref gfxrom_handle, ref gfxrom); + } + } + #endregion + + #region //指针化 gfx0rom + static byte[] gfx0rom_src; + static GCHandle gfx0rom_handle; + public static byte* gfx0rom; + public static int gfx0romLength; + public static bool gfx0rom_IsNull => gfx0rom == null; + public static byte[] gfx0rom_set + { + set + { + gfx0rom_handle.ReleaseGCHandle(); + gfx0rom_src = value; + gfx0romLength = value.Length; + gfx0rom_src.GetObjectPtr(ref gfx0rom_handle, ref gfx0rom); + } + } + #endregion + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 mainram2 + static byte[] mainram2_src; + static GCHandle mainram2_handle; + public static byte* mainram2; + public static int mainram2Length; + public static bool mainram2_IsNull => mainram2 == null; + public static byte[] mainram2_set + { + set + { + mainram2_handle.ReleaseGCHandle(); + mainram2_src = value; + mainram2Length = value.Length; + mainram2_src.GetObjectPtr(ref mainram2_handle, ref mainram2); + } + } + #endregion + + #region //指针化 mainram3 + static byte[] mainram3_src; + static GCHandle mainram3_handle; + public static byte* mainram3; + public static int mainram3Length; + public static bool mainram3_IsNull => mainram3 == null; + public static byte[] mainram3_set + { + set + { + mainram3_handle.ReleaseGCHandle(); + mainram3_src = value; + mainram3Length = value.Length; + mainram3_src.GetObjectPtr(ref mainram3_handle, ref mainram3); + } + } + #endregion + + + public static ushort eep_latch; + public static ushort coin_word; + public static int basebanksnd; + public static byte dswa, dswb, dswb_old; + public static void TaitobInit() + { + int i, n; + Generic.paletteram16_set = new ushort[0x1000]; + TC0180VCU_ram = new ushort[0x8000]; + TC0180VCU_ctrl = new ushort[0x10]; + TC0220IOC_regs = new byte[8]; + TC0220IOC_port = 0; + TC0640FIO_regs = new byte[8]; + taitob_scroll = new ushort[0x400]; + Memory.Set_mainram(new byte[0x10000]); + mainram2_set = new byte[0x1e80]; + mainram3_set = new byte[0x2000]; + Memory.Set_audioram(new byte[0x2000]); + bg_rambank = new ushort[2]; + fg_rambank = new ushort[2]; + pixel_scroll = new ushort[2]; + taitob_spriteram = new ushort[0xcc0]; + TC0640FIO_regs = new byte[8]; + Machine.bRom = true; + Taitosnd.taitosnd_start(); + basebanksnd = 0x10000; + eep_latch = 0; + video_control = 0; + coin_word = 0; + for (i = 0; i < 0x10; i++) + { + TC0180VCU_ctrl[i] = 0; + } + Machine.bRom = true; + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfxrom_set = Machine.GetRom("gfx1.rom"); + n = gfxromLength; + gfx0rom_set = new byte[n * 2]; + gfx1rom_set = new byte[n * 2]; + for (i = 0; i < n; i++) + { + gfx1rom[i * 2] = (byte)(gfxrom[i] >> 4); + gfx1rom[i * 2 + 1] = (byte)(gfxrom[i] & 0x0f); + } + for (i = 0; i < n; i++) + { + gfx0rom[((i / 0x10) % 8 + (i / 0x80 * 0x10) + ((i / 8) % 2) * 8) * 8 + (i % 8)] = gfx1rom[i]; + } + FM.ymsndrom = Machine.GetRom("ymsnd.rom"); + YMDeltat.ymsnddeltatrom = Machine.GetRom("ymsnddeltat.rom"); + if (Memory.mainrom_IsNull || gfxrom == null || Memory.audiorom_IsNull || FM.ymsndrom == null) + { + Machine.bRom = false; + } + if (Machine.bRom) + { + switch (Machine.sName) + { + case "pbobble": + dswa = 0xff; + dswb = 0xff; + break; + case "silentd": + case "silentdj": + case "silentdu": + dswa = 0xff; + dswb = 0xbf; + break; + } + } + } + public static void irqhandler(int irq) + { + Cpuint.cpunum_set_input_line(1, 0, irq != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + public static void bankswitch_w(byte data) + { + basebanksnd = 0x10000 + 0x4000 * ((data - 1) & 3); + } + public static void rsaga2_interrupt2() + { + Cpuint.cpunum_set_input_line(0, 2, LineState.HOLD_LINE); + } + public static void rastansaga2_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_rsaga2_interrupt2, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + public static void crimec_interrupt3() + { + Cpuint.cpunum_set_input_line(0, 3, LineState.HOLD_LINE); + } + public static void crimec_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_crimec_interrupt3, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + } + public static void hitice_interrupt6() + { + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + public static void hitice_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_hitice_interrupt6, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + public static void rambo3_interrupt1() + { + Cpuint.cpunum_set_input_line(0, 1, LineState.HOLD_LINE); + } + public static void rambo3_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_rambo3_interrupt1, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + public static void pbobble_interrupt5() + { + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + } + public static void pbobble_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_pbobble_interrupt5, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 3, LineState.HOLD_LINE); + } + public static void viofight_interrupt1() + { + Cpuint.cpunum_set_input_line(0, 1, LineState.HOLD_LINE); + } + public static void viofight_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_viofight_interrupt1, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + public static void masterw_interrupt4() + { + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + public static void masterw_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_masterw_interrupt4, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + } + public static void silentd_interrupt4() + { + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + public static void silentd_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_silentd_interrupt4, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + public static void selfeena_interrupt4() + { + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + public static void selfeena_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_selfeena_interrupt4, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); + } + public static void sbm_interrupt5() + { + Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); + } + public static void sbm_interrupt() + { + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_sbm_interrupt5, true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(10000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); + } + public static void mb87078_gain_changed(int channel, int percent) + { + if (channel == 1) + { + AY8910.AA8910[0].stream.gain = (int)(0x100 * (percent / 100.0)); + //sound_type type = Machine->config->sound[0].type; + //sndti_set_output_gain(type, 0, 0, percent / 100.0); + //sndti_set_output_gain(type, 1, 0, percent / 100.0); + //sndti_set_output_gain(type, 2, 0, percent / 100.0); + } + } + public static void machine_reset_mb87078() + { + MB87078_start(0); + } + public static void gain_control_w1(int offset, byte data) + { + if (offset == 0) + { + MB87078_data_w(0, data, 0); + } + else + { + MB87078_data_w(0, data, 1); + } + } + public static void gain_control_w(int offset, ushort data) + { + if (offset == 0) + { + MB87078_data_w(0, data >> 8, 0); + } + else + { + MB87078_data_w(0, data >> 8, 1); + } + } + public static void nvram_handler_load_taitob() + { + + } + public static void nvram_handler_save_taitob() + { + + } + public static ushort eeprom_r() + { + ushort res; + res = (ushort)(Eeprom.eeprom_read_bit() & 0x01); + res |= (ushort)(dswb & 0xfe); + return res; + } + public static ushort eep_latch_r() + { + return eep_latch; + } + public static void eeprom_w1(byte data) + { + eep_latch = (ushort)((data << 8) | (eep_latch & 0xff)); + Eeprom.eeprom_write_bit(data & 0x04); + Eeprom.eeprom_set_clock_line(((data & 0x08) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + Eeprom.eeprom_set_cs_line(((data & 0x10) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + } + public static void eeprom_w2(byte data) + { + eep_latch = (ushort)((eep_latch & 0xff00) | data); + } + public static void eeprom_w(ushort data) + { + eep_latch = data; + data >>= 8; + Eeprom.eeprom_write_bit(data & 0x04); + Eeprom.eeprom_set_clock_line(((data & 0x08) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + Eeprom.eeprom_set_cs_line(((data & 0x10) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE); + } + public static void player_34_coin_ctrl_w(ushort data) + { + coin_word = data; + //coin_lockout_w(2, ~data & 0x0100); + //coin_lockout_w(3, ~data & 0x0200); + //coin_counter_w(2, data & 0x0400); + //coin_counter_w(3, data & 0x0800); + } + public static ushort pbobble_input_bypass_r(int offset) + { + ushort result = 0; + switch (offset) + { + case 0x01: + result = (ushort)(eeprom_r() << 8); + break; + default: + result = (ushort)(TC0640FIO_r(offset) << 8); + break; + } + return result; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Taitob.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Taitob.cs.meta new file mode 100644 index 00000000..4e55c454 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Taitob.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f9195afa36e39448bc2e11246af039c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Tilemap.cs new file mode 100644 index 00000000..42fbdfe7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Tilemap.cs @@ -0,0 +1,336 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Taitob + { + public static Tmap bg_tilemap, fg_tilemap, tx_tilemap; + public static void tilemap_init() + { + int i; + framebuffer = new ushort[2][]; + for (i = 0; i < 2; i++) + { + framebuffer[i] = new ushort[0x200 * 0x100]; + } + bg_tilemap = new Tmap(); + bg_tilemap.cols = 64; + bg_tilemap.rows = 64; + bg_tilemap.tilewidth = 16; + bg_tilemap.tileheight = 16; + bg_tilemap.width = 0x400; + bg_tilemap.height = 0x400; + bg_tilemap.enable = true; + bg_tilemap.all_tiles_dirty = true; + bg_tilemap.total_elements = gfx1romLength / 0x100; + bg_tilemap.pixmap = new ushort[0x400 * 0x400]; + bg_tilemap.flagsmap = new byte[0x400, 0x400]; + bg_tilemap.tileflags = new byte[64, 64]; + bg_tilemap.pen_data_set = new byte[0x100]; + bg_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 16; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x10; + } + bg_tilemap.scrollrows = 1; + bg_tilemap.scrollcols = 1; + bg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap.tilemap_draw_instance3 = bg_tilemap.tilemap_draw_instanceTaitob; + bg_tilemap.tile_update3 = bg_tilemap.tile_updateTaitobbg; + + fg_tilemap = new Tmap(); + fg_tilemap.cols = 64; + fg_tilemap.rows = 64; + fg_tilemap.tilewidth = 16; + fg_tilemap.tileheight = 16; + fg_tilemap.width = 0x400; + fg_tilemap.height = 0x400; + fg_tilemap.enable = true; + fg_tilemap.all_tiles_dirty = true; + fg_tilemap.total_elements = gfx1romLength / 0x100; + fg_tilemap.pixmap = new ushort[0x400 * 0x400]; + fg_tilemap.flagsmap = new byte[0x400, 0x400]; + fg_tilemap.tileflags = new byte[64, 64]; + fg_tilemap.pen_data_set = new byte[0x100]; + fg_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 1; i < 16; i++) + { + fg_tilemap.pen_to_flags[0, i] = 0x10; + } + fg_tilemap.pen_to_flags[0, 0] = 0; + fg_tilemap.scrollrows = 1; + fg_tilemap.scrollcols = 1; + fg_tilemap.rowscroll = new int[fg_tilemap.scrollrows]; + fg_tilemap.colscroll = new int[fg_tilemap.scrollcols]; + fg_tilemap.tilemap_draw_instance3 = fg_tilemap.tilemap_draw_instanceTaitob; + fg_tilemap.tile_update3 = fg_tilemap.tile_updateTaitobfg; + + + tx_tilemap = new Tmap(); + tx_tilemap.cols = 64; + tx_tilemap.rows = 32; + tx_tilemap.tilewidth = 8; + tx_tilemap.tileheight = 8; + tx_tilemap.width = 0x200; + tx_tilemap.height = 0x100; + tx_tilemap.enable = true; + tx_tilemap.all_tiles_dirty = true; + tx_tilemap.total_elements = gfx1romLength / 0x40; + tx_tilemap.pixmap = new ushort[0x100 * 0x200]; + tx_tilemap.flagsmap = new byte[0x100, 0x200]; + tx_tilemap.tileflags = new byte[32, 64]; + tx_tilemap.pen_data_set = new byte[0x40]; + tx_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 1; i < 16; i++) + { + tx_tilemap.pen_to_flags[0, i] = 0x10; + } + tx_tilemap.pen_to_flags[0, 0] = 0; + tx_tilemap.scrollrows = 1; + tx_tilemap.scrollcols = 1; + tx_tilemap.rowscroll = new int[tx_tilemap.scrollrows]; + tx_tilemap.colscroll = new int[tx_tilemap.scrollcols]; + tx_tilemap.tilemap_draw_instance3 = tx_tilemap.tilemap_draw_instanceTaitob; + tx_tilemap.tile_update3 = tx_tilemap.tile_updateTaitobtx; + } + } + public unsafe partial class Tmap + { + public void tilemap_draw_instanceTaitob(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + continue; + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x200 + xpos + x_start, x_end - x_start); + if (priority != 0) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x200 + i] = pixmap[offsety2 * width + i - xpos]; + Tilemap.priority_bitmap[offsety2 + ypos, i] = (byte)(Tilemap.priority_bitmap[offsety2 + ypos, i] | priority); + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + break; + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + public void tile_updateTaitobbg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int tile, code, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + tile = Taitob.TC0180VCU_ram[tile_index + Taitob.bg_rambank[0]]; + code = tile % total_elements; + color = Taitob.TC0180VCU_ram[tile_index + Taitob.bg_rambank[1]]; + pen_data_offset = code * 0x100; + palette_base = 0x10 * (Taitob.b_bg_color_base + (color & 0x3f)); + group = 0; + flags = (((color & 0x00c0) >> 6) & 0x03) ^ (attributes & 0x03); + tileflags[row, col] = tile_drawTaitob(Taitob.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateTaitobfg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int tile, code, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + tile = Taitob.TC0180VCU_ram[tile_index + Taitob.fg_rambank[0]]; + code = tile % total_elements; + color = Taitob.TC0180VCU_ram[tile_index + Taitob.fg_rambank[1]]; + pen_data_offset = code * 0x100; + palette_base = 0x10 * (Taitob.b_fg_color_base + (color & 0x3f)); + group = 0; + flags = (((color & 0x00c0) >> 6) & 0x03) ^ (attributes & 0x03); + tileflags[row, col] = tile_drawTaitob(Taitob.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updateTaitobtx(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int tile, code, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + tile = Taitob.TC0180VCU_ram[tile_index + Taitob.tx_rambank]; + code = ((tile & 0x07ff) | ((Taitob.TC0180VCU_ctrl[4 + ((tile & 0x800) >> 11)] >> 8) << 11)) % total_elements; + color = Taitob.b_tx_color_base + ((tile >> 12) & 0x0f); + pen_data_offset = code * 0x40; + palette_base = 0x10 * color; + group = 0; + flags = attributes & 0x03; + tileflags[row, col] = tile_drawTaitobtx(Taitob.gfx0rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public byte tile_drawTaitob(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x100); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public byte tile_drawTaitobtx(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Tilemap.cs.meta new file mode 100644 index 00000000..6281720b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f496fab72ff7044ea0b7d56436b836e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Video.cs new file mode 100644 index 00000000..5daf4182 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Video.cs @@ -0,0 +1,595 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Taitob + { + public static ushort[][] framebuffer; + public static ushort[] taitob_scroll, TC0180VCU_ram, taitob_spriteram, taitob_pixelram; + public static ushort[] bg_rambank, fg_rambank, pixel_scroll, TC0180VCU_ctrl; + public static ushort tx_rambank; + public static byte framebuffer_page, video_control; + public static int b_bg_color_base = 0, b_fg_color_base = 0, b_sp_color_base = 0, b_tx_color_base = 0; + public static byte[] TC0220IOC_regs, TC0640FIO_regs; + public static byte TC0220IOC_port; + public static RECT cliprect; + public static ushort[] uuB0000; + public static void taitob_video_control(byte data) + { + video_control = data; + if ((video_control & 0x80) != 0) + { + framebuffer_page = (byte)((~video_control & 0x40) >> 6); + } + //tilemap_set_flip(ALL_TILEMAPS, (video_control & 0x10) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0 ); + } + + public static ushort TC0180VCU_word_r(int offset) + { + return TC0180VCU_ram[offset]; + } + public static void TC0180VCU_word_w1(int offset, byte data) + { + int row, col; + TC0180VCU_ram[offset] = (ushort)((data << 8) | (byte)TC0180VCU_ram[offset]); + if ((offset & 0x7000) == fg_rambank[0] || (offset & 0x7000) == fg_rambank[1]) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + } + if ((offset & 0x7000) == bg_rambank[0] || (offset & 0x7000) == bg_rambank[1]) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + if ((offset & 0x7800) == tx_rambank) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + tx_tilemap.tilemap_mark_tile_dirty(row, col); + } + } + public static void TC0180VCU_word_w2(int offset, byte data) + { + int row, col; + TC0180VCU_ram[offset] = (ushort)((TC0180VCU_ram[offset] & 0xff00) | (byte)data); + if ((offset & 0x7000) == fg_rambank[0] || (offset & 0x7000) == fg_rambank[1]) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + //tilemap_mark_tile_dirty(fg_tilemap, offset & 0x0fff); + } + if ((offset & 0x7000) == bg_rambank[0] || (offset & 0x7000) == bg_rambank[1]) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + //tilemap_mark_tile_dirty(bg_tilemap, offset2 & 0x0fff); + } + if ((offset & 0x7800) == tx_rambank) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + tx_tilemap.tilemap_mark_tile_dirty(row, col); + //tilemap_mark_tile_dirty(tx_tilemap, offset2 & 0x7ff); + } + } + public static void TC0180VCU_word_w(int offset, ushort data) + { + int row, col; + TC0180VCU_ram[offset] = data; + if ((offset & 0x7000) == fg_rambank[0] || (offset & 0x7000) == fg_rambank[1]) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + } + if ((offset & 0x7000) == bg_rambank[0] || (offset & 0x7000) == bg_rambank[1]) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + if ((offset & 0x7800) == tx_rambank) + { + row = (offset & 0x0fff) / 64; + col = (offset & 0x0fff) % 64; + tx_tilemap.tilemap_mark_tile_dirty(row, col); + } + } + public static void video_start_taitob_core() + { + int i; + uuB0000 = new ushort[0x200 * 0x100]; + for (i = 0; i < 0x20000; i++) + { + uuB0000[i] = 0x0; + } + cliprect = new RECT(); + cliprect.min_x = 0; + cliprect.max_x = 319; + cliprect.min_y = 16; + cliprect.max_y = 239; + //framebuffer[0] = auto_bitmap_alloc(512, 256, video_screen_get_format(machine->primary_screen)); + //framebuffer[1] = auto_bitmap_alloc(512, 256, video_screen_get_format(machine->primary_screen)); + //pixel_bitmap = NULL; /* only hitice needs this */ + + //tilemap_set_transparent_pen(fg_tilemap, 0); + //tilemap_set_transparent_pen(tx_tilemap, 0); + bg_tilemap.tilemap_set_scrolldx(0, 24 * 8); + fg_tilemap.tilemap_set_scrolldx(0, 24 * 8); + tx_tilemap.tilemap_set_scrolldx(0, 24 * 8); + } + public static void video_start_taitob_color_order1() + { + b_bg_color_base = 0x00; + b_fg_color_base = 0x40; + b_sp_color_base = 0x80 * 16; + b_tx_color_base = 0xc0; + video_start_taitob_core(); + } + public static void video_start_taitob_color_order2() + { + b_bg_color_base = 0x30; + b_fg_color_base = 0x20; + b_sp_color_base = 0x10 * 16; + b_tx_color_base = 0x00; + video_start_taitob_core(); + } + public static ushort TC0180VCU_framebuffer_word_r(int offset) + { + int sy = offset >> 8; + int sx = 2 * (offset & 0xff); + return framebuffer[sy >> 8][(sy & 0xff) + sx]; + } + public static void TC0180VCU_framebuffer_word_w1(int offset, byte data) + { + int sy = offset >> 8; + int sx = 2 * (offset & 0xff); + framebuffer[sy >> 8][(sy & 0xff) * 0x200 + sx] = (ushort)((ushort)(data << 8) | (framebuffer[sy >> 8][(sy & 0xff) * 0x200 + sx] & 0xff)); + } + public static void TC0180VCU_framebuffer_word_w2(int offset, byte data) + { + int sy = offset >> 8; + int sx = 2 * (offset & 0xff); + framebuffer[sy >> 8][(sy & 0xff) * 0x200 + sx] = (ushort)((framebuffer[sy >> 8][(sy & 0xff) * 0x200 + sx] & 0xff00) | data); + } + public static void TC0180VCU_framebuffer_word_w(int offset, ushort data) + { + int sy = offset >> 8; + int sx = 2 * (offset & 0xff); + framebuffer[sy >> 8][(sy & 0xff) * 0x200 + sx] = data; + } + public static byte TC0220IOC_r(int offset) + { + byte result = 0; + switch (offset) + { + case 0x00: /* IN00-07 (DSA) */ + result = dswa; + break; + case 0x01: /* IN08-15 (DSB) */ + result = dswb; + break; + case 0x02: /* IN16-23 (1P) */ + result = (byte)sbyte0; + break; + case 0x03: /* IN24-31 (2P) */ + result = (byte)sbyte1; + break; + case 0x04: /* coin counters and lockout */ + result = TC0220IOC_regs[4]; + break; + case 0x07: /* INB0-7 (coin) */ + result = (byte)sbyte2; + break; + default: + result = 0xff; + break; + } + return result; + } + public static void TC0220IOC_w(int offset, byte data) + { + TC0220IOC_regs[offset] = data; + switch (offset) + { + case 0x00: + Watchdog.watchdog_reset(); + break; + + case 0x04: + //coin_lockout_w(0,~data & 0x01); + //coin_lockout_w(1,~data & 0x02); + //coin_counter_w(0,data & 0x04); + //coin_counter_w(1,data & 0x08); + break; + default: + break; + } + } + public static ushort TC0220IOC_halfword_r(int offset) + { + return TC0220IOC_r(offset); + } + public static void TC0220IOC_halfword_w1(int offset, byte data) + { + TC0220IOC_w(offset, data); + } + public static void TC0220IOC_halfword_w(int offset, ushort data) + { + TC0220IOC_w(offset, (byte)data); + } + public static ushort taitob_v_control_r(int offset) + { + return TC0180VCU_ctrl[offset]; + } + public static void taitob_v_control_w1(int offset, byte data) + { + ushort oldword = TC0180VCU_ctrl[offset]; + TC0180VCU_ctrl[offset] = (ushort)((data << 8) | (TC0180VCU_ctrl[offset] & 0xff)); + switch (offset) + { + case 0: + if (oldword != TC0180VCU_ctrl[offset]) + { + fg_tilemap.all_tiles_dirty = true; + fg_rambank[0] = (ushort)(((TC0180VCU_ctrl[offset] >> 8) & 0x0f) << 12); + fg_rambank[1] = (ushort)(((TC0180VCU_ctrl[offset] >> 12) & 0x0f) << 12); + } + break; + case 1: + if (oldword != TC0180VCU_ctrl[offset]) + { + bg_tilemap.all_tiles_dirty = true; + bg_rambank[0] = (ushort)(((TC0180VCU_ctrl[offset] >> 8) & 0x0f) << 12); + bg_rambank[1] = (ushort)(((TC0180VCU_ctrl[offset] >> 12) & 0x0f) << 12); + } + break; + case 4: + case 5: + if (oldword != TC0180VCU_ctrl[offset]) + { + tx_tilemap.all_tiles_dirty = true; + } + break; + case 6: + if (oldword != TC0180VCU_ctrl[offset]) + { + tx_tilemap.all_tiles_dirty = true; + tx_rambank = (ushort)(((TC0180VCU_ctrl[offset] >> 8) & 0x0f) << 11); + } + break; + case 7: + taitob_video_control((byte)((TC0180VCU_ctrl[offset] >> 8) & 0xff)); + break; + default: + break; + } + } + public static void taitob_v_control_w2(int offset, byte data) + { + TC0180VCU_ctrl[offset] = (ushort)((TC0180VCU_ctrl[offset] & 0xff00) | data); + } + public static void taitob_v_control_w(int offset, ushort data) + { + ushort oldword = TC0180VCU_ctrl[offset]; + TC0180VCU_ctrl[offset] = data; + switch (offset) + { + case 0: + if (oldword != TC0180VCU_ctrl[offset]) + { + fg_tilemap.all_tiles_dirty = true; + fg_rambank[0] = (ushort)(((TC0180VCU_ctrl[offset] >> 8) & 0x0f) << 12); + fg_rambank[1] = (ushort)(((TC0180VCU_ctrl[offset] >> 12) & 0x0f) << 12); + } + break; + case 1: + if (oldword != TC0180VCU_ctrl[offset]) + { + bg_tilemap.all_tiles_dirty = true; + bg_rambank[0] = (ushort)(((TC0180VCU_ctrl[offset] >> 8) & 0x0f) << 12); + bg_rambank[1] = (ushort)(((TC0180VCU_ctrl[offset] >> 12) & 0x0f) << 12); + } + break; + case 4: + case 5: + if (oldword != TC0180VCU_ctrl[offset]) + { + tx_tilemap.all_tiles_dirty = true; + } + break; + case 6: + if (oldword != TC0180VCU_ctrl[offset]) + { + tx_tilemap.all_tiles_dirty = true; + tx_rambank = (ushort)(((TC0180VCU_ctrl[offset] >> 8) & 0x0f) << 11); + } + break; + case 7: + taitob_video_control((byte)((TC0180VCU_ctrl[offset] >> 8) & 0xff)); + break; + default: + break; + } + } + public static void hitice_pixelram_w(int offset, ushort data) + { + int sy = offset >> 9; + int sx = offset & 0x1ff; + taitob_pixelram[offset] = data; + } + public static byte TC0640FIO_r(int offset) + { + byte result = 0; + switch (offset) + { + case 0x00: /* DSA */ + result = dswa; + break; + case 0x01: /* DSB */ + result = dswb; + break; + case 0x02: /* 1P */ + result = (byte)sbyte0; + break; + case 0x03: /* 2P */ + result = (byte)sbyte1; + break; + case 0x04: /* coin counters and lockout */ + result = TC0640FIO_regs[4]; + break; + case 0x07: /* coin */ + result = (byte)sbyte2; + break; + default: + result = 0xff; + break; + } + return result; + } + public static void TC0640FIO_w(int offset, byte data) + { + TC0640FIO_regs[offset] = data; + switch (offset) + { + case 0x00: + Watchdog.watchdog_reset(); + break; + case 0x04: + //coin_lockout_w(0,~data & 0x01); + //coin_lockout_w(1,~data & 0x02); + //coin_counter_w(0,data & 0x04); + //coin_counter_w(1,data & 0x08); + break; + default: + break; + } + } + public static ushort TC0640FIO_halfword_r(int offset) + { + return TC0640FIO_r(offset); + } + public static void TC0640FIO_halfword_byteswap_w1(int offset, byte data) + { + TC0640FIO_w(offset, data); + } + public static void TC0640FIO_halfword_byteswap_w(int offset, ushort data) + { + TC0640FIO_w(offset, (byte)((data >> 8) & 0xff)); + } + public static RECT sect_rect(RECT dst, RECT src) + { + RECT dst2 = dst; + if (src.min_x > dst.min_x) dst2.min_x = src.min_x; + if (src.max_x < dst.max_x) dst2.max_x = src.max_x; + if (src.min_y > dst.min_y) dst2.min_y = src.min_y; + if (src.max_y < dst.max_y) dst2.max_y = src.max_y; + return dst2; + } + public static void draw_sprites(RECT cliprect) + { + int x, y, xlatch = 0, ylatch = 0, x_no = 0, y_no = 0, x_num = 0, y_num = 0, big_sprite = 0; + int offs, code, color, flipx, flipy; + uint data, zoomx, zoomy, zx, zy, zoomxlatch = 0, zoomylatch = 0; + for (offs = (0x1980 - 16) / 2; offs >= 0; offs -= 8) + { + code = taitob_spriteram[offs]; + color = taitob_spriteram[offs + 1]; + flipx = color & 0x4000; + flipy = color & 0x8000; + color = (color & 0x3f) * 16; + x = taitob_spriteram[offs + 2] & 0x3ff; + y = taitob_spriteram[offs + 3] & 0x3ff; + if (x >= 0x200) x -= 0x400; + if (y >= 0x200) y -= 0x400; + data = taitob_spriteram[offs + 5]; + if (data != 0) + { + if (big_sprite == 0) + { + x_num = (int)((data >> 8) & 0xff); + y_num = (int)((data) & 0xff); + x_no = 0; + y_no = 0; + xlatch = x; + ylatch = y; + data = taitob_spriteram[offs + 4]; + zoomxlatch = (data >> 8) & 0xff; + zoomylatch = (data) & 0xff; + big_sprite = 1; + } + } + data = taitob_spriteram[offs + 4]; + zoomx = (data >> 8) & 0xff; + zoomy = (data) & 0xff; + zx = (0x100 - zoomx) / 16; + zy = (0x100 - zoomy) / 16; + if (big_sprite != 0) + { + zoomx = zoomxlatch; + zoomy = zoomylatch; + x = (int)(xlatch + x_no * (0x100 - zoomx) / 16); + y = (int)(ylatch + y_no * (0x100 - zoomy) / 16); + zx = (uint)(xlatch + (x_no + 1) * (0x100 - zoomx) / 16 - x); + zy = (uint)(ylatch + (y_no + 1) * (0x100 - zoomy) / 16 - y); + y_no++; + if (y_no > y_num) + { + y_no = 0; + x_no++; + if (x_no > x_num) + big_sprite = 0; + } + } + if ((zoomx != 0) || (zoomy != 0)) + { + Drawgfx.common_drawgfxzoom_taitob(gfx1rom, code, color, flipx, flipy, x, y, cliprect, 0, (int)((zx << 16) / 16), (int)((zy << 16) / 16)); + } + else + { + Drawgfx.common_drawgfx_taitob(gfx1rom, code, color, flipx, flipy, x, y, cliprect); + } + } + } + public static void TC0180VCU_tilemap_draw(RECT cliprect, Tmap tmap, int plane) + { + RECT my_clip; + int i; + int scrollx, scrolly; + int lines_per_block; /* number of lines scrolled by the same amount (per one scroll value) */ + int number_of_blocks; /* number of such blocks per _screen_ (256 lines) */ + lines_per_block = 256 - (TC0180VCU_ctrl[2 + plane] >> 8); + number_of_blocks = 256 / lines_per_block; + my_clip.min_x = cliprect.min_x; + my_clip.max_x = cliprect.max_x; + for (i = 0; i < number_of_blocks; i++) + { + scrollx = taitob_scroll[plane * 0x200 + i * 2 * lines_per_block]; + scrolly = taitob_scroll[plane * 0x200 + i * 2 * lines_per_block + 1]; + my_clip.min_y = i * lines_per_block; + my_clip.max_y = (i + 1) * lines_per_block - 1; + if ((video_control & 0x10) != 0) /*flip screen*/ + { + my_clip.min_y = 0x100 - 1 - (i + 1) * lines_per_block - 1; + my_clip.max_y = 0x100 - 1 - i * lines_per_block; + } + my_clip = sect_rect(my_clip, cliprect); + if (my_clip.min_y <= my_clip.max_y) + { + tmap.tilemap_set_scrollx(0, -scrollx); + tmap.tilemap_set_scrolly(0, -scrolly); + tmap.tilemap_draw_primask(my_clip, 0x10, 0); + } + } + } + public static void draw_framebuffer(RECT cliprect, int priority) + { + RECT myclip = cliprect; + int x, y; + priority <<= 4; + if ((video_control & 0x08) != 0) + { + if (priority != 0) + { + return; + } + if ((video_control & 0x10) != 0) /*flip screen*/ + { + for (y = myclip.min_y; y <= myclip.max_y; y++) + { + for (x = myclip.min_x; x <= myclip.max_x; x++) + { + ushort c = framebuffer[framebuffer_page][y * 512 + x]; + if (c != 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(255 - y) * 512 + 319 - x] = (ushort)(b_sp_color_base + c); + } + } + } + } + else + { + for (y = myclip.min_y; y <= myclip.max_y; y++) + { + for (x = myclip.min_x; x <= myclip.max_x; x++) + { + ushort c = framebuffer[framebuffer_page][y * 512 + x]; + if (c != 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][y * 512 + x] = (ushort)(b_sp_color_base + c); + } + } + } + } + } + else + { + if ((video_control & 0x10) != 0) /*flip screen*/ + { + for (y = myclip.min_y; y <= myclip.max_y; y++) + { + for (x = myclip.min_x; x <= myclip.max_x; x++) + { + ushort c = framebuffer[framebuffer_page][y * 512 + x]; + if ((c != 0) && ((c & 0x10) == priority)) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(255 - y) * 512 + 319 - x] = (ushort)(b_sp_color_base + c); + } + } + } + } + else + { + for (y = myclip.min_y; y <= myclip.max_y; y++) + { + for (x = myclip.min_x; x <= myclip.max_x; x++) + { + ushort c = framebuffer[framebuffer_page][y * 512 + x]; + if ((c != 0) && ((c & 0x10) == priority)) + { + Video.bitmapbase_Ptrs[Video.curbitmap][y * 512 + x] = (ushort)(b_sp_color_base + c); + } + } + } + } + } + } + public static void video_update_taitob() + { + if ((video_control & 0x20) == 0) + { + Array.Copy(uuB0000, Video.bitmapbase[Video.curbitmap], 0x20000); + return; + } + /* Draw playfields */ + TC0180VCU_tilemap_draw(cliprect, bg_tilemap, 1); + draw_framebuffer(cliprect, 1); + TC0180VCU_tilemap_draw(cliprect, fg_tilemap, 0); + /*if (pixel_bitmap) // hitice only + { + int scrollx = -2 * pixel_scroll[0]; //+320; + int scrolly = -pixel_scroll[1]; //+240; + copyscrollbitmap_trans(bitmap, pixel_bitmap, 1, &scrollx, 1, &scrolly, cliprect, b_fg_color_base * 16); + }*/ + draw_framebuffer(cliprect, 0); + tx_tilemap.tilemap_draw_primask(cliprect, 0x10, 0); + } + public static void video_eof_taitob() + { + if ((~video_control & 0x01) != 0) + { + Array.Copy(uuB0000, framebuffer[framebuffer_page], 0x20000); + } + if ((~video_control & 0x80) != 0) + { + framebuffer_page ^= 1; + } + draw_sprites(cliprect); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Video.cs.meta new file mode 100644 index 00000000..800d3132 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/taitob/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 81d429240c9c28e4b8182ba71ea720ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan.meta new file mode 100644 index 00000000..3edba692 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9673df45e469fc241a89778f6a033263 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Drawgfx.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Drawgfx.cs new file mode 100644 index 00000000..bd202230 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Drawgfx.cs @@ -0,0 +1,105 @@ +namespace MAME.Core +{ + public unsafe partial class Drawgfx + { + public static void common_drawgfx_pbaction(byte* bb1, int gfxwidth, int gfxheight, int gfxsrcmodulo, int gfxtotal_elements, int code, int color, int flipx, int flipy, int sx, int sy, RECT clip) + { + int ox; + int oy; + int ex; + int ey; + code %= gfxtotal_elements; + ox = sx; + oy = sy; + ex = sx + gfxwidth - 1; + if (sx < 0) + { + sx = 0; + } + if (sx < clip.min_x) + { + sx = clip.min_x; + } + if (ex >= 0x100) + { + ex = 0x100 - 1; + } + if (ex > clip.max_x) + { + ex = clip.max_x; + } + if (sx > ex) + { + return; + } + ey = sy + gfxheight - 1; + if (sy < 0) + { + sy = 0; + } + if (sy < clip.min_y) + { + sy = clip.min_y; + } + if (ey >= 0x100) + { + ey = 0x100 - 1; + } + if (ey > clip.max_y) + { + ey = clip.max_y; + } + if (sy > ey) + { + return; + } + int sw = gfxwidth; + int sh = gfxheight; + int sm = gfxsrcmodulo; + int ls = sx - ox; + int ts = sy - oy; + int dw = ex - sx + 1; + int dh = ey - sy + 1; + int colorbase = 8 * color; + blockmove_8toN_transpen16_pbaction(bb1, code, sw, sh, sm, ls, ts, flipx, flipy, dw, dh, colorbase, sy, sx); + } + public unsafe static void blockmove_8toN_transpen16_pbaction(byte* bb1, int code, int srcwidth, int srcheight, int srcmodulo, int leftskip, int topskip, int flipx, int flipy, int dstwidth, int dstheight, int colorbase, int offsety, int offsetx) + { + int ydir, xdir, col, i, j; + int srcdata_offset = code * srcwidth * srcheight; + if (flipy != 0) + { + offsety += (dstheight - 1); + srcdata_offset += (srcheight - dstheight - topskip) * srcmodulo; + ydir = -1; + } + else + { + srcdata_offset += topskip * srcmodulo; + ydir = 1; + } + if (flipx != 0) + { + offsetx += (dstwidth - 1); + srcdata_offset += (srcwidth - dstwidth - leftskip); + xdir = -1; + } + else + { + srcdata_offset += leftskip; + xdir = 1; + } + for (i = 0; i < dstheight; i++) + { + for (j = 0; j < dstwidth; j++) + { + col = bb1[srcdata_offset + srcmodulo * i + j]; + if (col != 0) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety + ydir * i) * 0x100 + offsetx + xdir * j] = (ushort)(colorbase + col); + } + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Drawgfx.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Drawgfx.cs.meta new file mode 100644 index 00000000..fa029719 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Drawgfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64cb4aff84785cf44ab1995aa9269388 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Input.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Input.cs new file mode 100644 index 00000000..0a01c910 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Input.cs @@ -0,0 +1,149 @@ +using MAME.Core; + +namespace MAME.Core +{ + public partial class Tehkan + { + public static void loop_inputports_tehkan_pbaction() + { + if (Keyboard.IsPressed(MotionKey.P1_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D5)) + { + byte2 |= 0x01; + } + else + { + byte2 &= unchecked((byte)~0x01); + } + if (Keyboard.IsPressed(MotionKey.P2_INSERT_COIN))//if (Keyboard.IsPressed(Corekey.D6)) + { + byte2 |= 0x02; + } + else + { + byte2 &= unchecked((byte)~0x02); + } + if (Keyboard.IsPressed(MotionKey.P1_GAMESTART))//if (Keyboard.IsPressed(Corekey.D1)) + { + byte2 |= 0x04; + } + else + { + byte2 &= unchecked((byte)~0x04); + } + if (Keyboard.IsPressed(MotionKey.P2_GAMESTART))//if (Keyboard.IsPressed(Corekey.D2)) + { + byte2 |= 0x08; + } + else + { + byte2 &= unchecked((byte)~0x08); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_1))//if (Keyboard.IsPressed(Corekey.J)) + { + byte0 |= 0x08; + } + else + { + byte0 &= unchecked((byte)~0x08); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_2))//if (Keyboard.IsPressed(Corekey.K)) + { + byte0 |= 0x10; + } + else + { + byte0 &= unchecked((byte)~0x10); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_E))//if (Keyboard.IsPressed(Corekey.L)) + { + byte0 |= 0x01; + } + else + { + byte0 &= unchecked((byte)~0x01); + } + if (Keyboard.IsPressed(MotionKey.P1_BTN_3))//if (Keyboard.IsPressed(Corekey.U)) + { + byte0 |= 0x04; + } + else + { + byte0 &= unchecked((byte)~0x04); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_1))//if (Keyboard.IsPressed(Corekey.NumPad1)) + { + byte1 |= 0x08; + } + else + { + byte1 &= unchecked((byte)~0x08); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_2))//if (Keyboard.IsPressed(Corekey.NumPad2)) + { + byte1 |= 0x10; + } + else + { + byte1 &= unchecked((byte)~0x10); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_E))//if (Keyboard.IsPressed(Corekey.NumPad3)) + { + byte1 |= 0x01; + } + else + { + byte1 &= unchecked((byte)~0x01); + } + if (Keyboard.IsPressed(MotionKey.P2_BTN_3))//if (Keyboard.IsPressed(Corekey.NumPad4)) + { + byte1 |= 0x04; + } + else + { + byte1 &= unchecked((byte)~0x04); + } + } + public static void record_port_pbaction() + { + if (byte0 != byte0_old || byte1 != byte1_old || byte2 != byte2_old) + { + byte0_old = byte0; + byte1_old = byte1; + byte2_old = byte2; + Mame.bwRecord.Write(Video.screenstate.frame_number); + Mame.bwRecord.Write(byte0); + Mame.bwRecord.Write(byte1); + Mame.bwRecord.Write(byte2); + } + } + public static void replay_port_pbaction() + { + if (Inptport.bReplayRead) + { + try + { + Video.frame_number_obj = Mame.brRecord.ReadInt64(); + byte0_old = Mame.brRecord.ReadByte(); + byte1_old = Mame.brRecord.ReadByte(); + byte2_old = Mame.brRecord.ReadByte(); + } + catch + { + Mame.playState = Mame.PlayState.PLAY_REPLAYEND; + } + Inptport.bReplayRead = false; + } + if (Video.screenstate.frame_number == Video.frame_number_obj) + { + byte0 = byte0_old; + byte1 = byte1_old; + byte2 = byte2_old; + Inptport.bReplayRead = true; + } + else + { + Inptport.bReplayRead = false; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Input.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Input.cs.meta new file mode 100644 index 00000000..1934bfbe --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Input.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 563dcda1ded30154b8438267556caa3f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Memory.cs new file mode 100644 index 00000000..0ab24b1c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Memory.cs @@ -0,0 +1,266 @@ +using cpu.z80; + +namespace MAME.Core +{ + public unsafe partial class Tehkan + { + public static byte byte0, byte1, byte2; + public static byte byte0_old, byte1_old, byte2_old; + public static byte Z0ReadOp(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte Z0ReadOp_pbaction3(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0x7fff) + { + result = mainromop[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + result = Memory.mainrom[address]; + } + return result; + } + public static byte Z0ReadMemory(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0x7fff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + result = Memory.mainrom[address]; + } + else if (address >= 0xc000 && address <= 0xcfff) + { + int offset = address - 0xc000; + result = Memory.mainram[offset]; + } + else if (address >= 0xd000 && address <= 0xd3ff) + { + int offset = address - 0xd000; + result = pbaction_videoram2[offset]; + } + else if (address >= 0xd400 && address <= 0xd7ff) + { + int offset = address - 0xd400; + result = pbaction_colorram2[offset]; + } + else if (address >= 0xd800 && address <= 0xdbff) + { + int offset = address - 0xd800; + result = Generic.videoram[offset]; + } + else if (address >= 0xdc00 && address <= 0xdfff) + { + int offset = address - 0xdc00; + result = Generic.colorram[offset]; + } + else if (address >= 0xe000 && address <= 0xe07f) + { + int offset = address - 0xe000; + result = Generic.spriteram[offset]; + } + else if (address >= 0xe400 && address <= 0xe5ff) + { + int offset = address - 0xe400; + result = Generic.paletteram[offset]; + } + else if (address == 0xe600) + { + result = byte0; + } + else if (address == 0xe601) + { + result = byte1; + } + else if (address == 0xe602) + { + result = byte2; + } + else if (address == 0xe604) + { + result = dsw1; + } + else if (address == 0xe605) + { + result = dsw2; + } + else if (address == 0xe606) + { + result = 0; + } + return result; + } + public static byte Z0ReadMemory_pbaction3(ushort address) + { + byte result = 0; + if (address == 0xc000) + { + result = pbaction3_prot_kludge_r(); + } + else + { + result = Z0ReadMemory(address); + } + return result; + } + public static void Z0WriteMemory(ushort address, byte value) + { + if (address >= 0x0000 && address <= 0x7fff) + { + Memory.mainrom[address] = value; + } + else if (address >= 0x8000 && address <= 0xbfff) + { + Memory.mainrom[address] = value; + } + else if (address >= 0xc000 && address <= 0xcfff) + { + int offset = address - 0xc000; + Memory.mainram[offset] = value; + } + else if (address >= 0xd000 && address <= 0xd3ff) + { + int offset = address - 0xd000; + pbaction_videoram2_w(offset, value); + } + else if (address >= 0xd400 && address <= 0xd7ff) + { + int offset = address - 0xd400; + pbaction_colorram2_w(offset, value); + } + else if (address >= 0xd800 && address <= 0xdbff) + { + int offset = address - 0xd800; + pbaction_videoram_w(offset, value); + } + else if (address >= 0xdc00 && address <= 0xdfff) + { + int offset = address - 0xdc00; + pbaction_colorram_w(offset, value); + } + else if (address >= 0xe000 && address <= 0xe07f) + { + int offset = address - 0xe000; + Generic.spriteram[offset] = value; + } + else if (address >= 0xe400 && address <= 0xe5ff) + { + int offset = address - 0xe400; + Generic.paletteram_xxxxBBBBGGGGRRRR_le_w(offset, value); + } + else if (address == 0xe600) + { + Generic.interrupt_enable_w(value); + } + else if (address == 0xe604) + { + pbaction_flipscreen_w(value); + } + else if (address == 0xe606) + { + pbaction_scroll_w(value); + } + else if (address == 0xe800) + { + pbaction_sh_command_w(value); + } + } + public static byte Z0ReadHardware(ushort address) + { + return 0; + } + public static void Z0WriteHardware(ushort address, byte value) + { + + } + public static int Z0IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[0].cpunum, 0); + } + public static byte Z1ReadOp(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0x1fff) + { + result = Memory.audiorom[address]; + } + return result; + } + public static byte Z1ReadMemory(ushort address) + { + byte result = 0; + if (address >= 0 && address <= 0x1fff) + { + result = Memory.audiorom[address]; + } + else if (address >= 0x4000 && address <= 0x47ff) + { + int offset = address - 0x4000; + result = Memory.audioram[offset]; + } + else if (address == 0x8000) + { + result = (byte)Sound.soundlatch_r(); + } + return result; + } + public static void Z1WriteMemory(ushort address, byte value) + { + if (address >= 0 && address <= 0x1fff) + { + Memory.audiorom[address] = value; + } + else if (address >= 0x4000 && address <= 0x47ff) + { + int offset = address - 0x4000; + Memory.audioram[offset] = value; + } + else if (address == 0xffff) + { + + } + } + public static byte Z1ReadHardware(ushort address) + { + byte result = 0; + return result; + } + public static void Z1WriteHardware(ushort address, byte value) + { + address &= 0xff; + if (address >= 0x10 && address <= 0x11) + { + int offset = address - 0x10; + AY8910.AA8910[0].ay8910_write_ym(offset, value); + } + else if (address >= 0x20 && address <= 0x21) + { + int offset = address - 0x20; + AY8910.AA8910[1].ay8910_write_ym(offset, value); + } + else if (address >= 0x30 && address <= 0x31) + { + int offset = address - 0x30; + AY8910.AA8910[2].ay8910_write_ym(offset, value); + } + } + public static int Z1IRQCallback() + { + return Cpuint.cpu_irq_callback(Z80A.zz1[1].cpunum, 0); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Memory.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Memory.cs.meta new file mode 100644 index 00000000..1ecd24a6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Memory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 025ea03237da3a243acc7dde3ef0b86a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Pbaction.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Pbaction.cs new file mode 100644 index 00000000..bec6d7f1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Pbaction.cs @@ -0,0 +1,199 @@ +using cpu.z80; +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe partial class Tehkan + { + public static byte dsw1, dsw2; + //public static byte[] /*mainromop,*/ /*gfx1rom,*/ /*gfx2rom,*/ gfx3rom, gfx32rom; + + #region //指针化 mainromop + static byte[] mainromop_src; + static GCHandle mainromop_handle; + public static byte* mainromop; + public static int mainromopLength; + public static bool mainromop_IsNull => mainromop == null; + public static byte[] mainromop_set + { + set + { + mainromop_handle.ReleaseGCHandle(); + mainromop_src = value; + mainromopLength = value.Length; + mainromop_src.GetObjectPtr(ref mainromop_handle, ref mainromop); + } + } + #endregion + + + #region //指针化 gfx1rom + static byte[] gfx1rom_src; + static GCHandle gfx1rom_handle; + public static byte* gfx1rom; + public static int gfx1romLength; + public static bool gfx1rom_IsNull => gfx1rom == null; + public static byte[] gfx1rom_set + { + set + { + gfx1rom_handle.ReleaseGCHandle(); + gfx1rom_src = value; + gfx1romLength = value.Length; + gfx1rom_src.GetObjectPtr(ref gfx1rom_handle, ref gfx1rom); + } + } + #endregion + + #region //指针化 gfx2rom + static byte[] gfx2rom_src; + static GCHandle gfx2rom_handle; + public static byte* gfx2rom; + public static int gfx2romLength; + public static bool gfx2rom_IsNull => gfx2rom == null; + public static byte[] gfx2rom_set + { + set + { + gfx2rom_handle.ReleaseGCHandle(); + gfx2rom_src = value; + gfx2romLength = value.Length; + gfx2rom_src.GetObjectPtr(ref gfx2rom_handle, ref gfx2rom); + } + } + #endregion + + #region //指针化 gfx3rom + static byte[] gfx3rom_src; + static GCHandle gfx3rom_handle; + public static byte* gfx3rom; + public static int gfx3romLength; + public static bool gfx3rom_IsNull => gfx3rom == null; + public static byte[] gfx3rom_set + { + set + { + gfx3rom_handle.ReleaseGCHandle(); + gfx3rom_src = value; + gfx3romLength = value.Length; + gfx3rom_src.GetObjectPtr(ref gfx3rom_handle, ref gfx3rom); + } + } + #endregion + + #region //指针化 gfx32rom + static byte[] gfx32rom_src; + static GCHandle gfx32rom_handle; + public static byte* gfx32rom; + public static int gfx32romLength; + public static bool gfx32rom_IsNull => gfx32rom == null; + public static byte[] gfx32rom_set + { + set + { + gfx32rom_handle.ReleaseGCHandle(); + gfx32rom_src = value; + gfx32romLength = value.Length; + gfx32rom_src.GetObjectPtr(ref gfx32rom_handle, ref gfx32rom); + } + } + #endregion + + + public static void PbactionInit() + { + int i, n; + Machine.bRom = true; + switch (Machine.sName) + { + case "pbaction": + case "pbaction2": + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + gfx2rom_set = Machine.GetRom("gfx2.rom"); + gfx3rom_set = Machine.GetRom("gfx3.rom"); + gfx32rom_set = Machine.GetRom("gfx32.rom"); + Memory.Set_mainram(new byte[0x1000]); + Memory.Set_audioram(new byte[0x800]); + Generic.videoram_set = new byte[0x400]; + pbaction_videoram2 = new byte[0x400]; + Generic.colorram_set = new byte[0x400]; + pbaction_colorram2 = new byte[0x400]; + Generic.spriteram_set = new byte[0x80]; + Generic.paletteram_set = new byte[0x200]; + if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || gfx1rom == null || gfx2rom == null || gfx3rom == null || gfx32rom == null) + { + Machine.bRom = false; + } + break; + case "pbaction3": + case "pbaction4": + case "pbaction5": + Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); + mainromop_set = Machine.GetRom("maincpuop.rom"); + //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); + gfx1rom_set = Machine.GetRom("gfx1.rom"); + gfx2rom_set = Machine.GetRom("gfx2.rom"); + gfx3rom_set = Machine.GetRom("gfx3.rom"); + gfx32rom_set = Machine.GetRom("gfx32.rom"); + Memory.Set_mainram(new byte[0x1000]); + Memory.Set_audioram(new byte[0x800]); + Generic.videoram_set = new byte[0x400]; + pbaction_videoram2 = new byte[0x400]; + Generic.colorram_set = new byte[0x400]; + pbaction_colorram2 = new byte[0x400]; + Generic.spriteram_set = new byte[0x80]; + Generic.paletteram_set = new byte[0x200]; + if (Memory.mainrom_IsNull || mainromop == null || Memory.audiorom_IsNull || gfx1rom == null || gfx2rom == null || gfx3rom == null || gfx32rom == null) + { + Machine.bRom = false; + } + break; + } + if (Machine.bRom) + { + switch (Machine.sName) + { + case "pbaction": + case "pbaction2": + case "pbaction3": + case "pbaction4": + case "pbaction5": + dsw1 = 0x40; + dsw2 = 0x00; + break; + } + } + } + public static void pbaction_sh_command_w(byte data) + { + Sound.soundlatch_w(data); + Cpuint.cpunum_set_input_line_and_vector2(1, 0, LineState.HOLD_LINE, 0); + } + public static void pbaction_interrupt() + { + Cpuint.cpunum_set_input_line_and_vector2(1, 0, LineState.HOLD_LINE, 0x02); + } + public unsafe static byte pbaction3_prot_kludge_r() + { + byte result; + if (Z80A.zz1[0].PC == 0xab80) + { + result = 0; + } + else + { + result = Memory.mainram[0]; + } + return result; + } + public static void machine_reset_tehkan() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Pbaction.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Pbaction.cs.meta new file mode 100644 index 00000000..a99ce484 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Pbaction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7599feed5ece4aa4d9b8e7d1240cbb9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/State.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/State.cs new file mode 100644 index 00000000..90d06e6f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/State.cs @@ -0,0 +1,91 @@ +using cpu.z80; +using System.IO; + +namespace MAME.Core +{ + public partial class Tehkan + { + public unsafe static void SaveStateBinary_pbaction(BinaryWriter writer) + { + int i; + writer.Write(dsw1); + writer.Write(dsw2); + writer.Write(scroll); + for (i = 0; i < 0x100; i++) + { + writer.Write(Palette.entry_color[i]); + } + writer.Write(Memory.mainram, 0, 0x1000); + writer.Write(Generic.videoram, 0, 0x400); + writer.Write(pbaction_videoram2, 0, 0x400); + writer.Write(Generic.colorram, 0, 0x400); + writer.Write(pbaction_colorram2, 0, 0x400); + writer.Write(Generic.spriteram, 0, 0x80); + writer.Write(Generic.paletteram, 0, 0x200); + writer.Write(Memory.audioram, 0, 0x800); + Z80A.zz1[0].SaveStateBinary(writer); + Z80A.zz1[1].SaveStateBinary(writer); + Cpuint.SaveStateBinary(writer); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); + Video.SaveStateBinary(writer); + writer.Write(Sound.last_update_second); + Cpuexec.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); + for (i = 0; i < 3; i++) + { + AY8910.AA8910[i].SaveStateBinary(writer); + } + writer.Write(Sound.latched_value[0]); + writer.Write(Sound.utempdata[0]); + for (i = 0; i < 3; i++) + { + writer.Write(AY8910.AA8910[i].stream.output_sampindex); + writer.Write(AY8910.AA8910[i].stream.output_base_sampindex); + } + writer.Write(Sound.mixerstream.output_sampindex); + writer.Write(Sound.mixerstream.output_base_sampindex); + } + public static void LoadStateBinary_pbaction(BinaryReader reader) + { + int i; + dsw1 = reader.ReadByte(); + dsw2 = reader.ReadByte(); + scroll = reader.ReadInt32(); + for (i = 0; i < 0x100; i++) + { + Palette.entry_color[i] = reader.ReadUInt32(); + } + Memory.Set_mainram(reader.ReadBytes(0x1000)); + Generic.videoram_set = reader.ReadBytes(0x400); + pbaction_videoram2 = reader.ReadBytes(0x400); + Generic.colorram_set = reader.ReadBytes(0x400); + pbaction_colorram2 = reader.ReadBytes(0x400); + Generic.spriteram_set = reader.ReadBytes(0x80); + Generic.paletteram_set = reader.ReadBytes(0x200); + Memory.Set_audioram(reader.ReadBytes(0x800)); + Z80A.zz1[0].LoadStateBinary(reader); + Z80A.zz1[1].LoadStateBinary(reader); + Cpuint.LoadStateBinary(reader); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); + Video.LoadStateBinary(reader); + Sound.last_update_second = reader.ReadInt32(); + Cpuexec.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); + for (i = 0; i < 3; i++) + { + AY8910.AA8910[i].LoadStateBinary(reader); + } + Sound.latched_value[0] = reader.ReadUInt16(); + Sound.utempdata[0] = reader.ReadUInt16(); + for (i = 0; i < 3; i++) + { + AY8910.AA8910[i].stream.output_sampindex = reader.ReadInt32(); + AY8910.AA8910[i].stream.output_base_sampindex = reader.ReadInt32(); + } + Sound.mixerstream.output_sampindex = reader.ReadInt32(); + Sound.mixerstream.output_base_sampindex = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/State.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/State.cs.meta new file mode 100644 index 00000000..9444cd87 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 66c0763841d8ea049ae6ad07e8e7c9f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Tilemap.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Tilemap.cs new file mode 100644 index 00000000..9c5834ec --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Tilemap.cs @@ -0,0 +1,285 @@ +using System; + +namespace MAME.Core +{ + public unsafe partial class Tehkan + { + public static Tmap bg_tilemap, fg_tilemap; + public static void tilemap_init() + { + int i; + bg_tilemap = new Tmap(); + bg_tilemap.cols = 32; + bg_tilemap.rows = 32; + bg_tilemap.tilewidth = 8; + bg_tilemap.tileheight = 8; + bg_tilemap.width = 0x100; + bg_tilemap.height = 0x100; + bg_tilemap.enable = true; + bg_tilemap.all_tiles_dirty = true; + bg_tilemap.total_elements = gfx2romLength / 0x40; + bg_tilemap.pixmap = new ushort[0x100 * 0x100]; + bg_tilemap.flagsmap = new byte[0x100, 0x100]; + bg_tilemap.tileflags = new byte[32, 32]; + bg_tilemap.pen_data_set = new byte[0x100]; + bg_tilemap.pen_to_flags = new byte[1, 16]; + for (i = 0; i < 16; i++) + { + bg_tilemap.pen_to_flags[0, i] = 0x10; + } + bg_tilemap.scrollrows = 1; + bg_tilemap.scrollcols = 1; + bg_tilemap.rowscroll = new int[bg_tilemap.scrollrows]; + bg_tilemap.colscroll = new int[bg_tilemap.scrollcols]; + bg_tilemap.tilemap_draw_instance3 = bg_tilemap.tilemap_draw_instanceTehkan_pbaction; + bg_tilemap.tile_update3 = bg_tilemap.tile_updatePbactionbg; + + fg_tilemap = new Tmap(); + fg_tilemap.cols = 32; + fg_tilemap.rows = 32; + fg_tilemap.tilewidth = 8; + fg_tilemap.tileheight = 8; + fg_tilemap.width = 0x100; + fg_tilemap.height = 0x100; + fg_tilemap.enable = true; + fg_tilemap.all_tiles_dirty = true; + fg_tilemap.total_elements = gfx1romLength / 0x40; + fg_tilemap.pixmap = new ushort[0x100 * 0x100]; + fg_tilemap.flagsmap = new byte[0x100, 0x100]; + fg_tilemap.tileflags = new byte[32, 32]; + fg_tilemap.pen_data_set = new byte[0x100]; + fg_tilemap.pen_to_flags = new byte[1, 16]; + fg_tilemap.pen_to_flags[0, 0] = 0; + for (i = 1; i < 16; i++) + { + fg_tilemap.pen_to_flags[0, i] = 0x10; + } + fg_tilemap.scrollrows = 1; + fg_tilemap.scrollcols = 1; + fg_tilemap.rowscroll = new int[fg_tilemap.scrollrows]; + fg_tilemap.colscroll = new int[fg_tilemap.scrollcols]; + fg_tilemap.tilemap_draw_instance3 = fg_tilemap.tilemap_draw_instanceTehkan_pbaction; + fg_tilemap.tile_update3 = fg_tilemap.tile_updatePbactionfg; + } + } + public unsafe partial class Tmap + { + public void tile_updatePbactionbg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, attr, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + attr = Generic.colorram[tile_index]; + code = Generic.videoram[tile_index] + 0x10 * (attr & 0x70); + color = attr & 0x07; + flags = (attr & 0x80) != 0 ? Tilemap.TILE_FLIPY : 0; + pen_data_offset = code * 0x40; + palette_base = 0x80 + 0x10 * color; + group = 0; + tileflags[row, col] = tile_drawTehkanbg(Tehkan.gfx2rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public void tile_updatePbactionfg(int col, int row) + { + int x0 = tilewidth * col; + int y0 = tileheight * row; + int flags; + int tile_index; + int code, attr, color; + int pen_data_offset, palette_base, group; + tile_index = row * cols + col; + attr = Tehkan.pbaction_colorram2[tile_index]; + code = Tehkan.pbaction_videoram2[tile_index] + 0x10 * (attr & 0x30); + color = attr & 0x0f; + flags = ((attr & 0x40) != 0 ? Tilemap.TILE_FLIPX : 0) | ((attr & 0x80) != 0 ? Tilemap.TILE_FLIPY : 0); + pen_data_offset = code * 0x40; + palette_base = 0x08 * color; + group = 0; + tileflags[row, col] = tile_drawTehkanfg(Tehkan.gfx1rom, pen_data_offset, x0, y0, palette_base, group, flags); + } + public byte tile_drawTehkanbg(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + if (palette_base + pen == 0x0106) + { + int i1 = 1; + } + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public byte tile_drawTehkanfg(byte* bb1, int pen_data_offset, int x0, int y0, int palette_base, int group, int flags) + { + byte andmask = 0xff, ormask = 0; + int dx0 = 1, dy0 = 1; + int tx, ty; + byte pen, map; + int offset1 = 0; + int offsety1; + int xoffs; + AxiArray.Copy(bb1, pen_data_offset, pen_data, 0, 0x40); + if ((flags & Tilemap.TILE_FLIPY) != 0) + { + y0 += tileheight - 1; + dy0 = -1; + } + if ((flags & Tilemap.TILE_FLIPX) != 0) + { + x0 += tilewidth - 1; + dx0 = -1; + } + for (ty = 0; ty < tileheight; ty++) + { + xoffs = 0; + offsety1 = y0; + y0 += dy0; + for (tx = 0; tx < tilewidth; tx++) + { + pen = pen_data[offset1]; + map = pen_to_flags[group, pen]; + offset1++; + pixmap[(offsety1 % width) * width + x0 + xoffs] = (ushort)(palette_base + pen); + flagsmap[offsety1 % width, x0 + xoffs] = map; + andmask &= map; + ormask |= map; + xoffs += dx0; + } + } + return (byte)(andmask ^ ormask); + } + public void tilemap_draw_instanceTehkan_pbaction(RECT cliprect, int xpos, int ypos) + { + int mincol, maxcol; + int x1, y1, x2, y2; + int y, nexty; + int offsety1, offsety2; + int i; + x1 = Math.Max(xpos, cliprect.min_x); + x2 = Math.Min(xpos + width, cliprect.max_x + 1); + y1 = Math.Max(ypos, cliprect.min_y); + y2 = Math.Min(ypos + height, cliprect.max_y + 1); + if (x1 >= x2 || y1 >= y2) + return; + x1 -= xpos; + y1 -= ypos; + x2 -= xpos; + y2 -= ypos; + offsety1 = y1; + mincol = x1 / tilewidth; + maxcol = (x2 + tilewidth - 1) / tilewidth; + y = y1; + nexty = tileheight * (y1 / tileheight) + tileheight; + nexty = Math.Min(nexty, y2); + for (; ; ) + { + int row = y / tileheight; + trans_t prev_trans = trans_t.WHOLLY_TRANSPARENT; + trans_t cur_trans; + int x_start = x1; + int column; + for (column = mincol; column <= maxcol; column++) + { + int x_end; + if (column == maxcol) + { + cur_trans = trans_t.WHOLLY_TRANSPARENT; + } + else + { + if (tileflags[row, column] == Tilemap.TILE_FLAG_DIRTY) + { + tile_update3(column, row); + } + if ((tileflags[row, column] & mask) != 0) + { + cur_trans = trans_t.MASKED; + } + else + { + cur_trans = ((flagsmap[offsety1, column * tilewidth] & mask) == value) ? trans_t.WHOLLY_OPAQUE : trans_t.WHOLLY_TRANSPARENT; + } + } + if (cur_trans == prev_trans) + { + continue; + } + x_end = column * tilewidth; + x_end = Math.Max(x_end, x1); + x_end = Math.Min(x_end, x2); + if (prev_trans != trans_t.WHOLLY_TRANSPARENT) + { + int cury; + offsety2 = offsety1; + if (prev_trans == trans_t.WHOLLY_OPAQUE) + { + for (cury = y; cury < nexty; cury++) + { + Array.Copy(pixmap, offsety2 * width + x_start, Video.bitmapbase[Video.curbitmap], (offsety2 + ypos) * 0x100 + xpos + x_start, x_end - x_start); + offsety2++; + } + } + else if (prev_trans == trans_t.MASKED) + { + for (cury = y; cury < nexty; cury++) + { + for (i = xpos + x_start; i < xpos + x_end; i++) + { + if ((flagsmap[offsety2, i - xpos] & mask) == value) + { + Video.bitmapbase_Ptrs[Video.curbitmap][(offsety2 + ypos) * 0x100 + i] = pixmap[offsety2 * width + i - xpos]; + } + } + offsety2++; + } + } + } + x_start = x_end; + prev_trans = cur_trans; + } + if (nexty == y2) + { + break; + } + offsety1 += (nexty - y); + y = nexty; + nexty += tileheight; + nexty = Math.Min(nexty, y2); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Tilemap.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Tilemap.cs.meta new file mode 100644 index 00000000..c3a0d030 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Tilemap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3041be2b14e16f4089cd70e9c24ff50 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Video.cs new file mode 100644 index 00000000..8fe7e3fa --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Video.cs @@ -0,0 +1,119 @@ +namespace MAME.Core +{ + public unsafe partial class Tehkan + { + public static byte[] pbaction_videoram2, pbaction_colorram2; + public static int scroll; + public static RECT cliprect; + public static void pbaction_videoram_w(int offset, byte data) + { + int row, col; + Generic.videoram[offset] = data; + row = offset / 0x20; + col = offset % 0x20; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void pbaction_colorram_w(int offset, byte data) + { + int row, col; + Generic.colorram[offset] = data; + row = offset / 0x20; + col = offset % 0x20; + bg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void pbaction_videoram2_w(int offset, byte data) + { + int row, col; + pbaction_videoram2[offset] = data; + row = offset / 0x20; + col = offset % 0x20; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void pbaction_colorram2_w(int offset, byte data) + { + int row, col; + pbaction_colorram2[offset] = data; + row = offset / 0x20; + col = offset % 0x20; + fg_tilemap.tilemap_mark_tile_dirty(row, col); + } + public static void pbaction_scroll_w(byte data) + { + scroll = data - 3; + if (Generic.flip_screen_get() != 0) + { + scroll = -scroll; + } + bg_tilemap.tilemap_set_scrollx(0, scroll); + fg_tilemap.tilemap_set_scrollx(0, scroll); + } + public static void pbaction_flipscreen_w(byte data) + { + Generic.flip_screen_set(data & 0x01); + } + public static void video_start_pbaction() + { + cliprect = new RECT(); + cliprect.min_x = 0; + cliprect.max_x = 0xff; + cliprect.min_y = 0x10; + cliprect.max_y = 0xef; + } + public static void draw_sprites(RECT cliprect) + { + int offs; + for (offs = 0x80 - 4; offs >= 0; offs -= 4) + { + int sx, sy, flipx, flipy; + if (offs > 0 && (Generic.spriteram[offs - 4] & 0x80) != 0) + { + continue; + } + sx = Generic.spriteram[offs + 3]; + if ((Generic.spriteram[offs] & 0x80) != 0) + { + sy = 225 - Generic.spriteram[offs + 2]; + } + else + { + sy = 241 - Generic.spriteram[offs + 2]; + } + flipx = Generic.spriteram[offs + 1] & 0x40; + flipy = Generic.spriteram[offs + 1] & 0x80; + if (Generic.flip_screen_get() != 0) + { + if ((Generic.spriteram[offs] & 0x80) != 0) + { + sx = 224 - sx; + sy = 225 - sy; + } + else + { + sx = 240 - sx; + sy = 241 - sy; + } + flipx = (flipx == 0 ? 1 : 0); + flipy = (flipy == 0 ? 1 : 0); + } + if ((Generic.spriteram[offs] & 0x80) != 0) + { + Drawgfx.common_drawgfx_pbaction(gfx32rom, 32, 32, 32, 0x20, Generic.spriteram[offs], Generic.spriteram[offs + 1] & 0x0f, flipx, flipy, sx + (Generic.flip_screen_get() != 0 ? scroll : -scroll), sy, cliprect); + } + else + { + Drawgfx.common_drawgfx_pbaction(gfx3rom, 16, 16, 16, 0x80, Generic.spriteram[offs], Generic.spriteram[offs + 1] & 0x0f, flipx, flipy, sx + (Generic.flip_screen_get() != 0 ? scroll : -scroll), sy, cliprect); + } + } + } + public static void video_update_pbaction() + { + bg_tilemap.tilemap_draw_primask(cliprect, 0x10, 0); + draw_sprites(cliprect); + fg_tilemap.tilemap_draw_primask(cliprect, 0x10, 0); + } + public static void video_eof_pbaction() + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Video.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Video.cs.meta new file mode 100644 index 00000000..72f9140a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/tehkan/Video.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c87a3076398152b478c6eb53d35ad7ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface.meta new file mode 100644 index 00000000..62aba030 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 94c9b9cb31329844f937b7918da6b764 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/Corekey.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/Corekey.cs new file mode 100644 index 00000000..f33c9877 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/Corekey.cs @@ -0,0 +1,166 @@ +namespace MAME.Core +{ + public enum Corekey + { + Next = 209, + Right = 205, + Left = 203, + Convert = 121, + Decimal = 83, + N = 49, + Q = 16, + Circumflex = 144, + PageDown = 209, + DownArrow = 208, + RightArrow = 205, + LeftArrow = 203, + PageUp = 201, + UpArrow = 200, + RightAlt = 184, + NumPadSlash = 181, + NumPadPeriod = 83, + NumPadPlus = 78, + NumPadMinus = 74, + CapsLock = 58, + LeftAlt = 56, + NumPadStar = 55, + BackSpace = 14, + MediaSelect = 237, + Mail = 236, + MyComputer = 235, + WebBack = 234, + WebForward = 233, + WebStop = 232, + WebRefresh = 231, + WebFavorites = 230, + WebSearch = 229, + Wake = 227, + Sleep = 223, + Power = 222, + Apps = 221, + RightWindows = 220, + LeftWindows = 219, + Delete = 211, + Insert = 210, + Down = 208, + End = 207, + Prior = 201, + Up = 200, + Home = 199, + Pause = 197, + RightMenu = 184, + SysRq = 183, + Divide = 181, + NumPadComma = 179, + WebHome = 178, + VolumeUp = 176, + VolumeDown = 174, + MediaStop = 164, + PlayPause = 162, + Calculator = 161, + Mute = 160, + RightControl = 157, + NumPadEnter = 156, + NextTrack = 153, + Unlabeled = 151, + AX = 150, + Stop = 149, + Kanji = 148, + Underline = 147, + Colon = 146, + At = 145, + PrevTrack = 144, + NumPadEquals = 141, + AbntC2 = 126, + Yen = 125, + NoConvert = 123, + AbntC1 = 115, + Kana = 112, + F15 = 102, + F14 = 101, + F13 = 100, + F12 = 88, + F11 = 87, + OEM102 = 86, + NumPad0 = 82, + NumPad3 = 81, + NumPad2 = 80, + NumPad1 = 79, + Add = 78, + NumPad6 = 77, + NumPad5 = 76, + NumPad4 = 75, + Subtract = 74, + NumPad9 = 73, + NumPad8 = 72, + NumPad7 = 71, + Numlock = 69, + F10 = 68, + F9 = 67, + F8 = 66, + F7 = 65, + F6 = 64, + F5 = 63, + F4 = 62, + F3 = 61, + F2 = 60, + F1 = 59, + Capital = 58, + Space = 57, + LeftMenu = 56, + Multiply = 55, + RightShift = 54, + Slash = 53, + Period = 52, + Comma = 51, + M = 50, + B = 48, + V = 47, + C = 46, + X = 45, + BackSlash = 43, + LeftShift = 42, + Grave = 41, + Apostrophe = 40, + SemiColon = 39, + L = 38, + K = 37, + J = 36, + H = 35, + G = 34, + F = 33, + D = 32, + S = 31, + A = 30, + LeftControl = 29, + Return = 28, + RightBracket = 27, + LeftBracket = 26, + P = 25, + O = 24, + I = 23, + U = 22, + Y = 21, + T = 20, + R = 19, + E = 18, + W = 17, + Tab = 15, + Back = 14, + Equals = 13, + Minus = 12, + D0 = 11, + D9 = 10, + D8 = 9, + D7 = 8, + D6 = 7, + D5 = 6, + D4 = 5, + D3 = 4, + D2 = 3, + D1 = 2, + Z = 44, + Escape = 1, + Scroll = 70 + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/Corekey.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/Corekey.cs.meta new file mode 100644 index 00000000..51d066f7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/Corekey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 65df4cecefbc04749b27da6854ebc61f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IKeyboard.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IKeyboard.cs new file mode 100644 index 00000000..527dba3a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IKeyboard.cs @@ -0,0 +1,7 @@ +namespace MAME.Core +{ + public interface IKeyboard + { + ulong GetPressedKeys(); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IKeyboard.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IKeyboard.cs.meta new file mode 100644 index 00000000..1788c8c6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IKeyboard.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff6248c44d30b344aaa7cf2192d10313 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ILog.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ILog.cs new file mode 100644 index 00000000..ca89b0aa --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ILog.cs @@ -0,0 +1,7 @@ +namespace MAME.Core +{ + public interface ILog + { + void Log(string msg); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ILog.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ILog.cs.meta new file mode 100644 index 00000000..d5cbe815 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ILog.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a37ec71cb9167b241bc08e17e72f6006 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IMouse.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IMouse.cs new file mode 100644 index 00000000..73f9a226 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IMouse.cs @@ -0,0 +1,7 @@ +namespace MAME.Core +{ + public interface IMouse + { + void MouseXY(out int X, out int Y, out byte[] MouseButtons); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IMouse.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IMouse.cs.meta new file mode 100644 index 00000000..d75c1a1d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IMouse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33ba40054ec4f4a418e6cd031b342c4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IResources.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IResources.cs new file mode 100644 index 00000000..5f48e0d2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IResources.cs @@ -0,0 +1,17 @@ +namespace MAME.Core +{ + public interface IResources + { + byte[] mcu { get; } + byte[] sfix { get; } + byte[] _000_lo { get; } + byte[] sm1 { get; } + byte[] mainbios { get; } + byte[] pgmmainbios { get; } + byte[] pgmvideobios { get; } + byte[] pgmaudiobios { get; } + byte[] _1 { get; } + byte[] readme { get; } + string mame { get; } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IResources.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IResources.cs.meta new file mode 100644 index 00000000..9a471f69 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IResources.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3a85239bba2e3045bc34ca91c6dae40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ISoundPlayer.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ISoundPlayer.cs new file mode 100644 index 00000000..cc56bd04 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ISoundPlayer.cs @@ -0,0 +1,10 @@ +namespace MAME.Core +{ + public interface ISoundPlayer + { + void BufferWirte(int Off, byte[] Data); + void SubmitSamples(byte[] buffer, int samples_a); + void SetVolume(int Vol); + void GetCurrentPosition(out int play_position, out int write_position); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ISoundPlayer.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ISoundPlayer.cs.meta new file mode 100644 index 00000000..b2ebcfaf --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ISoundPlayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bba7e9681312c1d4d800cd617b58c792 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ITimeSpan.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ITimeSpan.cs new file mode 100644 index 00000000..0a859319 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ITimeSpan.cs @@ -0,0 +1,25 @@ +namespace MAME.Core +{ + public interface ITimeSpan + { + /// + /// 启动以来的毫秒数 + /// + /// + uint GetTickCount(); + + /// + /// 计数器周期 + /// + /// + /// + bool QueryPerformanceCounter(ref long lpPerformanceCount); + + /// + /// 计数器间隔(Hz) + /// + /// + /// + bool QueryPerformanceFrequency(ref long PerformanceFrequency); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ITimeSpan.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ITimeSpan.cs.meta new file mode 100644 index 00000000..78e87993 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/ITimeSpan.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a447d669a9863d4b8dc1252df9f2d91 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IVideoPlayer.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IVideoPlayer.cs new file mode 100644 index 00000000..36febae0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IVideoPlayer.cs @@ -0,0 +1,7 @@ +namespace MAME.Core +{ + public interface IVideoPlayer + { + void SubmitVideo(int[] data,long frame_number); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IVideoPlayer.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IVideoPlayer.cs.meta new file mode 100644 index 00000000..16ac73db --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/IVideoPlayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7ef4d80d19cbea49a1bffccd435d91d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/MotionKey.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/MotionKey.cs new file mode 100644 index 00000000..f485628b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/MotionKey.cs @@ -0,0 +1,487 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace MAME.Core +{ + public static class MotionKey + { + + public const ulong None = (0L); + public const ulong P1_INSERT_COIN = (1L); + public const ulong P1_GAMESTART = (1L << 1); + public const ulong P1_UP = (1L << 2); + public const ulong P1_DOWN = (1L << 3); + public const ulong P1_LEFT = (1L << 4); + public const ulong P1_RIGHT = (1L << 5); + public const ulong P1_BTN_1 = (1L << 6); + public const ulong P1_BTN_2 = (1L << 7); + public const ulong P1_BTN_3 = (1L << 8); + public const ulong P1_BTN_4 = (1L << 9); + public const ulong P1_BTN_5 = (1L << 10); + public const ulong P1_BTN_6 = (1L << 11); + public const ulong P1_BTN_E = (1L << 12); + public const ulong P1_BTN_F = (1L << 13); + + + public const ulong P2_INSERT_COIN = (1L << (16)); + public const ulong P2_GAMESTART = (1L << (16 + 1)); + public const ulong P2_UP = (1L << (16 + 2)); + public const ulong P2_DOWN = (1L << (16 + 3)); + public const ulong P2_LEFT = (1L << (16 + 4)); + public const ulong P2_RIGHT = (1L << (16 + 5)); + public const ulong P2_BTN_1 = (1L << (16 + 6)); + public const ulong P2_BTN_2 = (1L << (16 + 7)); + public const ulong P2_BTN_3 = (1L << (16 + 8)); + public const ulong P2_BTN_4 = (1L << (16 + 9)); + public const ulong P2_BTN_5 = (1L << (16 + 10)); + public const ulong P2_BTN_6 = (1L << (16 + 11)); + public const ulong P2_BTN_E = (1L << (16 + 12)); + public const ulong P2_BTN_F = (1L << (16 + 13)); + + + public const ulong P3_INSERT_COIN = (1L << (32)); + public const ulong P3_GAMESTART = (1L << (32 + 1)); + public const ulong P3_UP = (1L << (32 + 2)); + public const ulong P3_DOWN = (1L << (32 + 3)); + public const ulong P3_LEFT = (1L << (32 + 4)); + public const ulong P3_RIGHT = (1L << (32 + 5)); + public const ulong P3_BTN_1 = (1L << (32 + 6)); + public const ulong P3_BTN_2 = (1L << (32 + 7)); + public const ulong P3_BTN_3 = (1L << (32 + 8)); + public const ulong P3_BTN_4 = (1L << (32 + 9)); + public const ulong P3_BTN_5 = (1L << (32 + 10)); + public const ulong P3_BTN_6 = (1L << (32 + 11)); + public const ulong P3_BTN_E = (1L << (32 + 12)); + public const ulong P3_BTN_F = (1L << (32 + 13)); + + + public const ulong P4_INSERT_COIN = (1L << (48)); + public const ulong P4_GAMESTART = (1L << (48 + 1)); + public const ulong P4_UP = (1L << (48 + 2)); + public const ulong P4_DOWN = (1L << (48 + 3)); + public const ulong P4_LEFT = (1L << (48 + 4)); + public const ulong P4_RIGHT = (1L << (48 + 5)); + public const ulong P4_BTN_1 = (1L << (48 + 6)); + public const ulong P4_BTN_2 = (1L << (48 + 7)); + public const ulong P4_BTN_3 = (1L << (48 + 8)); + public const ulong P4_BTN_4 = (1L << (48 + 9)); + public const ulong P4_BTN_5 = (1L << (48 + 10)); + public const ulong P4_BTN_6 = (1L << (48 + 11)); + public const ulong P4_BTN_E = (1L << (48 + 12)); + public const ulong P4_BTN_F = (1L << (48 + 13)); + + //预留按键 + //(1L << 14) + //(1L << 15) + //(1L << (16 + 14)) + //(1L << (16 + 15)) + //(1L << (32 + 14)) + //(1L << (32 + 15)) + //(1L << (48 + 14)) + //这个应该是不能用了-->(1L << (48 + 15)) + + public const ulong EMU_PAUSED = (1L << 14); + public const ulong Escape = (1L << 15); + public const ulong LeftShift = (1L << (16 + 14)); + public const ulong RightShift = (1L << (16 + 15)); + public const ulong FinalKey = (1L << (32 + 14)); + public const ulong F10 = (1L << (32 + 14)); + public const ulong F9 = (1L << (32 + 14)); + public const ulong F8 = (1L << (32 + 14)); + public const ulong F7 = (1L << (32 + 14)); + public const ulong F6 = (1L << (32 + 14)); + public const ulong F5 = (1L << (32 + 14)); + public const ulong F4 = (1L << (32 + 14)); + public const ulong F3 = (1L << (32 + 14)); + public const ulong F2 = (1L << (32 + 14)); + public const ulong F1 = (1L << (32 + 14)); + public const ulong UNKNOW_Q = (1L << (32 + 14)); + public const ulong UNKNOW_N = (1L << (32 + 14)); + public const ulong UNKNOW_R = (1L << (32 + 14)); + public const ulong UNKNOW_T = (1L << (32 + 14)); + public const ulong UNKNOW_M = (1L << (32 + 14)); + public const ulong UNKNOW_V = (1L << (32 + 14)); + public const ulong UNKNOW_B = (1L << (32 + 14)); + + public readonly static ulong[] AllNeedCheckList = new ulong[] + { + None, + P1_INSERT_COIN, + P1_GAMESTART, + P1_UP, + P1_DOWN, + P1_LEFT, + P1_RIGHT, + P1_BTN_1, + P1_BTN_2, + P1_BTN_3, + P1_BTN_4, + P1_BTN_5, + P1_BTN_6, + P1_BTN_E, + P1_BTN_F, + P2_INSERT_COIN, + P2_GAMESTART, + P2_UP, + P2_DOWN, + P2_LEFT, + P2_RIGHT, + P2_BTN_1, + P2_BTN_2, + P2_BTN_3, + P2_BTN_4, + P2_BTN_5, + P2_BTN_6, + P2_BTN_E, + P2_BTN_F, + P3_INSERT_COIN, + P3_GAMESTART, + P3_UP, + P3_DOWN, + P3_LEFT, + P3_RIGHT, + P3_BTN_1, + P3_BTN_2, + P3_BTN_3, + P3_BTN_4, + P3_BTN_5, + P3_BTN_6, + P3_BTN_E, + P3_BTN_F, + P4_INSERT_COIN, + P4_GAMESTART, + P4_UP, + P4_DOWN, + P4_LEFT, + P4_RIGHT, + P4_BTN_1, + P4_BTN_2, + P4_BTN_3, + P4_BTN_4, + P4_BTN_5, + P4_BTN_6, + P4_BTN_E, + P4_BTN_F, + EMU_PAUSED, + Escape, + LeftShift, + RightShift, + FinalKey, + F10, + F9, + F8, + F7, + F6, + F5, + F4, + F3, + F2, + F1, + UNKNOW_Q, + UNKNOW_N, + UNKNOW_R, + UNKNOW_T, + UNKNOW_M, + UNKNOW_V, + UNKNOW_B, + }; + + public static string GetKeyName(ulong key) + { + switch (key) + { + case MotionKey.None: return "None"; + case MotionKey.P1_INSERT_COIN: return "P1_INSERT_COIN"; + case MotionKey.P1_GAMESTART: return "P1_GAMESTART"; + case MotionKey.P1_UP: return "P1_UP"; + case MotionKey.P1_DOWN: return "P1_DOWN"; + case MotionKey.P1_LEFT: return "P1_LEFT"; + case MotionKey.P1_RIGHT: return "P1_RIGHT"; + case MotionKey.P1_BTN_1: return "P1_BTN_1"; + case MotionKey.P1_BTN_2: return "P1_BTN_2"; + case MotionKey.P1_BTN_3: return "P1_BTN_3"; + case MotionKey.P1_BTN_4: return "P1_BTN_4"; + case MotionKey.P1_BTN_5: return "P1_BTN_5"; + case MotionKey.P1_BTN_6: return "P1_BTN_6"; + case MotionKey.P1_BTN_E: return "P1_BTN_E"; + case MotionKey.P1_BTN_F: return "P1_BTN_F"; + case MotionKey.P2_INSERT_COIN: return "P2_INSERT_COIN"; + case MotionKey.P2_GAMESTART: return "P2_GAMESTART"; + case MotionKey.P2_UP: return "P2_UP"; + case MotionKey.P2_DOWN: return "P2_DOWN"; + case MotionKey.P2_LEFT: return "P2_LEFT"; + case MotionKey.P2_RIGHT: return "P2_RIGHT"; + case MotionKey.P2_BTN_1: return "P2_BTN_1"; + case MotionKey.P2_BTN_2: return "P2_BTN_2"; + case MotionKey.P2_BTN_3: return "P2_BTN_3"; + case MotionKey.P2_BTN_4: return "P2_BTN_4"; + case MotionKey.P2_BTN_5: return "P2_BTN_5"; + case MotionKey.P2_BTN_6: return "P2_BTN_6"; + case MotionKey.P2_BTN_E: return "P2_BTN_E"; + case MotionKey.P2_BTN_F: return "P2_BTN_F"; + case MotionKey.P3_INSERT_COIN: return "P3_INSERT_COIN"; + case MotionKey.P3_GAMESTART: return "P3_GAMESTART"; + case MotionKey.P3_UP: return "P3_UP"; + case MotionKey.P3_DOWN: return "P3_DOWN"; + case MotionKey.P3_LEFT: return "P3_LEFT"; + case MotionKey.P3_RIGHT: return "P3_RIGHT"; + case MotionKey.P3_BTN_1: return "P3_BTN_1"; + case MotionKey.P3_BTN_2: return "P3_BTN_2"; + case MotionKey.P3_BTN_3: return "P3_BTN_3"; + case MotionKey.P3_BTN_4: return "P3_BTN_4"; + case MotionKey.P3_BTN_5: return "P3_BTN_5"; + case MotionKey.P3_BTN_6: return "P3_BTN_6"; + case MotionKey.P3_BTN_E: return "P3_BTN_E"; + case MotionKey.P3_BTN_F: return "P3_BTN_F"; + case MotionKey.P4_INSERT_COIN: return "P4_INSERT_COIN"; + case MotionKey.P4_GAMESTART: return "P4_GAMESTART"; + case MotionKey.P4_UP: return "P4_UP"; + case MotionKey.P4_DOWN: return "P4_DOWN"; + case MotionKey.P4_LEFT: return "P4_LEFT"; + case MotionKey.P4_RIGHT: return "P4_RIGHT"; + case MotionKey.P4_BTN_1: return "P4_BTN_1"; + case MotionKey.P4_BTN_2: return "P4_BTN_2"; + case MotionKey.P4_BTN_3: return "P4_BTN_3"; + case MotionKey.P4_BTN_4: return "P4_BTN_4"; + case MotionKey.P4_BTN_5: return "P4_BTN_5"; + case MotionKey.P4_BTN_6: return "P4_BTN_6"; + case MotionKey.P4_BTN_E: return "P4_BTN_E"; + case MotionKey.P4_BTN_F: return "P4_BTN_F"; + case MotionKey.EMU_PAUSED: return "EMU_PAUSED"; + case MotionKey.Escape: return "Escape"; + case MotionKey.LeftShift: return "LeftShift"; + case MotionKey.RightShift: return "RightShift"; + case MotionKey.FinalKey: return "FinalKey"; + default: return "None"; + //case MotionKey.F10:return "F10"; + //case MotionKey.F9:return "F9"; + //case MotionKey.F8:return "F8"; + //case MotionKey.F7:return "F7"; + //case MotionKey.F6:return "F6"; + //case MotionKey.F5:return "F5"; + //case MotionKey.F4:return "F4"; + //case MotionKey.F3:return "F3"; + //case MotionKey.F2:return "F2"; + //case MotionKey.F1:return "F1"; + //case MotionKey.UNKNOW_Q:return "UNKNOW_Q"; + //case MotionKey.UNKNOW_N:return "UNKNOW_N"; + //case MotionKey.UNKNOW_R:return "UNKNOW_R"; + //case MotionKey.UNKNOW_T:return "UNKNOW_T"; + //case MotionKey.UNKNOW_M:return "UNKNOW_M"; + //case MotionKey.UNKNOW_V:return "UNKNOW_V"; + //case MotionKey.UNKNOW_B: return "UNKNOW_B"; + } + } + + //EMU_PAUSED = (1 << 36), + //F10 = (1 << 37), + //F9 = (1 << 38), + //F8 = (1 << 39), + //F7 = (1 << 40), + //F6 = (1 << 41), + //F5 = (1 << 42), + //F4 = (1 << 43), + //F3 = (1 << 44), + //F2 = (1 << 45), + //F1 = (1 << 46), + //UNKNOW_Q = (1 << 47), + //UNKNOW_N = (1 << 48), + //UNKNOW_R = (1 << 49), + //UNKNOW_T = (1 << 50), + //UNKNOW_M = (1 << 51), + //UNKNOW_V = (1 << 52), + //UNKNOW_B = (1 << 53), + //None = 0, + //P1_INSERT_COIN = 1, + //P1_GAMESTART = 2 << 1, + //P1_UP = 4, + //P1_DOWN = 8, + //P1_LEFT = 16, + //P1_RIGHT = 32, + //P1_BTN_1 = 64, + //P1_BTN_2 = 128, + //P1_BTN_3 = 256, + //P1_BTN_4 = 512, + //P1_BTN_5 = 1024, + //P1_BTN_6 = 4096, + //P1_UNKNOW_E = 8192, + //P1_UNKNOW_F, + //P2_INSERT_COIN, + //P2_GAMESTART, + //P2_UP, + //P2_DOWN, + //P2_LEFT, + //P2_RIGHT, + //P2_BTN_1, + //P2_BTN_2, + //P2_BTN_3, + //P2_BTN_4, + //P2_BTN_5, + //P2_BTN_6, + //P2_UNKNOW_E, + //P2_UNKNOW_F, + //UNKNOW_Q, + //UNKNOW_N, + //UNKNOW_R, + //UNKNOW_T, + //UNKNOW_M, + //UNKNOW_V, + //UNKNOW_B, + //F10, + //F9, + //F8, + //F7, + //F6, + //F5, + //F4, + //F3, + //F2, + //F1, + //Escape, + //LeftShift, + //RightShift, + ///// + ///// 用于标记最后一个 + ///// + //FinalKey, + + + + //EMU_PAUSED, + + } + + //[Flags] + //public enum MotionKey : long + //{ + // None = (0), + // P1_INSERT_COIN = (1), + // P1_GAMESTART = (1 << 1), + // P1_UP = (1 << 2), + // P1_DOWN = (1 << 3), + // P1_LEFT = (1 << 4), + // P1_RIGHT = (1 << 5), + // P1_BTN_1 = (1 << 6), + // P1_BTN_2 = (1 << 7), + // P1_BTN_3 = (1 << 8), + // P1_BTN_4 = (1 << 9), + // P1_BTN_5 = (1 << 10), + // P1_BTN_6 = (1 << 11), + // P1_UNKNOW_E = (1 << 12), + // P1_UNKNOW_F = (1 << 13), + // P2_INSERT_COIN = (1 << 14), + // P2_GAMESTART = (1 << 15), + // P2_UP = (1 << 16), + // P2_DOWN = (1 << 17), + // P2_LEFT = (1 << 18), + // P2_RIGHT = (1 << 19), + // P2_BTN_1 = (1 << 20), + // P2_BTN_2 = (1 << 21), + // P2_BTN_3 = (1 << 22), + // P2_BTN_4 = (1 << 23), + // P2_BTN_5 = (1 << 24), + // P2_BTN_6 = (1 << 25), + // P2_UNKNOW_E = (1 << 26), + // P2_UNKNOW_F = (1 << 27), + // Escape = (1 << 28), + // LeftShift = (1 << 29), + // RightShift = (1 << 30), + // FinalKey = (1 << 31), + + // EMU_PAUSED = 1<< 31, + // F10 = 1<< 31, + // F9 = 1<< 31, + // F8 = 1<< 31, + // F7 = 1<< 31, + // F6 = 1<< 31, + // F5 = 1<< 31, + // F4 = 1<< 31, + // F3 = 1<< 31, + // F2 = 1<< 31, + // F1 = 1<< 31, + // UNKNOW_Q = 1<< 31, + // UNKNOW_N = 1<< 31, + // UNKNOW_R = 1<< 31, + // UNKNOW_T = 1<< 31, + // UNKNOW_M = 1<< 31, + // UNKNOW_V = 1<< 31, + // UNKNOW_B = 1<< 31 + + // //EMU_PAUSED = (1 << 36), + // //F10 = (1 << 37), + // //F9 = (1 << 38), + // //F8 = (1 << 39), + // //F7 = (1 << 40), + // //F6 = (1 << 41), + // //F5 = (1 << 42), + // //F4 = (1 << 43), + // //F3 = (1 << 44), + // //F2 = (1 << 45), + // //F1 = (1 << 46), + // //UNKNOW_Q = (1 << 47), + // //UNKNOW_N = (1 << 48), + // //UNKNOW_R = (1 << 49), + // //UNKNOW_T = (1 << 50), + // //UNKNOW_M = (1 << 51), + // //UNKNOW_V = (1 << 52), + // //UNKNOW_B = (1 << 53), + // //None = 0, + // //P1_INSERT_COIN = 1, + // //P1_GAMESTART = 2 << 1, + // //P1_UP = 4, + // //P1_DOWN = 8, + // //P1_LEFT = 16, + // //P1_RIGHT = 32, + // //P1_BTN_1 = 64, + // //P1_BTN_2 = 128, + // //P1_BTN_3 = 256, + // //P1_BTN_4 = 512, + // //P1_BTN_5 = 1024, + // //P1_BTN_6 = 4096, + // //P1_UNKNOW_E = 8192, + // //P1_UNKNOW_F, + // //P2_INSERT_COIN, + // //P2_GAMESTART, + // //P2_UP, + // //P2_DOWN, + // //P2_LEFT, + // //P2_RIGHT, + // //P2_BTN_1, + // //P2_BTN_2, + // //P2_BTN_3, + // //P2_BTN_4, + // //P2_BTN_5, + // //P2_BTN_6, + // //P2_UNKNOW_E, + // //P2_UNKNOW_F, + // //UNKNOW_Q, + // //UNKNOW_N, + // //UNKNOW_R, + // //UNKNOW_T, + // //UNKNOW_M, + // //UNKNOW_V, + // //UNKNOW_B, + // //F10, + // //F9, + // //F8, + // //F7, + // //F6, + // //F5, + // //F4, + // //F3, + // //F2, + // //F1, + // //Escape, + // //LeftShift, + // //RightShift, + // ///// + // ///// 用于标记最后一个 + // ///// + // //FinalKey, + + + + // //EMU_PAUSED, + //} +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/MotionKey.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/MotionKey.cs.meta new file mode 100644 index 00000000..3c468ed5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/run_interface/MotionKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0582ddcb4c20372409c1153baadaaf1f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound.meta new file mode 100644 index 00000000..aaf1ce0d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11eb6572f34d52f4e8c62ec1fdb49bbd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/AY8910.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/AY8910.cs new file mode 100644 index 00000000..e9a33c16 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/AY8910.cs @@ -0,0 +1,606 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class AY8910 + { + public struct _ay_ym_param + { + public double r_up; + public double r_down; + public int res_count; + public double[] res; + } + public struct ay8910_context + { + public int streams; + public int ready; + public int register_latch; + public byte[] regs; + public int last_enable; + public int[] count; + public byte[] output; + public byte output_noise; + public int count_noise; + public int count_env; + public sbyte env_step; + public int env_volume; + public byte hold, alternate, attack, holding; + public int rng; + public byte env_step_mask; + public int step; + public int zero_is_off; + public byte[] vol_enabled; + public int[][] vol_table; + public int[][] env_table; + public int[] vol3d_table; + } + public static _ay_ym_param ay8910_param; + public static _ay_ym_param ym2149_param, ym2149_param_env; + public struct ay8910_interface + { + public int flags; + public int[] res_load; + public read8handler portAread; + public read8handler portBread; + public write8handler portAwrite; + public write8handler portBwrite; + } + public delegate byte read8handler(int offset); + public delegate void write8handler(int offset, byte value); + public static _ay_ym_param ay_ym_param, ay_ym_param_env; + public ay8910_context ay8910info; + public static AY8910[] AA8910 = new AY8910[3]; + public static ay8910_interface ay8910_intf; + + public sound_stream stream; + private int NOISE_ENABLEQ(int chan) + { + return (ay8910info.regs[7] >> (3 + chan)) & 1; + } + private int TONE_ENABLEQ(int chan) + { + return (ay8910info.regs[7] >> chan) & 1; + } + private int TONE_PERIOD(int chan) + { + return ay8910info.regs[chan << 1] | ((ay8910info.regs[(chan << 1) | 1] & 0x0f) << 8); + } + private int NOISE_PERIOD() + { + return ay8910info.regs[6] & 0x1f; + } + + //private int TONE_VOLUME(int chan) + //{ + // return ay8910info.regs[8 + chan] & 0x0f; + //} + + //private int TONE_ENVELOPE(int chan) + //{ + // return (ay8910info.regs[8 + chan] >> 4) & 1; + //} + + //用常量优化海量访问 + + private const int TONE_VOLUME_REG_OFFSET = 8; + private const int TONE_VOLUME_VOLUME_MASK = 0x0f; + private int TONE_VOLUME(int chan) + { + return ay8910info.regs[TONE_VOLUME_REG_OFFSET + chan] & TONE_VOLUME_VOLUME_MASK; + } + + private const int TONE_ENVELOPE_REG_OFFSET = 8; + private const int TONE_ENVELOPE_MOVE = 4; + private const int TONE_ENVELOPE_VOLUME_MASK = 0x01; + private int TONE_ENVELOPE(int chan) + { + return (ay8910info.regs[TONE_ENVELOPE_REG_OFFSET + chan] >> TONE_ENVELOPE_MOVE) & TONE_ENVELOPE_VOLUME_MASK; + } + + private int ENVELOPE_PERIOD() + { + return ay8910info.regs[11] | (ay8910info.regs[12] << 8); + } + public static void ay8910_start_ym(int chip_type, int sndindex, int clock, ay8910_interface intf) + { + int i; + AA8910[sndindex] = new AY8910(); + ym2149_param.r_up = 630; + ym2149_param.r_down = 801; + ym2149_param.res_count = 16; + ym2149_param.res = new double[] + { 73770, 37586, 27458, 21451, 15864, 12371, 8922, 6796, + 4763, 3521, 2403, 1737, 1123, 762, 438, 251, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,}; + ym2149_param_env.r_up = 630; + ym2149_param_env.r_down = 801; + ym2149_param_env.res_count = 32; + ym2149_param_env.res = new double[] + { 103350, 73770, 52657, 37586, 32125, 27458, 24269, 21451, + 18447, 15864, 14009, 12371, 10506, 8922, 7787, 6796, + 5689, 4763, 4095, 3521, 2909, 2403, 2043, 1737, + 1397, 1123, 925, 762, 578, 438, 332, 251 }; + ay8910_param.r_up = 5806; + ay8910_param.r_down = 300; + ay8910_param.res_count = 16; + ay8910_param.res = new double[] + { 118996, 42698, 33105, 24770, 17925, 12678, 9331, 5807, + 4936, 3038, 2129, 1658, 1271, 969, 781, 623, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,}; + AA8910[sndindex].ay8910info = new ay8910_context(); + AA8910[sndindex].ay8910info.regs = new byte[16]; + AA8910[sndindex].ay8910info.count = new int[3]; + AA8910[sndindex].ay8910info.output = new byte[3]; + AA8910[sndindex].ay8910info.vol_enabled = new byte[3]; + AA8910[sndindex].ay8910info.vol3d_table = new int[8 * 32 * 32 * 32]; + AA8910[sndindex].ay8910info.vol_table = new int[3][]; + for (i = 0; i < 3; i++) + { + AA8910[sndindex].ay8910info.vol_table[i] = new int[16]; + } + AA8910[sndindex].ay8910info.env_table = new int[3][]; + for (i = 0; i < 3; i++) + { + AA8910[sndindex].ay8910info.env_table[i] = new int[32]; + } + ay8910_intf = intf; + if ((ay8910_intf.flags & 2) != 0) + { + AA8910[sndindex].ay8910info.streams = 1; + } + else + { + AA8910[sndindex].ay8910info.streams = 3; + } + switch (chip_type) + { + case 6: + case 9: + AA8910[sndindex].ay8910info.step = 2; + ay_ym_param = ay8910_param; + ay_ym_param_env = ay8910_param; + AA8910[sndindex].ay8910info.zero_is_off = 1; + AA8910[sndindex].ay8910info.env_step_mask = 0x0f; + break; + case 10: + case 14: + case 17: + case 18: + case 16: + case 12: + case 13: + case 11: + default: + AA8910[sndindex].ay8910info.step = 1; + ay_ym_param = ym2149_param; + ay_ym_param_env = ym2149_param_env; + AA8910[sndindex].ay8910info.zero_is_off = 0; + AA8910[sndindex].ay8910info.env_step_mask = 0x1f; + break; + } + AA8910[sndindex].build_mixer_table(); + AA8910[sndindex].stream = new sound_stream(clock / 8, 0, AA8910[sndindex].ay8910info.streams, AA8910[sndindex].ay8910_update); + AA8910[sndindex].ay8910_set_clock_ym(clock); + } + private void build_3D_table(double rl, int normalize, double factor, int zero_is_off) + { + int j, j1, j2, j3, e, indx; + double rt, rw, n; + double min = 10.0, max = 0.0; + double[] temp = new double[8 * 32 * 32 * 32]; + for (e = 0; e < 8; e++) + { + for (j1 = 0; j1 < 32; j1++) + { + for (j2 = 0; j2 < 32; j2++) + { + for (j3 = 0; j3 < 32; j3++) + { + if (zero_is_off != 0) + { + n = (j1 != 0 || (e & 0x01) != 0) ? 1 : 0; + n += (j2 != 0 || (e & 0x02) != 0) ? 1 : 0; + n += (j3 != 0 || (e & 0x04) != 0) ? 1 : 0; + } + else + { + n = 3.0; + } + rt = n / ay_ym_param.r_up + 3.0 / ay_ym_param.r_down + 1.0 / rl; + rw = n / ay_ym_param.r_up; + rw += 1.0 / (((e & 0x01) != 0) ? ay_ym_param_env.res[j1] : ay_ym_param.res[j1]); + rt += 1.0 / (((e & 0x01) != 0) ? ay_ym_param_env.res[j1] : ay_ym_param.res[j1]); + rw += 1.0 / (((e & 0x02) != 0) ? ay_ym_param_env.res[j2] : ay_ym_param.res[j2]); + rt += 1.0 / (((e & 0x02) != 0) ? ay_ym_param_env.res[j2] : ay_ym_param.res[j2]); + rw += 1.0 / (((e & 0x04) != 0) ? ay_ym_param_env.res[j3] : ay_ym_param.res[j3]); + rt += 1.0 / (((e & 0x04) != 0) ? ay_ym_param_env.res[j3] : ay_ym_param.res[j3]); + indx = (e << 15) | (j3 << 10) | (j2 << 5) | j1; + temp[indx] = rw / rt; + if (temp[indx] < min) + { + min = temp[indx]; + } + if (temp[indx] > max) + { + max = temp[indx]; + } + } + } + } + } + if (normalize != 0) + { + for (j = 0; j < 32 * 32 * 32 * 8; j++) + { + ay8910info.vol3d_table[j] = (int)(0x7fff * (((temp[j] - min) / (max - min))) * factor); + } + } + else + { + for (j = 0; j < 32 * 32 * 32 * 8; j++) + { + ay8910info.vol3d_table[j] = (int)(0x7fff * temp[j]); + } + } + } + public static void build_single_table(double rl, _ay_ym_param par, int normalize, int[] ii, int zero_is_off) + { + int j; + double rt, rw = 0; + double[] temp = new double[32]; + double min = 10.0, max = 0.0; + for (j = 0; j < par.res_count; j++) + { + rt = 1.0 / par.r_down + 1.0 / rl; + rw = 1.0 / par.res[j]; + rt += 1.0 / par.res[j]; + if (!((zero_is_off != 0) && (j == 0))) + { + rw += 1.0 / par.r_up; + rt += 1.0 / par.r_up; + } + temp[j] = rw / rt; + if (temp[j] < min) + { + min = temp[j]; + } + if (temp[j] > max) + { + max = temp[j]; + } + } + if (normalize != 0) + { + for (j = 0; j < par.res_count; j++) + { + ii[j] = (int)(0x7fff * (((temp[j] - min) / (max - min)) - 0.25) * 0.5); + } + } + else + { + for (j = 0; j < par.res_count; j++) + { + ii[j] = (int)(0x7fff * temp[j]); + } + } + } + private int mix_3D() + { + int indx = 0, chan; + for (chan = 0; chan < 3; chan++) + { + if (TONE_ENVELOPE(chan) != 0) + { + indx |= ((1 << (chan + 15)) | ((ay8910info.vol_enabled[chan] != 0) ? ay8910info.env_volume << (chan * 5) : 0)); + } + else + { + indx |= ((ay8910info.vol_enabled[chan] != 0) ? TONE_VOLUME(chan) << (chan * 5) : 0); + } + } + return ay8910info.vol3d_table[indx]; + } + private void ay8910_write_reg(int r, byte v) + { + ay8910info.regs[r] = v; + switch (r) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + case 7: + if ((ay8910info.last_enable == -1) || ((ay8910info.last_enable & 0x40) != (ay8910info.regs[7] & 0x40))) + { + if (ay8910_intf.portAwrite != null) + { + ay8910_intf.portAwrite(0, (ay8910info.regs[7] & 0x40) != 0 ? ay8910info.regs[14] : (byte)0xff); + } + } + if ((ay8910info.last_enable == -1) || ((ay8910info.last_enable & 0x80) != (ay8910info.regs[7] & 0x80))) + { + if (ay8910_intf.portBwrite != null) + { + ay8910_intf.portBwrite(0, (ay8910info.regs[7] & 0x80) != 0 ? ay8910info.regs[15] : (byte)0xff); + } + } + ay8910info.last_enable = ay8910info.regs[7]; + break; + case 13: + ay8910info.attack = ((ay8910info.regs[13] & 0x04) != 0) ? ay8910info.env_step_mask : (byte)0x00; + if ((ay8910info.regs[13] & 0x08) == 0) + { + ay8910info.hold = 1; + ay8910info.alternate = ay8910info.attack; + } + else + { + ay8910info.hold = (byte)(ay8910info.regs[13] & 0x01); + ay8910info.alternate = (byte)(ay8910info.regs[13] & 0x02); + } + ay8910info.env_step = (sbyte)ay8910info.env_step_mask; + ay8910info.holding = 0; + ay8910info.env_volume = (ay8910info.env_step ^ ay8910info.attack); + break; + case 14: + if ((ay8910info.regs[7] & 0x40) != 0) + { + if (ay8910_intf.portAwrite != null) + { + ay8910_intf.portAwrite(0, ay8910info.regs[14]); + } + } + break; + case 15: + if ((ay8910info.regs[7] & 0x80) != 0) + { + if (ay8910_intf.portBwrite != null) + { + ay8910_intf.portBwrite(0, ay8910info.regs[15]); + } + } + break; + } + } + public void ay8910_update(int offset, int length) + { + int chan, i, j; + if (ay8910info.ready == 0) + { + for (chan = 0; chan < ay8910info.streams; chan++) + { + for (j = 0; j < length; j++) + { + stream.streamoutput_Ptrs[chan][offset + j] = 0; + } + } + } + for (i = 0; i < length; i++) + { + for (chan = 0; chan < 3; chan++) + { + ay8910info.count[chan]++; + if (ay8910info.count[chan] >= TONE_PERIOD(chan)) + { + ay8910info.output[chan] ^= 1; + ay8910info.count[chan] = 0; ; + } + } + ay8910info.count_noise++; + if (ay8910info.count_noise >= NOISE_PERIOD()) + { + if (((ay8910info.rng + 1) & 2) != 0) + { + ay8910info.output_noise ^= 1; + } + if ((ay8910info.rng & 1) != 0) + { + ay8910info.rng ^= 0x24000; + } + ay8910info.rng >>= 1; + ay8910info.count_noise = 0; + } + for (chan = 0; chan < 3; chan++) + { + ay8910info.vol_enabled[chan] = (byte)((ay8910info.output[chan] | TONE_ENABLEQ(chan)) & (ay8910info.output_noise | NOISE_ENABLEQ(chan))); + } + if (ay8910info.holding == 0) + { + ay8910info.count_env++; + if (ay8910info.count_env >= ENVELOPE_PERIOD() * ay8910info.step) + { + ay8910info.count_env = 0; + ay8910info.env_step--; + if (ay8910info.env_step < 0) + { + if (ay8910info.hold != 0) + { + if (ay8910info.alternate != 0) + { + ay8910info.attack ^= ay8910info.env_step_mask; + } + ay8910info.holding = 1; + ay8910info.env_step = 0; + } + else + { + if (ay8910info.alternate != 0 && (ay8910info.env_step & (ay8910info.env_step_mask + 1)) != 0) + { + ay8910info.attack ^= ay8910info.env_step_mask; + } + ay8910info.env_step &= (sbyte)ay8910info.env_step_mask; + } + } + } + } + ay8910info.env_volume = (ay8910info.env_step ^ ay8910info.attack); + if (ay8910info.streams == 3) + { + for (chan = 0; chan < 3; chan++) + { + if (TONE_ENVELOPE(chan) != 0) + { + int i1 = ay8910info.env_table[chan][ay8910info.vol_enabled[chan] != 0 ? ay8910info.env_volume : 0]; + stream.streamoutput_Ptrs[chan][offset] = ay8910info.env_table[chan][ay8910info.vol_enabled[chan] != 0 ? ay8910info.env_volume : 0]; + } + else + { + int i1 = ay8910info.vol_table[chan][ay8910info.vol_enabled[chan] != 0 ? TONE_VOLUME(chan) : 0]; + stream.streamoutput_Ptrs[chan][offset] = ay8910info.vol_table[chan][ay8910info.vol_enabled[chan] != 0 ? TONE_VOLUME(chan) : 0]; + } + } + } + else + { + stream.streamoutput_Ptrs[0][offset] = mix_3D(); + } + offset++; + } + } + public void build_mixer_table() + { + int normalize = 0; + int chan; + if ((ay8910_intf.flags & 1) != 0) + { + normalize = 1; + } + for (chan = 0; chan < 3; chan++) + { + build_single_table(ay8910_intf.res_load[chan], ay_ym_param, normalize, ay8910info.vol_table[chan], ay8910info.zero_is_off); + build_single_table(ay8910_intf.res_load[chan], ay_ym_param_env, normalize, ay8910info.env_table[chan], 0); + } + build_3D_table(ay8910_intf.res_load[0], normalize, 3, ay8910info.zero_is_off); + } + public void ay8910_reset_ym() + { + int i; + ay8910info.register_latch = 0; + ay8910info.rng = 1; + ay8910info.output[0] = 0; + ay8910info.output[1] = 0; + ay8910info.output[2] = 0; + ay8910info.count[0] = 0; + ay8910info.count[1] = 0; + ay8910info.count[2] = 0; + ay8910info.count_noise = 0; + ay8910info.count_env = 0; + ay8910info.output_noise = 0x01; + for (i = 0; i < 14; i++) + { + ay8910_write_reg(i, 0); + } + ay8910info.ready = 1; + } + public void ay8910_set_clock_ym(int clock) + { + int rate1, rate2; + rate1 = (stream.new_sample_rate != 0) ? stream.new_sample_rate : stream.sample_rate; + rate2 = clock / 8; + if (rate2 != rate1) + { + stream.new_sample_rate = rate2; + } + } + public void ay8910_write_ym(int addr, byte data) + { + if ((addr & 1) != 0) + { + int r = ay8910info.register_latch; + if (r > 15) + { + return; + } + if (r == 13 || ay8910info.regs[r] != data) + { + stream.stream_update(); + } + ay8910_write_reg(r, data); + } + else + { + ay8910info.register_latch = data & 0x0f; + } + } + public byte ay8910_read_ym() + { + int r = ay8910info.register_latch; + if (r > 15) + { + return 0; + } + switch (r) + { + case 14: + if (ay8910_intf.portAread != null) + { + ay8910info.regs[14] = ay8910_intf.portAread(0); + } + break; + case 15: + if (ay8910_intf.portBread != null) + { + ay8910info.regs[15] = ay8910_intf.portBread(0); + } + break; + } + return ay8910info.regs[r]; + } + public void SaveStateBinary(BinaryWriter writer) + { + int i; + writer.Write(ay8910info.register_latch); + writer.Write(ay8910info.regs, 0, 16); + for (i = 0; i < 3; i++) + { + writer.Write(ay8910info.count[i]); + } + writer.Write(ay8910info.output, 0, 3); + writer.Write(ay8910info.output_noise); + writer.Write(ay8910info.count_noise); + writer.Write(ay8910info.count_env); + writer.Write(ay8910info.env_step); + writer.Write(ay8910info.env_volume); + writer.Write(ay8910info.hold); + writer.Write(ay8910info.alternate); + writer.Write(ay8910info.attack); + writer.Write(ay8910info.holding); + writer.Write(ay8910info.rng); + writer.Write(ay8910info.vol_enabled, 0, 3); + } + public void LoadStateBinary(BinaryReader reader) + { + int i; + ay8910info.register_latch = reader.ReadInt32(); + ay8910info.regs = reader.ReadBytes(16); + for (i = 0; i < 3; i++) + { + ay8910info.count[i] = reader.ReadInt32(); + } + ay8910info.output = reader.ReadBytes(3); + ay8910info.output_noise = reader.ReadByte(); + ay8910info.count_noise = reader.ReadInt32(); + ay8910info.count_env = reader.ReadInt32(); + ay8910info.env_step = reader.ReadSByte(); + ay8910info.env_volume = reader.ReadInt32(); + ay8910info.hold = reader.ReadByte(); + ay8910info.alternate = reader.ReadByte(); + ay8910info.attack = reader.ReadByte(); + ay8910info.holding = reader.ReadByte(); + ay8910info.rng = reader.ReadInt32(); + ay8910info.vol_enabled = reader.ReadBytes(3); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/AY8910.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/AY8910.cs.meta new file mode 100644 index 00000000..94d4f6df --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/AY8910.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db4d2d67345aaf149a9f7a92ef42491c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/DAC.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/DAC.cs new file mode 100644 index 00000000..86b1f393 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/DAC.cs @@ -0,0 +1,69 @@ +using System.IO; + +namespace MAME.Core +{ + public class DAC + { + public struct dac_info + { + public sound_stream channel; + public short output; + public short[] UnsignedVolTable; + public short[] SignedVolTable; + }; + public static dac_info dac1; + public unsafe static void DAC_update(int offset, int length) + { + ; + short out1 = dac1.output; + int i; + for (i = 0; i < length; i++) + { + Sound.dacstream.streamoutput_Ptrs[0][offset + i] = out1; + } + } + public static void dac_signed_data_w(int num, byte data) + { + short out1 = dac1.SignedVolTable[data]; + if (dac1.output != out1) + { + Sound.dacstream.stream_update(); + dac1.output = out1; + } + } + public static void dac_signed_data_16_w(int num, ushort data) + { + short out1 = (short)((uint)data - (uint)0x08000); + if (dac1.output != out1) + { + Sound.dacstream.stream_update(); + dac1.output = out1; + } + } + public static void DAC_build_voltable() + { + int i; + for (i = 0; i < 256; i++) + { + dac1.UnsignedVolTable[i] = (short)(i * 0x101 / 2); + dac1.SignedVolTable[i] = (short)(i * 0x101 - 0x8000); + } + } + public static void dac_start() + { + dac1 = new dac_info(); + dac1.UnsignedVolTable = new short[256]; + dac1.SignedVolTable = new short[256]; + DAC_build_voltable(); + dac1.output = 0; + } + public static void SaveStateBinary(BinaryWriter writer) + { + writer.Write(DAC.dac1.output); + } + public static void LoadStateBinary(BinaryReader reader) + { + dac1.output = reader.ReadInt16(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/DAC.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/DAC.cs.meta new file mode 100644 index 00000000..c1175228 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/DAC.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7566cac50e0cdca4baa19616153dc98d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs new file mode 100644 index 00000000..e9c81e9b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs @@ -0,0 +1,1382 @@ +using System; + +namespace MAME.Core +{ + public class FM + { + public class FM_OPN + { + public int type; + public FM_ST ST; + public FM_3SLOT SL3; + public FM_CH[] CH; + public uint[] pan; + public uint eg_cnt; + public uint eg_timer; + public uint eg_timer_add; + public uint eg_timer_overflow; + public uint[] fn_table; + public int lfo_cnt; + public int lfo_inc; + public int[] lfo_freq; + public int[,] idt_tab; + private int[] iconnect1 = new int[8], iconnect2 = new int[8], iconnect3 = new int[8], iconnect4 = new int[6], imem = new int[13]; + public FM_OPN() + { + int i; + CH = new FM_CH[6]; + for (i = 0; i < 6; i++) + { + CH[i].SLOT = new FM_SLOT[4]; + } + idt_tab = new int[6, 4]; + ST = new FM_ST(); + ST.dt_tab2 = new int[8, 32]; + SL3 = new FM_3SLOT(); + SL3.fc = new uint[3]; + SL3.kcode = new byte[3]; + SL3.block_fnum = new uint[3]; + pan = new uint[12]; + fn_table = new uint[4096]; + lfo_freq = new int[8]; + ST.timer_handler = null; + ST.IRQ_Handler = null; + ST.SSG.set_clock = null; + ST.SSG.write = null; + ST.SSG.read = null; + ST.SSG.reset = null; + } + private void FM_STATUS_SET(byte flag) + { + ST.status |= flag; + if ((ST.irq == 0) && ((ST.status & ST.irqmask) != 0)) + { + ST.irq = 1; + if (ST.IRQ_Handler != null) + { + ST.IRQ_Handler(1); + } + } + } + public void FM_STATUS_RESET(byte flag) + { + ST.status &= (byte)~flag; + if ((ST.irq != 0) && ((ST.status & ST.irqmask) == 0)) + { + ST.irq = 0; + if (ST.IRQ_Handler != null) + { + ST.IRQ_Handler(0); + } + } + } + public void FM_IRQMASK_SET(byte flag) + { + ST.irqmask = flag; + FM_STATUS_SET(0); + FM_STATUS_RESET(0); + } + private void set_timers(byte v) + { + ST.mode = v; + if ((v & 0x20) != 0) + { + FM_STATUS_RESET(0x02); + } + if ((v & 0x10) != 0) + { + FM_STATUS_RESET(0x01); + } + if ((v & 0x02) != 0) + { + if (ST.TBC == 0) + { + ST.TBC = (256 - ST.TB) << 4; + ST.timer_handler(1, ST.TBC * ST.timer_prescaler, ST.clock); + } + } + else + { + if (ST.TBC != 0) + { + ST.TBC = 0; + ST.timer_handler(1, 0, ST.clock); + } + } + if ((v & 0x01) != 0) + { + if (ST.TAC == 0) + { + ST.TAC = (1024 - ST.TA); + ST.timer_handler(0, ST.TAC * ST.timer_prescaler, ST.clock); + } + } + else + { + if (ST.TAC != 0) + { + ST.TAC = 0; + ST.timer_handler(0, 0, ST.clock); + } + } + } + public void TimerAOver() + { + if ((ST.mode & 0x04) != 0) + { + FM_STATUS_SET(0x01); + } + ST.TAC = (1024 - ST.TA); + ST.timer_handler(0, ST.TAC * ST.timer_prescaler, ST.clock); + } + public void TimerBOver() + { + if ((ST.mode & 0x08) != 0) + { + FM_STATUS_SET(0x02); + } + ST.TBC = (256 - ST.TB) << 4; + ST.timer_handler(1, ST.TBC * ST.timer_prescaler, ST.clock); + } + public void FM_BUSY_CLEAR() + { + ST.busy_expiry_time = Attotime.ATTOTIME_ZERO; + } + public byte FM_STATUS_FLAG() + { + if (Attotime.attotime_compare(ST.busy_expiry_time, Attotime.ATTOTIME_ZERO) != 0) + { + if (Attotime.attotime_compare(ST.busy_expiry_time, EmuTimer.get_current_time()) > 0) + { + return (byte)(ST.status | 0x80); + } + FM_BUSY_CLEAR(); + } + return ST.status; + } + public void FM_BUSY_SET(int busyclock) + { + Atime expiry_period = Attotime.attotime_mul(Attotime.ATTOTIME_IN_HZ(ST.clock), (uint)(busyclock * ST.timer_prescaler)); + ST.busy_expiry_time = Attotime.attotime_add(EmuTimer.get_current_time(), expiry_period); + } + private void FM_KEYON(int type, int c, int s) + { + if (CH[c].SLOT[s].key == 0) + { + CH[c].SLOT[s].key = 1; + CH[c].SLOT[s].phase = 0; + if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) + { + if ((CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr) < 32 + 62) + { + CH[c].SLOT[s].state = 4; + CH[c].SLOT[s].volume = 1023; + } + else + { + CH[c].SLOT[s].state = 3; + CH[c].SLOT[s].volume = 0; + } + } + else + { + CH[c].SLOT[s].state = 4; + } + } + } + private void FM_KEYOFF(int c, int s) + { + if (CH[c].SLOT[s].key != 0) + { + CH[c].SLOT[s].key = 0; + if (CH[c].SLOT[s].state > 1) + { + CH[c].SLOT[s].state = 1; + } + } + } + private void set_value1(int c) + { + if (iconnect1[c] == 12) + { + out_fm[11] = out_fm[9] = out_fm[10] = CH[c].op1_out0; + } + else + { + out_fm[iconnect1[c]] = CH[c].op1_out0; + } + } + private void set_mem(int c) + { + if (imem[c] == 8 || imem[c] == 10 || imem[c] == 11) + { + out_fm[imem[c]] = CH[c].mem_value; + } + } + private void setup_connection(int ch) + { + switch (CH[ch].ALGO) + { + case 0: + iconnect1[ch] = 9; + iconnect2[ch] = 11; + iconnect3[ch] = 10; + imem[ch] = 8; + break; + case 1: + iconnect1[ch] = 11; + iconnect2[ch] = 11; + iconnect3[ch] = 10; + imem[ch] = 8; + break; + case 2: + iconnect1[ch] = 10; + iconnect2[ch] = 11; + iconnect3[ch] = 10; + imem[ch] = 8; + break; + case 3: + iconnect1[ch] = 9; + iconnect2[ch] = 11; + iconnect3[ch] = 10; + imem[ch] = 10; + break; + case 4: + iconnect1[ch] = 9; + iconnect2[ch] = ch; + iconnect3[ch] = 10; + imem[ch] = 11; + break; + case 5: + iconnect1[ch] = 12; + iconnect2[ch] = ch; + iconnect3[ch] = ch; + imem[ch] = 8; + break; + case 6: + iconnect1[ch] = 9; + iconnect2[ch] = ch; + iconnect3[ch] = ch; + imem[ch] = 11; + break; + case 7: + iconnect1[ch] = ch; + iconnect2[ch] = ch; + iconnect3[ch] = ch; + imem[ch] = 11; + break; + } + iconnect4[ch] = ch; + } + private void set_det_mul(int c, int s, byte v) + { + CH[c].SLOT[s].mul = ((v & 0x0f) != 0) ? (v & 0x0f) * 2 : 1; + idt_tab[c, s] = (v >> 4) & 7; + CH[c].SLOT[0].Incr = -1; + } + private void set_tl(int c, int s, byte v) + { + CH[c].SLOT[s].tl = (v & 0x7f) << (10 - 7); + } + private void set_ar_ksr(int c, int s, byte v) + { + byte old_KSR = CH[c].SLOT[s].KSR; + CH[c].SLOT[s].ar = ((v & 0x1f) != 0) ? 32 + ((v & 0x1f) << 1) : 0; + CH[c].SLOT[s].KSR = (byte)(3 - (v >> 6)); + if (CH[c].SLOT[s].KSR != old_KSR) + { + CH[c].SLOT[0].Incr = -1; + } + if ((CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr) < 32 + 62) + { + CH[c].SLOT[s].eg_sh_ar = eg_rate_shift[CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr]; + if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) + { + CH[c].SLOT[s].eg_sel_ar = eg_rate_select2612[CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr]; + } + else + { + CH[c].SLOT[s].eg_sel_ar = eg_rate_select[CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr]; + } + } + else + { + CH[c].SLOT[s].eg_sh_ar = 0; + CH[c].SLOT[s].eg_sel_ar = 17 * 8; + } + } + private void set_dr(int c, int s, byte v) + { + CH[c].SLOT[s].d1r = ((v & 0x1f) != 0) ? 32 + ((v & 0x1f) << 1) : 0; + CH[c].SLOT[s].eg_sh_d1r = eg_rate_shift[CH[c].SLOT[s].d1r + CH[c].SLOT[s].ksr]; + if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) + { + CH[c].SLOT[s].eg_sel_d1r = eg_rate_select2612[CH[c].SLOT[s].d1r + CH[c].SLOT[s].ksr]; + } + else + { + CH[c].SLOT[s].eg_sel_d1r = eg_rate_select[CH[c].SLOT[s].d1r + CH[c].SLOT[s].ksr]; + } + } + private void set_sr(int c, int s, byte v) + { + CH[c].SLOT[s].d2r = ((v & 0x1f) != 0) ? 32 + ((v & 0x1f) << 1) : 0; + CH[c].SLOT[s].eg_sh_d2r = eg_rate_shift[CH[c].SLOT[s].d2r + CH[c].SLOT[s].ksr]; + if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) + { + CH[c].SLOT[s].eg_sel_d2r = eg_rate_select2612[CH[c].SLOT[s].d2r + CH[c].SLOT[s].ksr]; + } + else + { + CH[c].SLOT[s].eg_sel_d2r = eg_rate_select[CH[c].SLOT[s].d2r + CH[c].SLOT[s].ksr]; + } + } + private void set_sl_rr(int c, int s, byte v) + { + CH[c].SLOT[s].sl = sl_table[v >> 4]; + CH[c].SLOT[s].rr = 34 + ((v & 0x0f) << 2); + CH[c].SLOT[s].eg_sh_rr = eg_rate_shift[CH[c].SLOT[s].rr + CH[c].SLOT[s].ksr]; + if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) + { + CH[c].SLOT[s].eg_sel_rr = eg_rate_select2612[CH[c].SLOT[s].rr + CH[c].SLOT[s].ksr]; + } + else + { + CH[c].SLOT[s].eg_sel_rr = eg_rate_select[CH[c].SLOT[s].rr + CH[c].SLOT[s].ksr]; + } + } + public void advance_lfo() + { + byte pos; + byte prev_pos; + if (lfo_inc != 0) + { + prev_pos = (byte)(lfo_cnt >> 24 & 127); + lfo_cnt += lfo_inc; + pos = (byte)((lfo_cnt >> 24) & 127); + if (pos < 64) + { + LFO_AM = (pos & 63) * 2; + } + else + { + LFO_AM = 126 - ((pos & 63) * 2); + } + prev_pos >>= 2; + pos >>= 2; + LFO_PM = pos; + } + else + { + LFO_AM = 0; + LFO_PM = 0; + } + } + public void advance_eg_channel(int c) + { + uint out1; + byte swap_flag = 0; + int i; + for (i = 0; i < 4; i++) + { + switch (CH[c].SLOT[i].state) + { + case 4: + if ((eg_cnt & ((1 << CH[c].SLOT[i].eg_sh_ar) - 1)) == 0) + { + CH[c].SLOT[i].volume += (~CH[c].SLOT[i].volume * (eg_inc[CH[c].SLOT[i].eg_sel_ar + ((eg_cnt >> CH[c].SLOT[i].eg_sh_ar) & 7)])) >> 4; + if (CH[c].SLOT[i].volume <= 0) + { + CH[c].SLOT[i].volume = 0; + CH[c].SLOT[i].state = 3; + } + } + break; + + case 3: + if ((CH[c].SLOT[i].ssg & 0x08) != 0) + { + if ((eg_cnt & ((1 << CH[c].SLOT[i].eg_sh_d1r) - 1)) == 0) + { + CH[c].SLOT[i].volume += 4 * eg_inc[CH[c].SLOT[i].eg_sel_d1r + ((eg_cnt >> CH[c].SLOT[i].eg_sh_d1r) & 7)]; + if (CH[c].SLOT[i].volume >= CH[c].SLOT[i].sl) + { + CH[c].SLOT[i].state = 2; + } + } + } + else + { + if ((eg_cnt & ((1 << CH[c].SLOT[i].eg_sh_d1r) - 1)) == 0) + { + CH[c].SLOT[i].volume += eg_inc[CH[c].SLOT[i].eg_sel_d1r + ((eg_cnt >> CH[c].SLOT[i].eg_sh_d1r) & 7)]; + if (CH[c].SLOT[i].volume >= CH[c].SLOT[i].sl) + { + CH[c].SLOT[i].state = 2; + } + } + } + break; + case 2: + if ((CH[c].SLOT[i].ssg & 0x08) != 0) + { + if ((eg_cnt & ((1 << CH[c].SLOT[i].eg_sh_d2r) - 1)) == 0) + { + CH[c].SLOT[i].volume += 4 * eg_inc[CH[c].SLOT[i].eg_sel_d2r + ((eg_cnt >> CH[c].SLOT[i].eg_sh_d2r) & 7)]; + if (CH[c].SLOT[i].volume >= 512) + { + CH[c].SLOT[i].volume = 0x3ff; + if ((CH[c].SLOT[i].ssg & 0x01) != 0) + { + if ((CH[c].SLOT[i].ssgn & 1) != 0) + { + + } + else + { + swap_flag = (byte)((CH[c].SLOT[i].ssg & 0x02) | 1); + } + } + else + { + CH[c].SLOT[i].phase = 0; + CH[c].SLOT[i].volume = 511; + CH[c].SLOT[i].state = 4; + swap_flag = (byte)(CH[c].SLOT[i].ssg & 0x02); /* bit 1 = alternate */ + } + } + } + } + else + { + if ((eg_cnt & ((1 << CH[c].SLOT[i].eg_sh_d2r) - 1)) == 0) + { + CH[c].SLOT[i].volume += eg_inc[CH[c].SLOT[i].eg_sel_d2r + ((eg_cnt >> CH[c].SLOT[i].eg_sh_d2r) & 7)]; + if (CH[c].SLOT[i].volume >= 0x3ff) + { + CH[c].SLOT[i].volume = 0x3ff; + } + } + } + break; + case 1: + if ((eg_cnt & ((1 << CH[c].SLOT[i].eg_sh_rr) - 1)) == 0) + { + CH[c].SLOT[i].volume += eg_inc[CH[c].SLOT[i].eg_sel_rr + ((eg_cnt >> CH[c].SLOT[i].eg_sh_rr) & 7)]; + if (CH[c].SLOT[i].volume >= 0x3ff) + { + CH[c].SLOT[i].volume = 0x3ff; + CH[c].SLOT[i].state = 0; + } + } + break; + } + out1 = (uint)(CH[c].SLOT[i].tl + ((uint)CH[c].SLOT[i].volume)); + if (((CH[c].SLOT[i].ssg & 0x08) != 0) && ((CH[c].SLOT[i].ssgn & 2) != 0) && (CH[c].SLOT[i].state != 0)) + { + out1 ^= 511; + } + CH[c].SLOT[i].vol_out = out1; + CH[c].SLOT[i].ssgn ^= swap_flag; + } + } + private uint volume_calc(int c, int s) + { + int AM = LFO_AM >> CH[c].ams; + return (uint)(CH[c].SLOT[s].vol_out + (AM & CH[c].SLOT[s].AMmask)); + } + private void update_phase_lfo_slot(int s, int pms, uint block_fnum) + { + uint fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; + int lfo_fn_table_index_offset = lfo_pm_table[fnum_lfo + pms + LFO_PM]; + if (lfo_fn_table_index_offset != 0) + { + byte blk; + uint fn; + int kc, fc; + block_fnum = (uint)(block_fnum * 2 + lfo_fn_table_index_offset); + blk = (byte)((block_fnum & 0x7000) >> 12); + fn = block_fnum & 0xfff; + kc = (blk << 2) | opn_fktable[fn >> 8]; + fc = (int)((fn_table[fn] >> (7 - blk)) + ST.dt_tab2[idt_tab[2, 0], kc]); + if (fc < 0) + { + fc += fn_max; + } + CH[2].SLOT[s].phase += (uint)((fc * CH[2].SLOT[s].mul) >> 1); + } + else + { + CH[2].SLOT[s].phase += (uint)CH[2].SLOT[s].Incr; + } + } + private void update_phase_lfo_channel(FM_CH[] CH, int c) + { + uint block_fnum = CH[c].block_fnum; + uint fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; + int lfo_fn_table_index_offset = lfo_pm_table[fnum_lfo + CH[c].pms + LFO_PM]; + if (lfo_fn_table_index_offset != 0) + { + byte blk; + uint fn; + int kc, fc, finc; + block_fnum = (uint)(block_fnum * 2 + lfo_fn_table_index_offset); + blk = (byte)((block_fnum & 0x7000) >> 12); + fn = block_fnum & 0xfff; + kc = (blk << 2) | opn_fktable[fn >> 8]; + fc = (int)(fn_table[fn] >> (7 - blk)); + finc = fc + ST.dt_tab2[idt_tab[c, 0], kc]; + if (finc < 0) + { + finc += fn_max; + } + CH[c].SLOT[0].phase += (uint)((finc * CH[c].SLOT[0].mul) >> 1); + finc = fc + ST.dt_tab2[idt_tab[c, 2], kc]; + if (finc < 0) + { + finc += fn_max; + } + CH[c].SLOT[2].phase += (uint)((finc * CH[c].SLOT[2].mul) >> 1); + finc = fc + ST.dt_tab2[idt_tab[c, 1], kc]; + if (finc < 0) + { + finc += fn_max; + } + CH[c].SLOT[1].phase += (uint)((finc * CH[c].SLOT[1].mul) >> 1); + finc = fc + ST.dt_tab2[idt_tab[c, 3], kc]; + if (finc < 0) + { + finc += fn_max; + } + CH[c].SLOT[3].phase += (uint)((finc * CH[c].SLOT[3].mul) >> 1); + } + else + { + CH[c].SLOT[0].phase += (uint)CH[c].SLOT[0].Incr; + CH[c].SLOT[2].phase += (uint)CH[c].SLOT[2].Incr; + CH[c].SLOT[1].phase += (uint)CH[c].SLOT[1].Incr; + CH[c].SLOT[3].phase += (uint)CH[c].SLOT[3].Incr; + } + } + public void chan_calc(int c, int chnum) + { + uint eg_out; + out_fm[8] = out_fm[9] = out_fm[10] = out_fm[11] = 0;//m2 = c1 = c2 = mem = 0; + set_mem(c); + eg_out = volume_calc(c, 0); + int out1 = CH[c].op1_out0 + CH[c].op1_out1; + CH[c].op1_out0 = CH[c].op1_out1; + set_value1(c); + CH[c].op1_out1 = 0; + if (eg_out < 832) + { + if (CH[c].FB == 0) + { + out1 = 0; + } + CH[c].op1_out1 = op_calc1(CH[c].SLOT[0].phase, eg_out, (out1 << CH[c].FB)); + } + eg_out = volume_calc(c, 1); + if (eg_out < 832) + { + out_fm[iconnect3[c]] += op_calc(CH[c].SLOT[1].phase, eg_out, out_fm[8]); + } + eg_out = volume_calc(c, 2); + if (eg_out < 832) + { + out_fm[iconnect2[c]] += op_calc(CH[c].SLOT[2].phase, eg_out, out_fm[9]); + } + eg_out = volume_calc(c, 3); + if (eg_out < 832) + { + out_fm[iconnect4[c]] += op_calc(CH[c].SLOT[3].phase, eg_out, out_fm[10]); + } + CH[c].mem_value = out_fm[11];//mem; + if (CH[c].pms != 0) + { + if (((ST.mode & 0xC0) != 0) && (chnum == 2)) + { + update_phase_lfo_slot(0, CH[c].pms, SL3.block_fnum[1]); + update_phase_lfo_slot(2, CH[c].pms, SL3.block_fnum[2]); + update_phase_lfo_slot(1, CH[c].pms, SL3.block_fnum[0]); + update_phase_lfo_slot(3, CH[c].pms, CH[c].block_fnum); + } + else + { + update_phase_lfo_channel(CH, c); + } + } + else + { + CH[c].SLOT[0].phase += (uint)CH[c].SLOT[0].Incr; + CH[c].SLOT[2].phase += (uint)CH[c].SLOT[2].Incr; + CH[c].SLOT[1].phase += (uint)CH[c].SLOT[1].Incr; + CH[c].SLOT[3].phase += (uint)CH[c].SLOT[3].Incr; + } + } + public void refresh_fc_eg_slot(int type, int c, int s, int fc, int kc) + { + int ksr = kc >> CH[c].SLOT[s].KSR; + fc += ST.dt_tab2[idt_tab[c, s], kc]; + if (fc < 0) + { + fc += fn_max; + } + CH[c].SLOT[s].Incr = (fc * CH[c].SLOT[s].mul) >> 1; + if (CH[c].SLOT[s].ksr != ksr) + { + CH[c].SLOT[s].ksr = (byte)ksr; + if ((CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr) < 32 + 62) + { + CH[c].SLOT[s].eg_sh_ar = eg_rate_shift[CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr]; + if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) + { + CH[c].SLOT[s].eg_sel_ar = eg_rate_select2612[CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr]; + } + else + { + CH[c].SLOT[s].eg_sel_ar = eg_rate_select[CH[c].SLOT[s].ar + CH[c].SLOT[s].ksr]; + } + } + else + { + CH[c].SLOT[s].eg_sh_ar = 0; + CH[c].SLOT[s].eg_sel_ar = 17 * 8; + } + CH[c].SLOT[s].eg_sh_d1r = eg_rate_shift[CH[c].SLOT[s].d1r + CH[c].SLOT[s].ksr]; + CH[c].SLOT[s].eg_sh_d2r = eg_rate_shift[CH[c].SLOT[s].d2r + CH[c].SLOT[s].ksr]; + CH[c].SLOT[s].eg_sh_rr = eg_rate_shift[CH[c].SLOT[s].rr + CH[c].SLOT[s].ksr]; + if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) + { + CH[c].SLOT[s].eg_sel_d1r = eg_rate_select2612[CH[c].SLOT[s].d1r + CH[c].SLOT[s].ksr]; + CH[c].SLOT[s].eg_sel_d2r = eg_rate_select2612[CH[c].SLOT[s].d2r + CH[c].SLOT[s].ksr]; + CH[c].SLOT[s].eg_sel_rr = eg_rate_select2612[CH[c].SLOT[s].rr + CH[c].SLOT[s].ksr]; + } + else + { + CH[c].SLOT[s].eg_sel_d1r = eg_rate_select[CH[c].SLOT[s].d1r + CH[c].SLOT[s].ksr]; + CH[c].SLOT[s].eg_sel_d2r = eg_rate_select[CH[c].SLOT[s].d2r + CH[c].SLOT[s].ksr]; + CH[c].SLOT[s].eg_sel_rr = eg_rate_select[CH[c].SLOT[s].rr + CH[c].SLOT[s].ksr]; + } + } + } + public void refresh_fc_eg_chan(int type, int c) + { + if (CH[c].SLOT[0].Incr == -1) + { + int fc = (int)CH[c].fc; + int kc = CH[c].kcode; + refresh_fc_eg_slot(type, c, 0, fc, kc); + refresh_fc_eg_slot(type, c, 2, fc, kc); + refresh_fc_eg_slot(type, c, 1, fc, kc); + refresh_fc_eg_slot(type, c, 3, fc, kc); + } + } + private void init_timetables() + { + int i, d; + double rate; + for (d = 0; d <= 3; d++) + { + for (i = 0; i <= 31; i++) + { + rate = ((double)dt_tab[d * 32 + i]) * 1024 * ST.freqbase * (1 << 16) / ((double)(1 << 20)); + ST.dt_tab2[d, i] = (int)rate; + ST.dt_tab2[d + 4, i] = -ST.dt_tab2[d, i]; + } + } + } + public void reset_channels(int num) + { + int c, s; + ST.mode = 0; /* normal mode */ + ST.TA = 0; + ST.TAC = 0; + ST.TB = 0; + ST.TBC = 0; + for (c = 0; c < num; c++) + { + CH[c].fc = 0; + for (s = 0; s < 4; s++) + { + CH[c].SLOT[s].ssg = 0; + CH[c].SLOT[s].ssgn = 0; + CH[c].SLOT[s].state = 0; + CH[c].SLOT[s].volume = 0x3ff; + CH[c].SLOT[s].vol_out = 0x3ff; + } + } + } + public void CSMKeyControll() + { + FM_KEYON(type, 2, 0); + FM_KEYON(type, 2, 2); + FM_KEYON(type, 2, 1); + FM_KEYON(type, 2, 3); + } + public void OPNSetPres(int pres, int timer_prescaler, int SSGpres) + { + int i; + ST.freqbase = (ST.rate != 0) ? ((double)ST.clock / ST.rate) / pres : 0; + eg_timer_add = (uint)((1 << 16) * ST.freqbase); + eg_timer_overflow = (3) * (1 << 16); + ST.timer_prescaler = timer_prescaler; + if (SSGpres != 0) + { + ST.SSG.set_clock(ST.clock * 2 / SSGpres); + } + init_timetables(); + for (i = 0; i < 4096; i++) + { + fn_table[i] = (uint)((double)i * 32 * ST.freqbase * (1 << (16 - 10))); + } + fn_max = (int)((uint)(((double)fn_table[0x7ff * 2] / ST.freqbase)) >> 2);//2096127 + for (i = 0; i < 8; i++) + { + lfo_freq[i] = (int)((1.0 / lfo_samples_per_step[i]) * (1 << 24) * ST.freqbase); + } + } + public void OPNWriteMode(int r, byte v) + { + byte c; + switch (r) + { + case 0x21: + break; + case 0x22: + if ((type & TYPE_LFOPAN) != 0) + { + if ((v & 0x08) != 0) + { + lfo_inc = lfo_freq[v & 7]; + } + else + { + lfo_inc = 0; + } + } + break; + case 0x24: + ST.TA = (ST.TA & 0x03) | (((int)v) << 2); + break; + case 0x25: + ST.TA = (ST.TA & 0x3fc) | (v & 3); + break; + case 0x26: + ST.TB = v; + break; + case 0x27: + set_timers(v); + break; + case 0x28: + c = (byte)(v & 0x03); + if (c == 3) + break; + if ((v & 0x04) != 0 && (type & TYPE_6CH) != 0) + c += 3; + if ((v & 0x10) != 0) + FM_KEYON(type, c, 0); + else + FM_KEYOFF(c, 0); + if ((v & 0x20) != 0) + FM_KEYON(type, c, 2); + else + FM_KEYOFF(c, 2); + if ((v & 0x40) != 0) + FM_KEYON(type, c, 1); + else + FM_KEYOFF(c, 1); + if ((v & 0x80) != 0) + FM_KEYON(type, c, 3); + else + FM_KEYOFF(c, 3); + break; + } + } + public void OPNWriteReg(int r, byte v) + { + byte c = (byte)(r & 3); + int s = (r >> 2) & 3; + if (c == 3) + return; + if (r >= 0x100) + c += 3; + switch (r & 0xf0) + { + case 0x30: + set_det_mul(c, s, v); + break; + case 0x40: + set_tl(c, s, v); + break; + case 0x50: + set_ar_ksr(c, s, v); + break; + case 0x60: + set_dr(c, s, v); + if ((type & TYPE_LFOPAN) != 0) + { + CH[c].SLOT[s].AMmask = ((v & 0x80) != 0) ? 0xffffffff : 0; + } + break; + case 0x70: + set_sr(c, s, v); + break; + case 0x80: + set_sl_rr(c, s, v); + break; + case 0x90: + CH[c].SLOT[s].ssg = (byte)(v & 0x0f); + CH[c].SLOT[s].ssgn = (byte)((v & 0x04) >> 1); + break; + case 0xa0: + switch ((r >> 2) & 3) + { + case 0: + { + uint fn = (((uint)((ST.fn_h) & 7)) << 8) + v; + byte blk = (byte)(ST.fn_h >> 3); + CH[c].kcode = (byte)((blk << 2) | opn_fktable[fn >> 7]); + CH[c].fc = fn_table[fn * 2] >> (7 - blk); + CH[c].block_fnum = (uint)(blk << 11) | fn; + CH[c].SLOT[0].Incr = -1; + } + break; + case 1: + ST.fn_h = (byte)(v & 0x3f); + break; + case 2: + if (r < 0x100) + { + uint fn = (((uint)(SL3.fn_h & 7)) << 8) + v; + byte blk = (byte)(SL3.fn_h >> 3); + SL3.kcode[c] = (byte)((blk << 2) | opn_fktable[fn >> 7]); + SL3.fc[c] = fn_table[fn * 2] >> (7 - blk); + SL3.block_fnum[c] = (uint)(blk << 11) | fn; + CH[c + 2].SLOT[0].Incr = -1; + } + break; + case 3: + if (r < 0x100) + SL3.fn_h = (byte)(v & 0x3f); + break; + } + break; + case 0xb0: + switch ((r >> 2) & 3) + { + case 0: + { + int feedback = (v >> 3) & 7; + CH[c].ALGO = (byte)(v & 7); + CH[c].FB = (feedback != 0) ? (byte)(feedback + 6) : (byte)0; + setup_connection(c); + } + break; + case 1: + if ((type & TYPE_LFOPAN) != 0) + { + CH[c].pms = (v & 7) * 32; + CH[c].ams = lfo_ams_depth_shift[(v >> 4) & 0x03]; + pan[c * 2] = ((v & 0x80) != 0) ? 0xffffffff : 0; + pan[c * 2 + 1] = ((v & 0x40) != 0) ? 0xffffffff : 0; + } + break; + } + break; + } + } + public void OPNPrescaler_w(int addr, int pre_divider) + { + int[] opn_pres = new int[4] { 2 * 12, 2 * 12, 6 * 12, 3 * 12 }; + int[] ssg_pres = new int[4] { 1, 1, 4, 2 }; + int sel; + switch (addr) + { + case 0: + ST.prescaler_sel = 2; + break; + case 1: + break; + case 0x2d: + ST.prescaler_sel |= 0x02; + break; + case 0x2e: + ST.prescaler_sel |= 0x01; + break; + case 0x2f: + ST.prescaler_sel = 0; + break; + } + sel = ST.prescaler_sel & 3; + OPNSetPres(opn_pres[sel] * pre_divider, opn_pres[sel] * pre_divider, ssg_pres[sel] * pre_divider); + } + } + public struct FM_SLOT + { + public byte KSR; + public int ar; + public int d1r; + public int d2r; + public int rr; + public byte ksr; + public int mul; + public uint phase; + public int Incr; + public byte state; + public int tl; + public int volume; + public int sl; + public uint vol_out; + public byte eg_sh_ar; + public byte eg_sel_ar; + public byte eg_sh_d1r; + public byte eg_sel_d1r; + public byte eg_sh_d2r; + public byte eg_sel_d2r; + public byte eg_sh_rr; + public byte eg_sel_rr; + public byte ssg; + public byte ssgn; + public uint key; + public uint AMmask; + } + public struct FM_CH + { + public FM_SLOT[] SLOT; + public byte ALGO; + public byte FB; + public int op1_out0, op1_out1; + public int mem_value; + public int pms; + public byte ams; + public uint fc; + public byte kcode; + public uint block_fnum; + } + public struct FM_ST + { + public int clock; + public int rate; + public double freqbase; + public int timer_prescaler; + public Atime busy_expiry_time; + public byte address; + public byte irq; + public byte irqmask; + public byte status; + public byte mode; + public byte prescaler_sel; + public byte fn_h; + public int TA; + public int TAC; + public byte TB; + public int TBC; + public int[,] dt_tab2; + public FM_TIMERHANDLER timer_handler; + public FM_IRQHANDLER IRQ_Handler; + public ssg_callbacks SSG; + } + public struct FM_3SLOT + { + public uint[] fc; + public byte fn_h; + public byte[] kcode; + public uint[] block_fnum; + } + public struct ADPCM_CH + { + public byte flag; + public byte flagMask; + public byte now_data; + public uint now_addr; + public uint now_step; + public uint step; + public uint start; + public uint end; + public byte IL; + public int adpcm_acc; + public int adpcm_step; + public int adpcm_out; + public sbyte vol_mul; + public byte vol_shift; + } + public struct ssg_callbacks + { + public set_clock_handler set_clock; + public write_handler write; + public read_handler read; + public reset_handler reset; + } + + public static int TYPE_SSG = 0x01, TYPE_LFOPAN = 0x02, TYPE_6CH = 0x04, TYPE_DAC = 0x08, TYPE_ADPCM = 0x10, TYPE_2610 = 0x20; + public static int TYPE_YM2203 = (TYPE_SSG), TYPE_YM2608 = (TYPE_SSG | TYPE_LFOPAN | TYPE_6CH | TYPE_ADPCM), TYPE_YM2610 = (TYPE_SSG | TYPE_LFOPAN | TYPE_6CH | TYPE_ADPCM | TYPE_2610), TYPE_YM2612 = (TYPE_DAC | TYPE_LFOPAN | TYPE_6CH); + public static int[] ipan = new int[6]; + private static int[] tl_tab = new int[6656]; + private static uint[] sin_tab = new uint[0x400]; + private static int[] sl_table = new int[16]{ + ( 0*32),( 1*32),( 2*32),(3*32 ),(4*32 ),(5*32 ),(6*32 ),( 7*32), + ( 8*32),( 9*32),(10*32),(11*32),(12*32),(13*32),(14*32),(31*32) + }; + private static byte[] eg_inc = new byte[19 * 8]{ + 0,1, 0,1, 0,1, 0,1, + 0,1, 0,1, 1,1, 0,1, + 0,1, 1,1, 0,1, 1,1, + 0,1, 1,1, 1,1, 1,1, + + 1,1, 1,1, 1,1, 1,1, + 1,1, 1,2, 1,1, 1,2, + 1,2, 1,2, 1,2, 1,2, + 1,2, 2,2, 1,2, 2,2, + + 2,2, 2,2, 2,2, 2,2, + 2,2, 2,4, 2,2, 2,4, + 2,4, 2,4, 2,4, 2,4, + 2,4, 4,4, 2,4, 4,4, + + 4,4, 4,4, 4,4, 4,4, + 4,4, 4,8, 4,4, 4,8, + 4,8, 4,8, 4,8, 4,8, + 4,8, 8,8, 4,8, 8,8, + + 8,8, 8,8, 8,8, 8,8, + 16,16,16,16,16,16,16,16, + 0,0, 0,0, 0,0, 0,0, + }; + public static byte[] eg_rate_select = new byte[32 + 64 + 32]{ + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + + ( 4*8),( 5*8),( 6*8),( 7*8), + + ( 8*8),( 9*8),(10*8),(11*8), + + (12*8),(13*8),(14*8),(15*8), + + (16*8),(16*8),(16*8),(16*8), + + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8), + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8), + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8), + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8) + }; + public static byte[] eg_rate_select2612 = new byte[32 + 64 + 32]{ + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + (18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8),(18*8), + + ( 18*8),( 18*8),( 0*8),( 0*8), + ( 0*8),( 0*8),( 2*8),( 2*8), + + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + ( 0*8),( 1*8),( 2*8),( 3*8), + + ( 4*8),( 5*8),( 6*8),( 7*8), + + ( 8*8),( 9*8),(10*8),(11*8), + + (12*8),(13*8),(14*8),(15*8), + + (16),(16),(16),(16), + + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8), + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8), + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8), + (16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8),(16*8) + }; + public static byte[] eg_rate_shift = new byte[32 + 64 + 32]{ + (0),(0),(0),(0),(0),(0),(0),(0), + (0),(0),(0),(0),(0),(0),(0),(0), + (0),(0),(0),(0),(0),(0),(0),(0), + (0),(0),(0),(0),(0),(0),(0),(0), + + (11),(11),(11),(11), + (10),(10),(10),(10), + ( 9),( 9),( 9),( 9), + ( 8),( 8),( 8),( 8), + ( 7),( 7),( 7),( 7), + ( 6),( 6),( 6),( 6), + ( 5),( 5),( 5),( 5), + ( 4),( 4),( 4),( 4), + ( 3),( 3),( 3),( 3), + ( 2),( 2),( 2),( 2), + ( 1),( 1),( 1),( 1), + ( 0),( 0),( 0),( 0), + + ( 0),( 0),( 0),( 0), + + ( 0),( 0),( 0),( 0), + + ( 0),( 0),( 0),( 0), + + ( 0),( 0),( 0),( 0), + + ( 0),( 0),( 0),( 0),( 0),( 0),( 0),( 0), + ( 0),( 0),( 0),( 0),( 0),( 0),( 0),( 0), + ( 0),( 0),( 0),( 0),( 0),( 0),( 0),( 0), + ( 0),( 0),( 0),( 0),( 0),( 0),( 0),( 0) + }; + public static byte[] dt_tab = new byte[4 * 32]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8, 8, 8, 8, + + 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, + 5, 6, 6, 7, 8, 8, 9,10,11,12,13,14,16,16,16,16, + + 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, + 8 , 8, 9,10,11,12,13,14,16,17,19,20,22,22,22,22 + }; + private static byte[] opn_fktable = new byte[16] { 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3 }; + private static uint[] lfo_samples_per_step = new uint[8] { 108, 77, 71, 67, 62, 44, 8, 5 }; + private static byte[] lfo_ams_depth_shift = new byte[4] { 8, 3, 1, 0 }; + private static byte[,] lfo_pm_output = new byte[56, 8]{ + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 1, 1, 1}, + + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 1, 1, 1}, + {0, 0, 1, 1, 2, 2, 2, 3}, + + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}, + {0, 0, 0, 0, 1, 1, 1, 1}, + {0, 0, 1, 1, 2, 2, 2, 3}, + {0, 0, 2, 3, 4, 4, 5, 6}, + + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 1}, + {0, 0, 0, 0, 1, 1, 1, 1}, + {0, 0, 0, 1, 1, 1, 1, 2}, + {0, 0, 1, 1, 2, 2, 2, 3}, + {0, 0, 2, 3, 4, 4, 5, 6}, + {0, 0, 4, 6, 8, 8, 0xa, 0xc}, + + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 1, 1, 1}, + {0, 0, 0, 1, 1, 1, 2, 2}, + {0, 0, 1, 1, 2, 2, 3, 3}, + {0, 0, 1, 2, 2, 2, 3, 4}, + {0, 0, 2, 3, 4, 4, 5, 6}, + {0, 0, 4, 6, 8, 8, 0xa, 0xc}, + {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, + + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 2, 2, 2, 2}, + {0, 0, 0, 2, 2, 2, 4, 4}, + {0, 0, 2, 2, 4, 4, 6, 6}, + {0, 0, 2, 4, 4, 4, 6, 8}, + {0, 0, 4, 6, 8, 8, 0xa, 0xc}, + {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, + {0, 0,0x10,0x18,0x20,0x20,0x28,0x30}, + + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 4, 4, 4, 4}, + {0, 0, 0, 4, 4, 4, 8, 8}, + {0, 0, 4, 4, 8, 8, 0xc, 0xc}, + {0, 0, 4, 8, 8, 8, 0xc,0x10}, + {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, + {0, 0,0x10,0x18,0x20,0x20,0x28,0x30}, + {0, 0,0x20,0x30,0x40,0x40,0x50,0x60}, + }; + private static int[] steps = new int[49] + { + 16, 17, 19, 21, 23, 25, 28, + 31, 34, 37, 41, 45, 50, 55, + 60, 66, 73, 80, 88, 97, 107, + 118, 130, 143, 157, 173, 190, 209, + 230, 253, 279, 307, 337, 371, 408, + 449, 494, 544, 598, 658, 724, 796, + 876, 963, 1060, 1166, 1282, 1411, 1552 + }; + public static int[] step_inc = new int[8] { -1 * 16, -1 * 16, -1 * 16, -1 * 16, 2 * 16, 5 * 16, 7 * 16, 9 * 16 }; + public static int[] jedi_table = new int[49 * 16]; + public delegate void FM_TIMERHANDLER(int c, int cnt, int clock); + public delegate void FM_IRQHANDLER(int irq); + public delegate void set_clock_handler(int clock); + public delegate void write_handler(int address, byte data); + public delegate byte read_handler(); + 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 byte[] ymsndrom; + public static int LFO_AM; + public static int LFO_PM; + private static int fn_max; + public static void FM_init() + { + init_tables(); + } + public static int Limit(int val, int max, int min) + { + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + else + { + return val; + } + } + private static int op_calc(uint phase, uint env, int pm) + { + uint p; + p = (uint)((env << 3) + sin_tab[(((int)((phase & 0xffff0000) + (pm << 15))) >> 16) & 0x3ff]); + if (p >= 6656) + { + return 0; + } + return tl_tab[p]; + } + private static int op_calc1(uint phase, uint env, int pm) + { + uint p; + p = (uint)((env << 3) + sin_tab[(((int)((phase & 0xffff0000) + pm)) >> 16) & 0x3ff]); + if (p >= 6656) + { + return 0; + } + return tl_tab[p]; + } + public static int init_tables() + { + int i, x, n; + double o, m; + for (x = 0; x < 0x100; x++) + { + m = (1 << 16) / Math.Pow(2, (x + 1) * (1.0 / 32) / 8.0); + m = Math.Floor(m); + n = (int)m; + n >>= 4; + if ((n & 1) != 0) + { + n = (n >> 1) + 1; + } + else + { + n = n >> 1; + } + n <<= 2; + tl_tab[x * 2] = n; + tl_tab[x * 2 + 1] = -tl_tab[x * 2]; + for (i = 1; i < 13; i++) + { + tl_tab[x * 2 + i * 2 * 0x100] = tl_tab[x * 2] >> i; + tl_tab[x * 2 + 1 + i * 2 * 0x100] = -tl_tab[x * 2 + i * 2 * 0x100]; + } + } + for (i = 0; i < 0x400; i++) + { + m = Math.Sin(((i * 2) + 1) * Math.PI / 0x400); + if (m > 0.0) + { + o = 8 * Math.Log(1.0 / m) / Math.Log(2); + } + else + { + o = 8 * Math.Log(-1.0 / m) / Math.Log(2); + } + o = o / (1.0 / 32); + n = (int)(2.0 * o); + if ((n & 1) != 0) + { + n = (n >> 1) + 1; + } + else + { + n = n >> 1; + } + sin_tab[i] = (uint)(n * 2 + (m >= 0.0 ? 0 : 1)); + } + for (i = 0; i < 8; i++) + { + byte fnum; + for (fnum = 0; fnum < 128; fnum++) + { + byte value; + byte step; + int offset_depth = i; + int offset_fnum_bit; + int bit_tmp; + for (step = 0; step < 8; step++) + { + value = 0; + for (bit_tmp = 0; bit_tmp < 7; bit_tmp++) + { + if ((fnum & (1 << bit_tmp)) != 0) + { + offset_fnum_bit = bit_tmp * 8; + value += lfo_pm_output[offset_fnum_bit + offset_depth, step]; + } + } + lfo_pm_table[(fnum * 32 * 8) + (i * 32) + step + 0] = value; + lfo_pm_table[(fnum * 32 * 8) + (i * 32) + (step ^ 7) + 8] = value; + lfo_pm_table[(fnum * 32 * 8) + (i * 32) + step + 16] = -value; + lfo_pm_table[(fnum * 32 * 8) + (i * 32) + (step ^ 7) + 24] = -value; + } + } + } + return 1; + } + public static void Init_ADPCMATable() + { + int step, nib; + for (step = 0; step < 49; step++) + { + for (nib = 0; nib < 16; nib++) + { + int value = (2 * (nib & 0x07) + 1) * steps[step] / 8; + jedi_table[step * 16 + nib] = ((nib & 0x08) != 0) ? -value : value; + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs.meta new file mode 100644 index 00000000..4109df9f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a9d5dec49c8dad4e9045b06f3d31d89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FMOpl.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FMOpl.cs new file mode 100644 index 00000000..3643f1e2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FMOpl.cs @@ -0,0 +1,1338 @@ +using System; + +namespace MAME.Core +{ + public unsafe class FMOpl + { + public struct OPL_SLOT + { + public uint ar; + public uint dr; + public uint rr; + public byte KSR; + public byte ksl; + public byte ksr; + public byte mul; + + public uint Cnt; + public uint Incr; + public byte FB; + public int iconnect; + public int[] op1_out; + public byte CON; + + public byte eg_type; + public byte state; + public uint TL; + public int TLL; + public int volume; + public uint sl; + public byte eg_sh_ar; + public byte eg_sel_ar; + public byte eg_sh_dr; + public byte eg_sel_dr; + public byte eg_sh_rr; + public byte eg_sel_rr; + public uint key; + + public uint AMmask; + public byte vib; + + public ushort wavetable; + } + public struct OPL_CH + { + public OPL_SLOT[] SLOT; + public uint block_fnum; + public uint fc; + public uint ksl_base; + public byte kcode; + } + public class FM_OPL + { + public OPL_CH[] P_CH; + + public uint eg_cnt; + public uint eg_timer; + public uint eg_timer_add; + public uint eg_timer_overflow; + + public byte rhythm; + + public uint[] fn_tab; + + public byte lfo_am_depth; + public byte lfo_pm_depth_range; + public uint lfo_am_cnt; + public uint lfo_am_inc; + public uint lfo_pm_cnt; + public uint lfo_pm_inc; + + public uint noise_rng; + public uint noise_p; + public uint noise_f; + + public byte wavesel; + + public uint[] T; + public byte[] st; + + public YMDeltat.YM_DELTAT deltat; + + public byte portDirection; + public byte portLatch; + public OPL_PORTHANDLER_R porthandler_r; + public OPL_PORTHANDLER_W porthandler_w; + public OPL_PORTHANDLER_R keyboardhandler_r; + public OPL_PORTHANDLER_W keyboardhandler_w; + + public OPL_TIMERHANDLER timer_handler; + public OPL_IRQHANDLER IRQHandler; + public OPL_UPDATEHANDLER UpdateHandler; + + public byte type; + public byte address; + public byte status; + public byte statusmask; + public byte mode; + + public int clock; + public int rate; + public double freqbase; + public Atime TimerBase; + public void OPLResetChip() + { + int c, s; + int i; + eg_timer = 0; + eg_cnt = 0; + noise_rng = 1; + mode = 0; + OPL_STATUS_RESET(0x7f); + OPLWriteReg(0x01, 0); + OPLWriteReg(0x02, 0); + OPLWriteReg(0x03, 0); + OPLWriteReg(0x04, 0); + for (i = 0xff; i >= 0x20; i--) + { + OPLWriteReg(i, 0); + } + for (c = 0; c < 9; c++) + { + for (s = 0; s < 2; s++) + { + P_CH[c].SLOT[s].wavetable = 0; + P_CH[c].SLOT[s].state = 0; + P_CH[c].SLOT[s].volume = 0x1ff; + } + } + } + public void OPL_initalize() + { + int i; + freqbase = (rate != 0) ? ((double)clock / 72.0) / rate : 0; + TimerBase = Attotime.attotime_mul(Attotime.ATTOTIME_IN_HZ((int)clock), 72); + for (i = 0; i < 1024; i++) + { + fn_tab[i] = (uint)((double)i * 64 * freqbase * (1 << (16 - 10))); + } + lfo_am_inc = (uint)(0x40000 * freqbase); + lfo_pm_inc = (uint)(0x4000 * freqbase); + noise_f = (uint)(0x10000 * freqbase); + eg_timer_add = (uint)(0x10000 * freqbase); + eg_timer_overflow = 0x10000; + } + private void FM_KEYON(int chan, int slot, uint key_set) + { + if (P_CH[chan].SLOT[slot].key == 0) + { + P_CH[chan].SLOT[slot].Cnt = 0; + P_CH[chan].SLOT[slot].state = 4; + } + P_CH[chan].SLOT[slot].key |= key_set; + } + private void FM_KEYOFF(int chan, int slot, uint key_clr) + { + if (P_CH[chan].SLOT[slot].key != 0) + { + P_CH[chan].SLOT[slot].key &= key_clr; + if (P_CH[chan].SLOT[slot].key == 0) + { + if (P_CH[chan].SLOT[slot].state > 1) + P_CH[chan].SLOT[slot].state = 1; + } + } + } + private void CALC_FCSLOT(int chan, int slot) + { + int ksr; + P_CH[chan].SLOT[slot].Incr = P_CH[chan].fc * P_CH[chan].SLOT[slot].mul; + ksr = P_CH[chan].kcode >> P_CH[chan].SLOT[slot].KSR; + if (P_CH[chan].SLOT[slot].ksr != ksr) + { + P_CH[chan].SLOT[slot].ksr = (byte)ksr; + if ((P_CH[chan].SLOT[slot].ar + P_CH[chan].SLOT[slot].ksr) < 78) + { + P_CH[chan].SLOT[slot].eg_sh_ar = eg_rate_shift[P_CH[chan].SLOT[slot].ar + P_CH[chan].SLOT[slot].ksr]; + P_CH[chan].SLOT[slot].eg_sel_ar = eg_rate_select[P_CH[chan].SLOT[slot].ar + P_CH[chan].SLOT[slot].ksr]; + } + else + { + P_CH[chan].SLOT[slot].eg_sh_ar = 0; + P_CH[chan].SLOT[slot].eg_sel_ar = 13 * 8; + } + P_CH[chan].SLOT[slot].eg_sh_dr = eg_rate_shift[P_CH[chan].SLOT[slot].dr + P_CH[chan].SLOT[slot].ksr]; + P_CH[chan].SLOT[slot].eg_sel_dr = eg_rate_select[P_CH[chan].SLOT[slot].dr + P_CH[chan].SLOT[slot].ksr]; + P_CH[chan].SLOT[slot].eg_sh_rr = eg_rate_shift[P_CH[chan].SLOT[slot].rr + P_CH[chan].SLOT[slot].ksr]; + P_CH[chan].SLOT[slot].eg_sel_rr = eg_rate_select[P_CH[chan].SLOT[slot].rr + P_CH[chan].SLOT[slot].ksr]; + } + } + private void set_mul(int slot, int v) + { + P_CH[slot / 2].SLOT[slot & 1].mul = mul_tab[v & 0x0f]; + P_CH[slot / 2].SLOT[slot & 1].KSR = (byte)((v & 0x10) != 0 ? 0 : 2); + P_CH[slot / 2].SLOT[slot & 1].eg_type = (byte)(v & 0x20); + P_CH[slot / 2].SLOT[slot & 1].vib = (byte)(v & 0x40); + P_CH[slot / 2].SLOT[slot & 1].AMmask = (uint)((v & 0x80) != 0 ? ~0 : 0); + CALC_FCSLOT(slot / 2, slot & 1); + } + private void set_ksl_tl(int slot, int v) + { + int ksl = v >> 6; + P_CH[slot / 2].SLOT[slot & 1].ksl = (byte)(ksl != 0 ? 3 - ksl : 31); + P_CH[slot / 2].SLOT[slot & 1].TL = (uint)((v & 0x3f) << 2); + P_CH[slot / 2].SLOT[slot & 1].TLL = (int)(P_CH[slot / 2].SLOT[slot & 1].TL + (P_CH[slot / 2].ksl_base >> P_CH[slot / 2].SLOT[slot & 1].ksl)); + } + private void set_ar_dr(int slot, int v) + { + P_CH[slot / 2].SLOT[slot & 1].ar = (uint)((v >> 4) != 0 ? 16 + ((v >> 4) << 2) : 0); + if ((P_CH[slot / 2].SLOT[slot & 1].ar + P_CH[slot / 2].SLOT[slot & 1].ksr) < 16 + 62) + { + P_CH[slot / 2].SLOT[slot & 1].eg_sh_ar = eg_rate_shift[P_CH[slot / 2].SLOT[slot & 1].ar + P_CH[slot / 2].SLOT[slot & 1].ksr]; + P_CH[slot / 2].SLOT[slot & 1].eg_sel_ar = eg_rate_select[P_CH[slot / 2].SLOT[slot & 1].ar + P_CH[slot / 2].SLOT[slot & 1].ksr]; + } + else + { + P_CH[slot / 2].SLOT[slot & 1].eg_sh_ar = 0; + P_CH[slot / 2].SLOT[slot & 1].eg_sel_ar = 13 * 8; + } + P_CH[slot / 2].SLOT[slot & 1].dr = (uint)((v & 0x0f) != 0 ? 16 + ((v & 0x0f) << 2) : 0); + P_CH[slot / 2].SLOT[slot & 1].eg_sh_dr = eg_rate_shift[P_CH[slot / 2].SLOT[slot & 1].dr + P_CH[slot / 2].SLOT[slot & 1].ksr]; + P_CH[slot / 2].SLOT[slot & 1].eg_sel_dr = eg_rate_select[P_CH[slot / 2].SLOT[slot & 1].dr + P_CH[slot / 2].SLOT[slot & 1].ksr]; + } + private void set_sl_rr(int slot, int v) + { + P_CH[slot / 2].SLOT[slot & 1].sl = sl_tab[v >> 4]; + P_CH[slot / 2].SLOT[slot & 1].rr = (uint)((v & 0x0f) != 0 ? 16 + ((v & 0x0f) << 2) : 0); + P_CH[slot / 2].SLOT[slot & 1].eg_sh_rr = eg_rate_shift[P_CH[slot / 2].SLOT[slot & 1].rr + P_CH[slot / 2].SLOT[slot & 1].ksr]; + P_CH[slot / 2].SLOT[slot & 1].eg_sel_rr = eg_rate_select[P_CH[slot / 2].SLOT[slot & 1].rr + P_CH[slot / 2].SLOT[slot & 1].ksr]; + } + public void OPLWriteReg(int r, int v) + { + int slot; + int block_fnum; + r &= 0xff; + v &= 0xff; + switch (r & 0xe0) + { + case 0x00: + switch (r & 0x1f) + { + case 0x01: + if ((type & 0x01) != 0) + { + wavesel = (byte)(v & 0x20); + } + break; + case 0x02: + T[0] = (uint)((256 - v) * 4); + break; + case 0x03: + T[1] = (uint)((256 - v) * 16); + break; + case 0x04: + if ((v & 0x80) != 0) + { + OPL_STATUS_RESET(0x7f - 0x08); + } + else + { + byte st1 = (byte)(v & 1); + byte st2 = (byte)((v >> 1) & 1); + OPL_STATUS_RESET(v & (0x78 - 0x08)); + OPL_STATUSMASK_SET((~v) & 0x78); + if (st[1] != st2) + { + Atime period = st2 != 0 ? Attotime.attotime_mul(TimerBase, T[1]) : Attotime.ATTOTIME_ZERO; + st[1] = st2; + if (timer_handler != null) + { + timer_handler(1, period); + } + } + if (st[0] != st1) + { + Atime period = st1 != 0 ? Attotime.attotime_mul(TimerBase, T[0]) : Attotime.ATTOTIME_ZERO; + st[0] = st1; + if (timer_handler != null) + { + timer_handler(0, period); + } + } + } + break; + case 0x08: + mode = (byte)v; + break; + default: + break; + } + break; + case 0x20: + slot = slot_array[r & 0x1f]; + if (slot < 0) + { + return; + } + set_mul(slot, v); + break; + case 0x40: + slot = slot_array[r & 0x1f]; + if (slot < 0) + { + return; + } + set_ksl_tl(slot, v); + break; + case 0x60: + slot = slot_array[r & 0x1f]; + if (slot < 0) + { + return; + } + set_ar_dr(slot, v); + break; + case 0x80: + slot = slot_array[r & 0x1f]; + if (slot < 0) + { + return; + } + set_sl_rr(slot, v); + break; + case 0xa0: + if (r == 0xbd) + { + lfo_am_depth = (byte)(v & 0x80); + lfo_pm_depth_range = (byte)((v & 0x40) != 0 ? 8 : 0); + rhythm = (byte)(v & 0x3f); + if ((rhythm & 0x20) != 0) + { + if ((v & 0x10) != 0) + { + FM_KEYON(6, 0, 2); + FM_KEYON(6, 1, 2); + } + else + { + FM_KEYOFF(6, 0, unchecked((uint)(~2))); + FM_KEYOFF(6, 1, unchecked((uint)(~2))); + } + if ((v & 0x01) != 0) + { + FM_KEYON(7, 0, 2); + } + else + { + FM_KEYOFF(7, 0, unchecked((uint)(~2))); + } + if ((v & 0x08) != 0) + { + FM_KEYON(7, 1, 2); + } + else + { + FM_KEYOFF(7, 1, unchecked((uint)(~2))); + } + if ((v & 0x04) != 0) + { + FM_KEYON(8, 0, 2); + } + else + { + FM_KEYOFF(8, 0, unchecked((uint)(~2))); + } + if ((v & 0x02) != 0) + { + FM_KEYON(8, 1, 2); + } + else + { + FM_KEYOFF(8, 1, unchecked((uint)(~2))); + } + } + else + { + FM_KEYOFF(6, 0, unchecked((uint)(~2))); + FM_KEYOFF(6, 1, unchecked((uint)(~2))); + FM_KEYOFF(7, 0, unchecked((uint)(~2))); + FM_KEYOFF(7, 1, unchecked((uint)(~2))); + FM_KEYOFF(8, 0, unchecked((uint)(~2))); + FM_KEYOFF(8, 1, unchecked((uint)(~2))); + } + return; + } + if ((r & 0x0f) > 8) + { + return; + } + if ((r & 0x10) == 0) + { + block_fnum = (int)((P_CH[r & 0x0f].block_fnum & 0x1f00) | (uint)v); + } + else + { + block_fnum = (int)((uint)((v & 0x1f) << 8) | (P_CH[r & 0x0f].block_fnum & 0xff)); + if ((v & 0x20) != 0) + { + FM_KEYON(r & 0x0f, 0, 1); + FM_KEYON(r & 0x0f, 1, 1); + } + else + { + FM_KEYOFF(r & 0x0f, 0, unchecked((uint)(~1))); + FM_KEYOFF(r & 0x0f, 1, unchecked((uint)(~1))); + } + } + if (P_CH[r & 0x0f].block_fnum != block_fnum) + { + byte block = (byte)(block_fnum >> 10); + P_CH[r & 0x0f].block_fnum = (uint)block_fnum; + P_CH[r & 0x0f].ksl_base = ksl_tab[block_fnum >> 6]; + P_CH[r & 0x0f].fc = fn_tab[block_fnum & 0x03ff] >> (7 - block); + P_CH[r & 0x0f].kcode = (byte)((P_CH[r & 0x0f].block_fnum & 0x1c00) >> 9); + if ((mode & 0x40) != 0) + { + P_CH[r & 0x0f].kcode |= (byte)((P_CH[r & 0x0f].block_fnum & 0x100) >> 8); + } + else + { + P_CH[r & 0x0f].kcode |= (byte)((P_CH[r & 0x0f].block_fnum & 0x200) >> 9); + } + P_CH[r & 0x0f].SLOT[0].TLL = (int)(P_CH[r & 0x0f].SLOT[0].TL + (P_CH[r & 0x0f].ksl_base >> P_CH[r & 0x0f].SLOT[0].ksl)); + P_CH[r & 0x0f].SLOT[1].TLL = (int)(P_CH[r & 0x0f].SLOT[1].TL + (P_CH[r & 0x0f].ksl_base >> P_CH[r & 0x0f].SLOT[1].ksl)); + CALC_FCSLOT(r & 0x0f, 0); + CALC_FCSLOT(r & 0x0f, 1); + } + break; + case 0xc0: + if ((r & 0x0f) > 8) + { + return; + } + P_CH[r & 0x0f].SLOT[0].FB = (byte)(((v >> 1) & 7) != 0 ? ((v >> 1) & 7) + 7 : 0); + P_CH[r & 0x0f].SLOT[0].CON = (byte)(v & 1); + P_CH[r & 0x0f].SLOT[0].iconnect = P_CH[r & 0x0f].SLOT[0].CON != 0 ? 1 : 2; + break; + case 0xe0: + if (wavesel != 0) + { + slot = slot_array[r & 0x1f]; + if (slot < 0) + { + return; + } + P_CH[slot / 2].SLOT[slot & 1].wavetable = (ushort)((v & 0x03) * 0x400); + } + break; + } + } + public int OPLWrite(int a, int v) + { + if ((a & 1) == 0) + { + address = (byte)(v & 0xff); + } + else + { + if (UpdateHandler != null) + { + UpdateHandler(0); + } + OPLWriteReg(address, v); + } + return status >> 7; + } + public byte OPLRead(int a) + { + if ((a & 1) == 0) + { + return (byte)(status & (statusmask | 0x80)); + } + return 0xff; + } + public int op_calc1(uint phase, int env, int pm, int wave_tab) + { + uint p; + p = (uint)((env << 4) + sin_tab[wave_tab + ((((int)((phase & ~0xffff) + pm)) >> 16) & 0x3ff)]); + if (p >= 0x1800) + { + return 0; + } + return tl_tab[p]; + } + public uint volume_calc(int chan, int slot) + { + uint i1; + i1 = (uint)(P_CH[chan].SLOT[slot].TLL + (uint)P_CH[chan].SLOT[slot].volume + (LFO_AM & P_CH[chan].SLOT[slot].AMmask)); + return i1; + } + public void OPL_CALC_CH(int chan) + { + uint env; + int out1; + phase_modulation = 0; + env = volume_calc(chan, 0); + out1 = P_CH[chan].SLOT[0].op1_out[0] + P_CH[chan].SLOT[0].op1_out[1]; + P_CH[chan].SLOT[0].op1_out[0] = P_CH[chan].SLOT[0].op1_out[1]; + if (P_CH[chan].SLOT[0].iconnect == 1) + { + output0 += P_CH[chan].SLOT[0].op1_out[0]; + } + else if (P_CH[chan].SLOT[0].iconnect == 2) + { + phase_modulation += P_CH[chan].SLOT[0].op1_out[0]; + } + else + { + + } + P_CH[chan].SLOT[0].op1_out[1] = 0; + if (env < 0x180) + { + if (P_CH[chan].SLOT[0].FB == 0) + { + out1 = 0; + } + P_CH[chan].SLOT[0].op1_out[1] = op_calc1(P_CH[chan].SLOT[0].Cnt, (int)env, (out1 << P_CH[chan].SLOT[0].FB), P_CH[chan].SLOT[0].wavetable); + } + env = volume_calc(chan, 1); + if (env < 0x180) + { + output0 += op_calc(P_CH[chan].SLOT[1].Cnt, (int)env, phase_modulation, P_CH[chan].SLOT[1].wavetable); + } + } + public void OPL_CALC_RH(uint noise) + { + int out1; + uint env; + phase_modulation = 0; + env = volume_calc(6, 0); + out1 = P_CH[6].SLOT[0].op1_out[0] + P_CH[6].SLOT[0].op1_out[1]; + P_CH[6].SLOT[0].op1_out[0] = P_CH[6].SLOT[0].op1_out[1]; + if (P_CH[6].SLOT[0].CON == 0) + { + phase_modulation = P_CH[6].SLOT[0].op1_out[0]; + } + P_CH[6].SLOT[0].op1_out[1] = 0; + if (env < 0x180) + { + if (P_CH[6].SLOT[0].FB == 0) + { + out1 = 0; + } + P_CH[6].SLOT[0].op1_out[1] = op_calc1(P_CH[6].SLOT[0].Cnt, (int)env, (out1 << P_CH[6].SLOT[0].FB), P_CH[6].SLOT[0].wavetable); + } + env = volume_calc(6, 1); + if (env < 0x180) + { + output0 += op_calc(P_CH[6].SLOT[1].Cnt, (int)env, phase_modulation, P_CH[6].SLOT[1].wavetable) * 2; + } + env = volume_calc(7, 0); + if (env < 0x180) + { + byte bit7 = (byte)(((P_CH[7].SLOT[0].Cnt >> 16) >> 7) & 1); + byte bit3 = (byte)(((P_CH[7].SLOT[0].Cnt >> 16) >> 3) & 1); + byte bit2 = (byte)(((P_CH[7].SLOT[0].Cnt >> 16) >> 2) & 1); + byte res1 = (byte)((bit2 ^ bit7) | bit3); + uint phase = (uint)(res1 != 0 ? (0x200 | (0xd0 >> 2)) : 0xd0); + byte bit5e = (byte)(((P_CH[8].SLOT[1].Cnt >> 16) >> 5) & 1); + byte bit3e = (byte)(((P_CH[8].SLOT[1].Cnt >> 16) >> 3) & 1); + byte res2 = (byte)(bit3e ^ bit5e); + if (res2 != 0) + { + phase = (0x200 | (0xd0 >> 2)); + } + if ((phase & 0x200) != 0) + { + if (noise != 0) + { + phase = 0x200 | 0xd0; + } + } + else + { + if (noise != 0) + { + phase = 0xd0 >> 2; + } + } + output0 += op_calc(phase << 16, (int)env, 0, P_CH[7].SLOT[0].wavetable) * 2; + } + env = volume_calc(7, 1); + if (env < 0x180) + { + byte bit8 = (byte)(((P_CH[7].SLOT[0].Cnt >> 16) >> 8) & 1); + uint phase = (uint)(bit8 != 0 ? 0x200 : 0x100); + if (noise != 0) + { + phase ^= 0x100; + } + output0 += op_calc(phase << 16, (int)env, 0, P_CH[7].SLOT[1].wavetable) * 2; + } + env = volume_calc(8, 0); + if (env < 0x180) + { + output0 += op_calc(P_CH[8].SLOT[0].Cnt, (int)env, 0, P_CH[8].SLOT[0].wavetable) * 2; + } + env = volume_calc(8, 1); + if (env < 0x180) + { + byte bit7 = (byte)(((P_CH[7].SLOT[0].Cnt >> 16) >> 7) & 1); + byte bit3 = (byte)(((P_CH[7].SLOT[0].Cnt >> 16) >> 3) & 1); + byte bit2 = (byte)(((P_CH[7].SLOT[0].Cnt >> 16) >> 2) & 1); + byte res1 = (byte)((bit2 ^ bit7) | bit3); + uint phase = (uint)(res1 != 0 ? 0x300 : 0x100); + byte bit5e = (byte)(((P_CH[8].SLOT[1].Cnt >> 16) >> 5) & 1); + byte bit3e = (byte)(((P_CH[8].SLOT[1].Cnt >> 16) >> 3) & 1); + byte res2 = (byte)(bit3e ^ bit5e); + if (res2 != 0) + { + phase = 0x300; + } + output0 += op_calc(phase << 16, (int)env, 0, P_CH[8].SLOT[1].wavetable) * 2; + } + } + public void OPL_STATUS_SET(int flag) + { + status |= (byte)flag; + if ((status & 0x80) == 0) + { + if ((status & statusmask) != 0) + { + status |= 0x80; + if (IRQHandler != null) + { + IRQHandler(1); + } + } + } + } + public void OPL_STATUS_RESET(int flag) + { + status &= (byte)(~flag); + if ((status & 0x80) != 0) + { + if ((status & statusmask) == 0) + { + status &= 0x7f; + if (IRQHandler != null) + { + IRQHandler(0); + } + } + } + } + public void OPL_STATUSMASK_SET(int flag) + { + statusmask = (byte)flag; + OPL_STATUS_SET(0); + OPL_STATUS_RESET(0); + } + public void advance_lfo() + { + byte tmp; + lfo_am_cnt += lfo_am_inc; + if (lfo_am_cnt >= ((uint)210 << 24)) + { + lfo_am_cnt -= ((uint)210 << 24); + } + tmp = lfo_am_table[lfo_am_cnt >> 24]; + if (lfo_am_depth != 0) + { + LFO_AM = tmp; + } + else + { + LFO_AM = (uint)(tmp >> 2); + } + lfo_pm_cnt += lfo_pm_inc; + LFO_PM = (int)(((lfo_pm_cnt >> 24) & 7) | lfo_pm_depth_range); + } + public void advance() + { + int i; + eg_timer += eg_timer_add; + while (eg_timer >= eg_timer_overflow) + { + eg_timer -= eg_timer_overflow; + eg_cnt++; + for (i = 0; i < 9 * 2; i++) + { + switch (P_CH[i / 2].SLOT[i & 1].state) + { + case 4: + if ((eg_cnt & ((1 << P_CH[i / 2].SLOT[i & 1].eg_sh_ar) - 1)) == 0) + { + P_CH[i / 2].SLOT[i & 1].volume += (~P_CH[i / 2].SLOT[i & 1].volume * (eg_inc[P_CH[i / 2].SLOT[i & 1].eg_sel_ar + ((eg_cnt >> P_CH[i / 2].SLOT[i & 1].eg_sh_ar) & 7)])) >> 3; + if (P_CH[i / 2].SLOT[i & 1].volume <= 0) + { + P_CH[i / 2].SLOT[i & 1].volume = 0; + P_CH[i / 2].SLOT[i & 1].state = 3; + } + } + break; + case 3: + if ((eg_cnt & ((1 << P_CH[i / 2].SLOT[i & 1].eg_sh_dr) - 1)) == 0) + { + P_CH[i / 2].SLOT[i & 1].volume += eg_inc[P_CH[i / 2].SLOT[i & 1].eg_sel_dr + ((eg_cnt >> P_CH[i / 2].SLOT[i & 1].eg_sh_dr) & 7)]; + if (P_CH[i / 2].SLOT[i & 1].volume >= P_CH[i / 2].SLOT[i & 1].sl) + { + P_CH[i / 2].SLOT[i & 1].state = 2; + } + } + break; + case 2: + if (P_CH[i / 2].SLOT[i & 1].eg_type != 0) + { + + } + else + { + if ((eg_cnt & ((1 << P_CH[i / 2].SLOT[i & 1].eg_sh_rr) - 1)) == 0) + { + P_CH[i / 2].SLOT[i & 1].volume += eg_inc[P_CH[i / 2].SLOT[i & 1].eg_sel_rr + ((eg_cnt >> P_CH[i / 2].SLOT[i & 1].eg_sh_rr) & 7)]; + if (P_CH[i / 2].SLOT[i & 1].volume >= 0x1ff) + { + P_CH[i / 2].SLOT[i & 1].volume = 0x1ff; + } + } + } + break; + case 1: + if ((eg_cnt & ((1 << P_CH[i / 2].SLOT[i & 1].eg_sh_rr) - 1)) == 0) + { + P_CH[i / 2].SLOT[i & 1].volume += eg_inc[P_CH[i / 2].SLOT[i & 1].eg_sel_rr + ((eg_cnt >> P_CH[i / 2].SLOT[i & 1].eg_sh_rr) & 7)]; + if (P_CH[i / 2].SLOT[i & 1].volume >= 0x1ff) + { + P_CH[i / 2].SLOT[i & 1].volume = 0x1ff; + P_CH[i / 2].SLOT[i & 1].state = 0; + } + } + break; + default: + break; + } + } + } + for (i = 0; i < 9 * 2; i++) + { + if (P_CH[i / 2].SLOT[i & 1].vib != 0) + { + byte block; + uint block_fnum = P_CH[i / 2].block_fnum; + uint fnum_lfo = (block_fnum & 0x0380) >> 7; + int lfo_fn_table_index_offset = lfo_pm_table[LFO_PM + 16 * fnum_lfo]; + if (lfo_fn_table_index_offset != 0) + { + block_fnum += (uint)lfo_fn_table_index_offset; + block = (byte)((block_fnum & 0x1c00) >> 10); + P_CH[i / 2].SLOT[i & 1].Cnt += (fn_tab[block_fnum & 0x03ff] >> (7 - block)) * P_CH[i / 2].SLOT[i & 1].mul; + } + else + { + P_CH[i / 2].SLOT[i & 1].Cnt += P_CH[i / 2].SLOT[i & 1].Incr; + } + } + else + { + P_CH[i / 2].SLOT[i & 1].Cnt += P_CH[i / 2].SLOT[i & 1].Incr; + } + } + noise_p += noise_f; + i = (int)(noise_p >> 16); + noise_p &= 0xffff; + while (i != 0) + { + if ((noise_rng & 1) != 0) + { + noise_rng ^= 0x800302; + } + noise_rng >>= 1; + i--; + } + } + private void CSMKeyControll(int chan) + { + FM_KEYON(chan, 0, 4); + FM_KEYON(chan, 1, 4); + FM_KEYOFF(chan, 0, 4); + FM_KEYOFF(chan, 1, 4); + } + public int OPLTimerOver(int c) + { + if (c != 0) + { + OPL_STATUS_SET(0x20); + } + else + { + OPL_STATUS_SET(0x40); + if ((mode & 0x80) != 0) + { + int ch; + if (UpdateHandler != null) + { + UpdateHandler(0); + } + for (ch = 0; ch < 9; ch++) + { + CSMKeyControll(ch); + } + } + } + if (timer_handler != null) + { + timer_handler(c, Attotime.attotime_mul(TimerBase, T[c])); + } + return status >> 7; + } + public void OPLSetTimerHandler(OPL_TIMERHANDLER _timer_handler) + { + timer_handler = _timer_handler; + } + public void OPLSetIRQHandler(OPL_IRQHANDLER _IRQHandler) + { + IRQHandler = _IRQHandler; + } + public void OPLSetUpdateHandler(OPL_UPDATEHANDLER _UpdateHandler) + { + UpdateHandler = _UpdateHandler; + } + } + public static FM_OPL YM3812, YM3526; + public static int[] slot_array = new int[32] + { + 0, 2, 4, 1, 3, 5,-1,-1, + 6, 8,10, 7, 9,11,-1,-1, + 12,14,16,13,15,17,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1 + }; + public static uint[] ksl_tab = new uint[8 * 16] + { + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + + 0,0,0,0, + 0,0,0,0, + 0,8,12,16, + 20,24,28,32, + + 0,0,0,0, + 0,12,20,28, + 32,40,44,48, + 52,56,60,64, + + 0,0,0,20, + 32,44,52,60, + 64,72,76,80, + 84,88,92,96, + + 0,0,32,52, + 64,76,84,92, + 96,104,108,112, + 116,120,124,128, + + 0,32,64,84, + 96,108,116,124, + 128,136,140,144, + 148,152,156,160, + + 0,64,96,116, + 128,140,148,156, + 160,168,172,176, + 180,184,188,192, + + 0,96,128,148, + 160,172,180,188, + 192,200,204,208, + 212,216,220,224 + }; + public static uint[] sl_tab = new uint[16] + { + 0*16, 1*16, 2*16,3 *16,4 *16,5 *16,6 *16, 7*16, + 8*16, 9*16,10*16,11*16,12*16,13*16,14*16,31*16 + }; + public static byte[] eg_inc = new byte[15 * 8] + { + 0,1, 0,1, 0,1, 0,1, + 0,1, 0,1, 1,1, 0,1, + 0,1, 1,1, 0,1, 1,1, + 0,1, 1,1, 1,1, 1,1, + + 1,1, 1,1, 1,1, 1,1, + 1,1, 1,2, 1,1, 1,2, + 1,2, 1,2, 1,2, 1,2, + 1,2, 2,2, 1,2, 2,2, + + 2,2, 2,2, 2,2, 2,2, + 2,2, 2,4, 2,2, 2,4, + 2,4, 2,4, 2,4, 2,4, + 2,4, 4,4, 2,4, 4,4, + + 4,4, 4,4, 4,4, 4,4, + 8,8, 8,8, 8,8, 8,8, + 0,0, 0,0, 0,0, 0,0, + }; + public static byte[] eg_rate_select = new byte[16 + 64 + 16] + { + 14*8,14*8,14*8,14*8,14*8,14*8,14*8,14*8, + 14*8,14*8,14*8,14*8,14*8,14*8,14*8,14*8, + + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + 0, 1*8, 2*8, 3*8, + + 4*8, 5*8, 6*8, 7*8, + + 8*8, 9*8,10*8,11*8, + + 12*8,12*8,12*8,12*8, + + 12*8,12*8,12*8,12*8,12*8,12*8,12*8,12*8, + 12*8,12*8,12*8,12*8,12*8,12*8,12*8,12*8, + }; + public static byte[] eg_rate_shift = new byte[16 + 64 + 16] + { + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + + 12,12,12,12, + 11,11,11,11, + 10,10,10,10, + 9, 9, 9, 9, + 8, 8, 8, 8, + 7, 7, 7, 7, + 6, 6, 6, 6, + 5, 5, 5, 5, + 4, 4, 4, 4, + 3, 3, 3, 3, + 2, 2, 2, 2, + 1, 1, 1, 1, + 0, 0, 0, 0, + + 0, 0, 0, 0, + + 0, 0, 0, 0, + + 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + public static byte[] mul_tab = new byte[16] + { + 1, 2, 4, 6, 8, 10, 12, 14, + 16, 18,20,20,24,24,30,30 + }; + public static int[] tl_tab; + public static uint[] sin_tab; + public static byte[] lfo_am_table = new byte[210] + { + 0,0,0,0,0,0,0, + 1,1,1,1, + 2,2,2,2, + 3,3,3,3, + 4,4,4,4, + 5,5,5,5, + 6,6,6,6, + 7,7,7,7, + 8,8,8,8, + 9,9,9,9, + 10,10,10,10, + 11,11,11,11, + 12,12,12,12, + 13,13,13,13, + 14,14,14,14, + 15,15,15,15, + 16,16,16,16, + 17,17,17,17, + 18,18,18,18, + 19,19,19,19, + 20,20,20,20, + 21,21,21,21, + 22,22,22,22, + 23,23,23,23, + 24,24,24,24, + 25,25,25,25, + 26,26,26, + 25,25,25,25, + 24,24,24,24, + 23,23,23,23, + 22,22,22,22, + 21,21,21,21, + 20,20,20,20, + 19,19,19,19, + 18,18,18,18, + 17,17,17,17, + 16,16,16,16, + 15,15,15,15, + 14,14,14,14, + 13,13,13,13, + 12,12,12,12, + 11,11,11,11, + 10,10,10,10, + 9,9,9,9, + 8,8,8,8, + 7,7,7,7, + 6,6,6,6, + 5,5,5,5, + 4,4,4,4, + 3,3,3,3, + 2,2,2,2, + 1,1,1,1 + }; + public static sbyte[] lfo_pm_table = new sbyte[8 * 8 * 2] + { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0,-1, 0, 0, 0, + + 1, 0, 0, 0,-1, 0, 0, 0, + 2, 1, 0,-1,-2,-1, 0, 1, + + 1, 0, 0, 0,-1, 0, 0, 0, + 3, 1, 0,-1,-3,-1, 0, 1, + + 2, 1, 0,-1,-2,-1, 0, 1, + 4, 2, 0,-2,-4,-2, 0, 2, + + 2, 1, 0,-1,-2,-1, 0, 1, + 5, 2, 0,-2,-5,-2, 0, 2, + + 3, 1, 0,-1,-3,-1, 0, 1, + 6, 3, 0,-3,-6,-3, 0, 3, + + 3, 1, 0,-1,-3,-1, 0, 1, + 7, 3, 0,-3,-7,-3, 0, 3 + }; + public static int num_lock = 0; + public static int phase_modulation; + public static int output0; + public static uint LFO_AM; + public static int LFO_PM; + public delegate byte OPL_PORTHANDLER_R(); + public delegate void OPL_PORTHANDLER_W(byte data); + public delegate void OPL_TIMERHANDLER(int timer, Atime period); + public delegate void OPL_IRQHANDLER(int irq); + public delegate void OPL_UPDATEHANDLER(int min_interval_us); + private static int limit(int val, int max, int min) + { + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + else + { + return val; + } + } + private static int op_calc(uint phase, int env, int pm, int wave_tab) + { + uint p; + p = (uint)((env << 4) + sin_tab[wave_tab + ((((int)((phase & ~0xffff) + (pm << 16))) >> 16) & 0x3ff)]); + if (p >= 0x1800) + { + return 0; + } + return tl_tab[p]; + } + private static int init_tables() + { + int i, x; + int n; + double o, m; + for (x = 0; x < 0x100; x++) + { + m = (1 << 16) / Math.Pow(2, (x + 1) * (1.0 / 32) / 8.0); + m = Math.Floor(m); + n = (int)m; + n >>= 4; + if ((n & 1) != 0) + { + n = (n >> 1) + 1; + } + else + { + n = n >> 1; + } + n <<= 1; + tl_tab[x * 2 + 0] = n; + tl_tab[x * 2 + 1] = -tl_tab[x * 2 + 0]; + for (i = 1; i < 12; i++) + { + tl_tab[x * 2 + 0 + i * 2 * 0x100] = tl_tab[x * 2 + 0] >> i; + tl_tab[x * 2 + 1 + i * 2 * 0x100] = -tl_tab[x * 2 + 0 + i * 2 * 0x100]; + } + } + for (i = 0; i < 0x400; i++) + { + m = Math.Sin(((i * 2) + 1) * Math.PI / 0x400); + if (m > 0.0) + { + o = 8 * Math.Log(1.0 / m) / Math.Log(2); + } + else + { + o = 8 * Math.Log(-1.0 / m) / Math.Log(2); + } + o = o * 32; + n = (int)(2.0 * o); + if ((n & 1) != 0) + { + n = (n >> 1) + 1; + } + else + { + n = n >> 1; + } + sin_tab[i] = (uint)(n * 2 + (m >= 0.0 ? 0 : 1)); + } + for (i = 0; i < 0x400; i++) + { + if ((i & 0x200) != 0) + { + sin_tab[0x400 + i] = 0x1800; + } + else + { + sin_tab[0x400 + i] = sin_tab[i]; + } + sin_tab[2 * 0x400 + i] = sin_tab[i & (0x3ff >> 1)]; + if ((i & 0x100) != 0) + { + sin_tab[3 * 0x400 + i] = 0x1800; + } + else + { + sin_tab[3 * 0x400 + i] = sin_tab[i & (0x3ff >> 2)]; + } + } + return 1; + } + private static int OPL_LockTable() + { + num_lock++; + if (num_lock > 1) + { + return 0; + } + if (init_tables() == 0) + { + num_lock--; + return -1; + } + return 0; + } + private static void OPL_UnLockTable() + { + if (num_lock != 0) + { + num_lock--; + } + } + private static FM_OPL OPLCreate(int type, int clock, int rate) + { + int i; + FM_OPL OPL = new FM_OPL(); + OPL_LockTable(); + OPL = new FM_OPL(); + OPL.P_CH = new OPL_CH[9]; + OPL.fn_tab = new uint[1024]; + OPL.T = new uint[2]; + OPL.st = new byte[2]; + for (i = 0; i < 9; i++) + { + OPL.P_CH[i].SLOT = new OPL_SLOT[2]; + OPL.P_CH[i].SLOT[0].op1_out = new int[2]; + OPL.P_CH[i].SLOT[1].op1_out = new int[2]; + } + OPL.type = (byte)type; + OPL.clock = clock; + OPL.rate = rate; + OPL.OPL_initalize(); + return OPL; + } + private static void OPLDestroy() + { + OPL_UnLockTable(); + } + public static void ym3812_init(int sndindex, int clock, int rate) + { + YM3812 = OPLCreate(1, clock, rate); + ym3812_reset_chip(); + } + private static void ym3812_shutdown() + { + OPLDestroy(); + } + public static void ym3812_reset_chip() + { + YM3812.OPLResetChip(); + num_lock = 0; + } + public static int ym3812_write(int a, int v) + { + return YM3812.OPLWrite(a, v); + } + public static byte ym3812_read(int a) + { + return (byte)(YM3812.OPLRead(a) | 0x06); + } + public static int ym3812_timer_over(int c) + { + return YM3812.OPLTimerOver(c); + } + public static void ym3812_set_timer_handler(OPL_TIMERHANDLER timer_handler) + { + YM3812.OPLSetTimerHandler(timer_handler); + } + public static void ym3812_set_irq_handler(OPL_IRQHANDLER IRQHandler) + { + YM3812.OPLSetIRQHandler(IRQHandler); + } + public static void ym3812_set_update_handler(OPL_UPDATEHANDLER UpdateHandler) + { + YM3812.OPLSetUpdateHandler(UpdateHandler); + } + public static void ym3812_update_one(int offset, int length) + { + byte rhythm = (byte)(YM3812.rhythm & 0x20); + int i; + for (i = 0; i < length; i++) + { + int lt; + output0 = 0; + YM3812.advance_lfo(); + YM3812.OPL_CALC_CH(0); + YM3812.OPL_CALC_CH(1); + YM3812.OPL_CALC_CH(2); + YM3812.OPL_CALC_CH(3); + YM3812.OPL_CALC_CH(4); + YM3812.OPL_CALC_CH(5); + if (rhythm == 0) + { + YM3812.OPL_CALC_CH(6); + YM3812.OPL_CALC_CH(7); + YM3812.OPL_CALC_CH(8); + } + else + { + YM3812.OPL_CALC_RH((YM3812.noise_rng >> 0) & 1); + } + lt = output0; + lt = limit(lt, 32767, -32768); + Sound.ym3812stream.streamoutput_Ptrs[0][offset + i] = lt; + YM3812.advance(); + } + } + public static FM_OPL ym3526_init(int sndindex, int clock, int rate) + { + YM3526 = OPLCreate(0, clock, rate); + ym3526_reset_chip(); + return YM3526; + } + private static void ym3526_shutdown() + { + OPLDestroy(); + } + public static void ym3526_reset_chip() + { + YM3526.OPLResetChip(); + num_lock = 0; + } + public static int ym3526_write(int a, int v) + { + return YM3526.OPLWrite(a, v); + } + public static byte ym3526_read(int a) + { + return (byte)(YM3526.OPLRead(a) | 0x06); + } + public static void ym3526_set_timer_handler(OPL_TIMERHANDLER timer_handler) + { + YM3526.OPLSetTimerHandler(timer_handler); + } + public static void ym3526_set_irq_handler(OPL_IRQHANDLER IRQHandler) + { + YM3526.OPLSetIRQHandler(IRQHandler); + } + public static void ym3526_set_update_handler(OPL_UPDATEHANDLER UpdateHandler) + { + YM3526.OPLSetUpdateHandler(UpdateHandler); + } + public static int ym3526_timer_over(int c) + { + return YM3526.OPLTimerOver(c); + } + public static void ym3526_update_one(int offset, int length) + { + byte rhythm = (byte)(YM3526.rhythm & 0x20); + int i; + for (i = 0; i < length; i++) + { + int lt; + output0 = 0; + YM3526.advance_lfo(); + YM3526.OPL_CALC_CH(0); + YM3526.OPL_CALC_CH(1); + YM3526.OPL_CALC_CH(2); + YM3526.OPL_CALC_CH(3); + YM3526.OPL_CALC_CH(4); + YM3526.OPL_CALC_CH(5); + if (rhythm == 0) + { + YM3526.OPL_CALC_CH(6); + YM3526.OPL_CALC_CH(7); + YM3526.OPL_CALC_CH(8); + } + else + { + YM3526.OPL_CALC_RH((YM3526.noise_rng >> 0) & 1); + } + lt = output0; + lt = limit(lt, 32767, -32768); + Sound.ym3526stream.streamoutput_Ptrs[0][offset + i] = lt; + YM3526.advance(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FMOpl.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FMOpl.cs.meta new file mode 100644 index 00000000..c7b4bb21 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FMOpl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b69a98bb03e652c4e874c4b91d6887d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/ICS2115.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/ICS2115.cs new file mode 100644 index 00000000..14bef485 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/ICS2115.cs @@ -0,0 +1,487 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class ICS2115 + { + public static byte V_ON = 1, V_DONE = 2; + public static voice_struct[] voice2; + public static timer_struct[] timer; + public static byte[] icsrom; + public static short[] ulaw = new short[256]; + public static byte osc_select; + public static byte reg_select; + public static byte irq_enabled, irq_pending; + public static bool irq_on; + public struct timer_struct + { + public byte scale, preset; + public EmuTimer.emu_timer timer; + public long period; + } + public static void ics2115_w(int offset, byte data) + { + switch (offset) + { + case 1: + reg_select = data; + break; + case 2: + reg_write(data, false); + break; + case 3: + reg_write(data, true); + break; + default: + break; + } + } + public static void timer_cb_0() + { + irq_pending |= 1 << 0; + recalc_irq(); + } + public static void timer_cb_1() + { + irq_pending |= 1 << 1; + recalc_irq(); + } + + public struct voice_struct + { + public ushort fc, addrh, addrl, strth, endh, volacc; + public byte strtl, endl, saddr, pan, conf, ctl; + public byte vstart, vend, vctl; + public byte state; + } + public static void recalc_irq() + { + int i; + bool irq = false; + if ((irq_enabled & irq_pending) != 0) + irq = true; + for (i = 0; irq == false && i < 32; i++) + if ((voice2[i].state & V_DONE) != 0) + irq = true; + if (irq != irq_on) + { + irq_on = irq; + PGM.sound_irq(irq ? (int)LineState.ASSERT_LINE : (int)LineState.CLEAR_LINE); + } + } + public static void ics2115_update(int offset, int length) + { + int osc, i; + bool irq_invalid = false; + for (i = 0; i < length; i++) + { + Sound.ics2115stream.streamoutput_Ptrs[0][offset + i] = 0; + Sound.ics2115stream.streamoutput_Ptrs[1][offset + i] = 0; + } + for (osc = 0; osc < 32; osc++) + { + if ((voice2[osc].state & V_ON) != 0) + { + uint adr = (uint)((voice2[osc].addrh << 16) | voice2[osc].addrl); + uint end = (uint)((voice2[osc].endh << 16) | (voice2[osc].endl << 8)); + uint loop = (uint)((voice2[osc].strth << 16) | (voice2[osc].strtl << 8)); + uint badr = (uint)((voice2[osc].saddr << 20) & 0xffffff); + uint delta = (uint)(voice2[osc].fc << 2); + byte conf = voice2[osc].conf; + int vol = voice2[osc].volacc; + vol = (((vol & 0xff0) | 0x1000) << (vol >> 12)) >> 12; + for (i = 0; i < length; i++) + { + int v; + if ((badr | adr >> 12) >= icsrom.Length) + { + v = 0; + } + else + { + v = icsrom[badr | (adr >> 12)]; + } + if ((conf & 1) != 0) + v = ulaw[v]; + else + v = ((sbyte)v) << 6; + v = (v * vol) >> (16 + 5); + Sound.ics2115stream.streamoutput_Ptrs[0][offset + i] += v; + Sound.ics2115stream.streamoutput_Ptrs[1][offset + i] += v; + adr += delta; + if (adr >= end) + { + adr -= (end - loop); + voice2[osc].state &= (byte)(~V_ON); + voice2[osc].state |= V_DONE; + irq_invalid = true; + break; + } + } + voice2[osc].addrh = (ushort)(adr >> 16); + voice2[osc].addrl = (ushort)(adr); + } + } + if (irq_invalid) + { + recalc_irq(); + } + } + public static void keyon() + { + voice2[osc_select].state |= V_ON; + } + public static void recalc_timer(int i) + { + long period = (long)(1000000000 * timer[i].scale * timer[i].preset / 33868800); + if (period != 0) + period = (long)(1000000000 / 62.8206); + if (timer[i].period != period) + { + timer[i].period = period; + if (period != 0) + EmuTimer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_IN_NSEC(period), Attotime.ATTOTIME_IN_NSEC(period)); + else + EmuTimer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + } + } + static void reg_write(byte data, bool msb) + { + switch (reg_select) + { + case 0x00: // [osc] Oscillator Configuration + if (msb) + { + voice2[osc_select].conf = data; + } + break; + case 0x01: // [osc] Wavesample frequency + // freq = fc*33075/1024 in 32 voices mode, fc*44100/1024 in 24 voices mode + if (msb) + voice2[osc_select].fc = (ushort)((voice2[osc_select].fc & 0xff) | (data << 8)); + else + voice2[osc_select].fc = (ushort)((voice2[osc_select].fc & 0xff00) | data); + break; + case 0x02: // [osc] Wavesample loop start address 19-4 + if (msb) + voice2[osc_select].strth = (ushort)((voice2[osc_select].strth & 0xff) | (data << 8)); + else + voice2[osc_select].strth = (ushort)((voice2[osc_select].strth & 0xff00) | data); + break; + case 0x03: // [osc] Wavesample loop start address 3-0.3-0 + if (msb) + { + voice2[osc_select].strtl = data; + } + break; + case 0x04: // [osc] Wavesample loop end address 19-4 + if (msb) + voice2[osc_select].endh = (ushort)((voice2[osc_select].endh & 0xff) | (data << 8)); + else + voice2[osc_select].endh = (ushort)((voice2[osc_select].endh & 0xff00) | data); + break; + case 0x05: // [osc] Wavesample loop end address 3-0.3-0 + if (msb) + { + voice2[osc_select].endl = data; + } + break; + case 0x07: // [osc] Volume Start + if (msb) + { + voice2[osc_select].vstart = data; + } + break; + case 0x08: // [osc] Volume End + if (msb) + { + voice2[osc_select].vend = data; + } + break; + case 0x09: // [osc] Volume accumulator + if (msb) + voice2[osc_select].volacc = (ushort)((voice2[osc_select].volacc & 0xff) | (data << 8)); + else + voice2[osc_select].volacc = (ushort)((voice2[osc_select].volacc & 0xff00) | data); + break; + case 0x0a: // [osc] Wavesample address 19-4 + if (msb) + voice2[osc_select].addrh = (ushort)((voice2[osc_select].addrh & 0xff) | (data << 8)); + else + voice2[osc_select].addrh = (ushort)((voice2[osc_select].addrh & 0xff00) | data); + break; + case 0x0b: // [osc] Wavesample address 3-0.8-0 + if (msb) + voice2[osc_select].addrl = (ushort)((voice2[osc_select].addrl & 0xff) | (data << 8)); + else + voice2[osc_select].addrl = (ushort)((voice2[osc_select].addrl & 0xff00) | data); + break; + case 0x0c: // [osc] Pan + if (msb) + { + voice2[osc_select].pan = data; + } + break; + case 0x0d: // [osc] Volume Enveloppe Control + if (msb) + { + voice2[osc_select].vctl = data; + } + break; + case 0x10: // [osc] Oscillator Control + if (msb) + { + voice2[osc_select].ctl = data; + if (data == 0) + keyon(); + } + break; + case 0x11: // [osc] Wavesample static address 27-20 + if (msb) + { + voice2[osc_select].saddr = data; + } + break; + + case 0x40: // Timer 1 Preset + if (!msb) + { + timer[0].preset = data; + recalc_timer(0); + } + break; + case 0x41: // Timer 2 Preset + if (!msb) + { + timer[1].preset = data; + recalc_timer(1); + } + break; + case 0x42: // Timer 1 Prescaler + if (!msb) + { + timer[0].scale = data; + recalc_timer(0); + } + break; + case 0x43: // Timer 2 Prescaler + if (!msb) + { + timer[1].scale = data; + recalc_timer(1); + } + break; + case 0x4a: // IRQ Enable + if (!msb) + { + irq_enabled = data; + recalc_irq(); + } + break; + + case 0x4f: // Oscillator Address being Programmed + if (!msb) + { + osc_select = (byte)(data & 31); + } + break; + default: + break; + } + } + public static ushort reg_read() + { + switch (reg_select) + { + case 0x0d: + return 0x100; + case 0x0f: + { + int osc; + byte res = 0xff; + for (osc = 0; osc < 32; osc++) + if ((voice2[osc].state & V_DONE) != 0) + { + voice2[osc].state &= (byte)(~V_DONE); + recalc_irq(); + res = (byte)(0x40 | osc); + break; + } + return (ushort)(res << 8); + } + case 0x40: + irq_pending &= unchecked((byte)(~(1 << 0))); + recalc_irq(); + return timer[0].preset; + case 0x41: + irq_pending &= unchecked((byte)(~(1 << 1))); + recalc_irq(); + return timer[1].preset; + case 0x43: + return (ushort)(irq_pending & 3); + case 0x4a: + return irq_pending; + case 0x4b: + return 0x80; + case 0x4c: + return 0x01; + default: + return 0; + } + } + public static void ics2115_start() + { + int i; + voice2 = new voice_struct[32]; + timer = new timer_struct[2]; + timer[0].timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.ICS2115_timer_cb_0, false); + timer[1].timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.ICS2115_timer_cb_1, false); + ulaw = new short[256]; + for (i = 0; i < 256; i++) + { + byte c = (byte)(~i); + int v; + v = ((c & 15) << 1) + 33; + v <<= ((c & 0x70) >> 4); + if ((c & 0x80) != 0) + v = 33 - v; + else + v = v - 33; + ulaw[i] = (short)v; + } + } + public static byte ics2115_r(int offset) + { + byte ret = 0; + switch (offset) + { + case 0: + if (irq_on) + { + int i; + ret |= 0x80; + if ((irq_enabled & irq_pending & 3) != 0) + ret |= 1; + for (i = 0; i < 32; i++) + if ((voice2[i].state & V_DONE) != 0) + { + ret |= 2; + break; + } + } + break; + case 1: + ret = reg_select; + break; + case 2: + ret = (byte)(reg_read()); + break; + case 3: + ret = (byte)(reg_read() >> 8); + break; + default: + break; + } + return ret; + } + public static void ics2115_reset() + { + int i; + irq_enabled = 0; + irq_pending = 0; + for (i = 0; i < 32; i++) + { + voice2[i].fc = 0; + voice2[i].addrh = 0; + voice2[i].addrl = 0; + voice2[i].strth = 0; + voice2[i].endh = 0; + voice2[i].volacc = 0; + voice2[i].strtl = 0; + voice2[i].endl = 0; + voice2[i].saddr = 0; + voice2[i].pan = 0; + voice2[i].conf = 0; + voice2[i].ctl = 0; + voice2[i].vstart = 0; + voice2[i].vend = 0; + voice2[i].vctl = 0; + voice2[i].state = 0; + } + for (i = 0; i < 2; i++) + { + EmuTimer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + timer[i].period = 0; + } + recalc_irq(); + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + for (i = 0; i < 32; i++) + { + writer.Write(voice2[i].fc); + writer.Write(voice2[i].addrh); + writer.Write(voice2[i].addrl); + writer.Write(voice2[i].strth); + writer.Write(voice2[i].endh); + writer.Write(voice2[i].volacc); + writer.Write(voice2[i].strtl); + writer.Write(voice2[i].endl); + writer.Write(voice2[i].saddr); + writer.Write(voice2[i].pan); + writer.Write(voice2[i].conf); + writer.Write(voice2[i].ctl); + writer.Write(voice2[i].vstart); + writer.Write(voice2[i].vend); + writer.Write(voice2[i].vctl); + writer.Write(voice2[i].state); + } + for (i = 0; i < 2; i++) + { + writer.Write(timer[i].scale); + writer.Write(timer[i].preset); + writer.Write(timer[i].period); + } + writer.Write(osc_select); + writer.Write(reg_select); + writer.Write(irq_enabled); + writer.Write(irq_pending); + writer.Write(irq_on); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + for (i = 0; i < 32; i++) + { + voice2[i].fc = reader.ReadUInt16(); + voice2[i].addrh = reader.ReadUInt16(); + voice2[i].addrl = reader.ReadUInt16(); + voice2[i].strth = reader.ReadUInt16(); + voice2[i].endh = reader.ReadUInt16(); + voice2[i].volacc = reader.ReadUInt16(); + voice2[i].strtl = reader.ReadByte(); + voice2[i].endl = reader.ReadByte(); + voice2[i].saddr = reader.ReadByte(); + voice2[i].pan = reader.ReadByte(); + voice2[i].conf = reader.ReadByte(); + voice2[i].ctl = reader.ReadByte(); + voice2[i].vstart = reader.ReadByte(); + voice2[i].vend = reader.ReadByte(); + voice2[i].vctl = reader.ReadByte(); + voice2[i].state = reader.ReadByte(); + } + for (i = 0; i < 2; i++) + { + timer[i].scale = reader.ReadByte(); + timer[i].preset = reader.ReadByte(); + timer[i].period = reader.ReadInt64(); + } + osc_select = reader.ReadByte(); + reg_select = reader.ReadByte(); + irq_enabled = reader.ReadByte(); + irq_pending = reader.ReadByte(); + irq_on = reader.ReadBoolean(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/ICS2115.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/ICS2115.cs.meta new file mode 100644 index 00000000..694a34b7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/ICS2115.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 236aac654adcf5041b9ed8a793187e62 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Iremga20.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Iremga20.cs new file mode 100644 index 00000000..42305286 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Iremga20.cs @@ -0,0 +1,200 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class Iremga20 + { + public struct IremGA20_channel_def + { + public int rate; + public int size; + public int start; + public int pos; + public int frac; + public int end; + public int volume; + public int pan; + public int effect; + public int play; + }; + public struct IremGA20_chip_def + { + public ushort[] regs; + public IremGA20_channel_def[] channel; + }; + public static IremGA20_chip_def chip; + public static byte[] iremrom; + public static void iremga20_update(int offset, int length) + { + int[] rate = new int[4], pos = new int[4], frac = new int[4], end = new int[4], vol = new int[4], play = new int[4]; + int i, sampleout; + for (i = 0; i < 4; i++) + { + rate[i] = chip.channel[i].rate; + pos[i] = chip.channel[i].pos; + frac[i] = chip.channel[i].frac; + end[i] = chip.channel[i].end - 0x20; + vol[i] = chip.channel[i].volume; + play[i] = chip.channel[i].play; + } + i = length; + for (i = 0; i < length; i++) + { + sampleout = 0; + if (play[0] != 0) + { + sampleout += (iremrom[pos[0]] - 0x80) * vol[0]; + frac[0] += rate[0]; + pos[0] += frac[0] >> 24; + frac[0] &= 0xffffff; + play[0] = pos[0] < end[0] ? 1 : 0; + } + if (play[1] != 0) + { + sampleout += (iremrom[pos[1]] - 0x80) * vol[1]; + frac[1] += rate[1]; + pos[1] += frac[1] >> 24; + frac[1] &= 0xffffff; + play[1] = pos[1] < end[1] ? 1 : 0; + } + if (play[2] != 0) + { + sampleout += (iremrom[pos[2]] - 0x80) * vol[2]; + frac[2] += rate[2]; + pos[2] += frac[2] >> 24; + frac[2] &= 0xffffff; + play[2] = pos[2] < end[2] ? 1 : 0; + } + if (play[3] != 0) + { + sampleout += (iremrom[pos[3]] - 0x80) * vol[3]; + frac[3] += rate[3]; + pos[3] += frac[3] >> 24; + frac[3] &= 0xffffff; + play[3] = pos[3] < end[3] ? 1 : 0; + } + sampleout >>= 2; + Sound.iremga20stream.streamoutput_Ptrs[0][offset + i] = sampleout; + Sound.iremga20stream.streamoutput_Ptrs[1][offset + i] = sampleout; + } + for (i = 0; i < 4; i++) + { + chip.channel[i].pos = pos[i]; + chip.channel[i].frac = frac[i]; + chip.channel[i].play = play[i]; + } + } + public static void irem_ga20_w(int offset, ushort data) + { + int channel; + Sound.iremga20stream.stream_update(); + channel = offset >> 3; + chip.regs[offset] = data; + switch (offset & 0x7) + { + case 0: + chip.channel[channel].start = ((chip.channel[channel].start) & 0xff000) | (data << 4); + break; + case 1: + chip.channel[channel].start = ((chip.channel[channel].start) & 0x00ff0) | (data << 12); + break; + case 2: + chip.channel[channel].end = ((chip.channel[channel].end) & 0xff000) | (data << 4); + break; + case 3: + chip.channel[channel].end = ((chip.channel[channel].end) & 0x00ff0) | (data << 12); + break; + case 4: + chip.channel[channel].rate = 0x1000000 / (256 - data); + break; + case 5: + chip.channel[channel].volume = (data * 0x100) / (data + 10); + break; + case 6: + chip.channel[channel].play = data; + chip.channel[channel].pos = chip.channel[channel].start; + chip.channel[channel].frac = 0; + break; + } + } + public static ushort irem_ga20_r(int offset) + { + int channel; + ushort result; + Sound.iremga20stream.stream_update(); + channel = offset >> 3; + switch (offset & 0x7) + { + case 7: + result = (ushort)(chip.channel[channel].play != 0 ? 1 : 0); + break; + default: + result = 0; + break; + } + return result; + } + public static void iremga20_reset() + { + int i; + for (i = 0; i < 4; i++) + { + chip.channel[i].rate = 0; + chip.channel[i].size = 0; + chip.channel[i].start = 0; + chip.channel[i].pos = 0; + chip.channel[i].frac = 0; + chip.channel[i].end = 0; + chip.channel[i].volume = 0; + chip.channel[i].pan = 0; + chip.channel[i].effect = 0; + chip.channel[i].play = 0; + } + } + public static void iremga20_start() + { + int i; + chip.regs = new ushort[0x40]; + chip.channel = new IremGA20_channel_def[4]; + iremga20_reset(); + for (i = 0; i < 0x40; i++) + { + chip.regs[i] = 0; + } + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + for (i = 0; i < 4; i++) + { + writer.Write(chip.channel[i].rate); + writer.Write(chip.channel[i].size); + writer.Write(chip.channel[i].start); + writer.Write(chip.channel[i].pos); + writer.Write(chip.channel[i].frac); + writer.Write(chip.channel[i].end); + writer.Write(chip.channel[i].volume); + writer.Write(chip.channel[i].pan); + writer.Write(chip.channel[i].effect); + writer.Write(chip.channel[i].play); + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + for (i = 0; i < 4; i++) + { + chip.channel[i].rate = reader.ReadInt32(); + chip.channel[i].size = reader.ReadInt32(); + chip.channel[i].start = reader.ReadInt32(); + chip.channel[i].pos = reader.ReadInt32(); + chip.channel[i].frac = reader.ReadInt32(); + chip.channel[i].end = reader.ReadInt32(); + chip.channel[i].volume = reader.ReadInt32(); + chip.channel[i].pan = reader.ReadInt32(); + chip.channel[i].effect = reader.ReadInt32(); + chip.channel[i].play = reader.ReadInt32(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Iremga20.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Iremga20.cs.meta new file mode 100644 index 00000000..fca7d4f4 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Iremga20.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 412ec3fcaf7a99e4f870435f2e863886 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K007232.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K007232.cs new file mode 100644 index 00000000..93a043a5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K007232.cs @@ -0,0 +1,314 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class K007232 + { + public struct kdacApcm + { + public byte[][] vol; + public uint[] addr; + public uint[] start; + public uint[] step; + public uint[] bank; + public int[] play; + + public byte[] wreg; + public int[] pcmbuf_offset; + + public int clock; + public int pcmlimit; + public portwritehandler portwritehandler; + public uint[] fncode; + } + public static kdacApcm info; + public static byte[] k007232rom; + public delegate void portwritehandler(int v); + public static void KDAC_A_make_fncode() + { + int i; + for (i = 0; i < 0x200; i++) + { + info.fncode[i] = (uint)((32 << 12) / (0x200 - i)); + } + } + public static void KDAC_A_update(int offset, int length) + { + int i, j; + for (i = 0; i < 2; i++) + { + for (j = 0; j < length; j++) + { + Sound.k007232stream.streamoutput_Ptrs[i][offset + j] = 0; + } + } + for (i = 0; i < 2; i++) + { + if (info.play[i] != 0) + { + int volA, volB, out1; + uint addr, old_addr; + addr = info.start[i] + ((info.addr[i] >> 12) & 0x000fffff); + volA = info.vol[i][0] * 2; + volB = info.vol[i][1] * 2; + for (j = 0; j < length; j++) + { + old_addr = addr; + addr = info.start[i] + ((info.addr[i] >> 12) & 0x000fffff); + while (old_addr <= addr) + { + if ((k007232rom[info.pcmbuf_offset[i] + old_addr] & 0x80) != 0 || old_addr >= info.pcmlimit) + { + if ((info.wreg[0x0d] & (1 << i)) != 0) + { + info.start[i] = + ((((uint)info.wreg[i * 0x06 + 0x04] << 16) & 0x00010000) | + (((uint)info.wreg[i * 0x06 + 0x03] << 8) & 0x0000ff00) | + (((uint)info.wreg[i * 0x06 + 0x02]) & 0x000000ff) | + info.bank[i]); + addr = info.start[i]; + info.addr[i] = 0; + old_addr = addr; + } + else + { + info.play[i] = 0; + } + break; + } + old_addr++; + } + if (info.play[i] == 0) + { + break; + } + info.addr[i] += info.step[i]; + out1 = (k007232rom[info.pcmbuf_offset[i] + addr] & 0x7f) - 0x40; + Sound.k007232stream.streamoutput_Ptrs[0][offset + j] += out1 * volA; + Sound.k007232stream.streamoutput_Ptrs[1][offset + j] += out1 * volB; + } + } + } + } + public static void k007232_start(int clock) + { + int i; + info = new kdacApcm(); + info.portwritehandler = Konami68000.volume_callback; + info.pcmbuf_offset = new int[2]; + info.addr = new uint[2]; + info.start = new uint[2]; + info.step = new uint[2]; + info.play = new int[2]; + info.bank = new uint[2]; + info.vol = new byte[2][]; + info.wreg = new byte[0x10]; + info.fncode = new uint[0x200]; + info.pcmbuf_offset[0] = 0; + info.pcmbuf_offset[1] = 0; + info.pcmlimit = k007232rom.Length; + info.clock = clock; + for (i = 0; i < 2; i++) + { + info.start[i] = 0; + info.step[i] = 0; + info.play[i] = 0; + info.bank[i] = 0; + info.vol[i] = new byte[2]; + } + info.vol[0][0] = 255; + info.vol[0][1] = 0; + info.vol[1][0] = 0; + info.vol[1][1] = 255; + for (i = 0; i < 0x10; i++) + { + info.wreg[i] = 0; + } + KDAC_A_make_fncode(); + } + public static void k007232_WriteReg(int r, int v, int chip) + { + int data; + Sound.k007232stream.stream_update(); + info.wreg[r] = (byte)v; + if (r == 0x0c) + { + if (info.portwritehandler != null) + { + info.portwritehandler(v); + } + return; + } + else if (r == 0x0d) + { + return; + } + else + { + int reg_port; + reg_port = 0; + if (r >= 0x06) + { + reg_port = 1; + r -= 0x06; + } + switch (r) + { + case 0x00: + case 0x01: + data = (int)(((((uint)info.wreg[reg_port * 0x06 + 0x01]) << 8) & 0x0100) | (((uint)info.wreg[reg_port * 0x06 + 0x00]) & 0x00ff)); + info.step[reg_port] = info.fncode[data]; + break; + case 0x02: + case 0x03: + case 0x04: + break; + case 0x05: + info.start[reg_port] = + ((((uint)info.wreg[reg_port * 0x06 + 0x04] << 16) & 0x00010000) | + (((uint)info.wreg[reg_port * 0x06 + 0x03] << 8) & 0x0000ff00) | + (((uint)info.wreg[reg_port * 0x06 + 0x02]) & 0x000000ff) | + info.bank[reg_port]); + if (info.start[reg_port] < info.pcmlimit) + { + info.play[reg_port] = 1; + info.addr[reg_port] = 0; + } + break; + } + } + } + public static int k007232_ReadReg(int r, int chip) + { + int ch = 0; + if (r == 0x0005 || r == 0x000b) + { + ch = r / 0x0006; + r = ch * 0x0006; + info.start[ch] = + ((((uint)info.wreg[r + 0x04] << 16) & 0x00010000) | + (((uint)info.wreg[r + 0x03] << 8) & 0x0000ff00) | + (((uint)info.wreg[r + 0x02]) & 0x000000ff) | + info.bank[ch]); + if (info.start[ch] < info.pcmlimit) + { + info.play[ch] = 1; + info.addr[ch] = 0; + } + } + return 0; + } + public static void k007232_write_port_0_w(int offset, byte data) + { + k007232_WriteReg(offset, data, 0); + } + public static byte k007232_read_port_0_r(int offset) + { + return (byte)k007232_ReadReg(offset, 0); + } + public static void k007232_write_port_1_w(int offset, byte data) + { + k007232_WriteReg(offset, data, 1); + } + public static byte k007232_read_port_1_r(int offset) + { + return (byte)k007232_ReadReg(offset, 1); + } + public static void k007232_write_port_2_w(int offset, byte data) + { + k007232_WriteReg(offset, data, 2); + } + public static byte k007232_read_port_2_r(int offset) + { + return (byte)k007232_ReadReg(offset, 2); + } + public static void k007232_set_volume(int chip, int channel, int volumeA, int volumeB) + { + info.vol[channel][0] = (byte)volumeA; + info.vol[channel][1] = (byte)volumeB; + } + public static void k007232_set_bank(int chip, int chABank, int chBBank) + { + info.bank[0] = (uint)(chABank << 17); + info.bank[1] = (uint)(chBBank << 17); + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + writer.Write(info.vol[i][j]); + } + } + for (i = 0; i < 2; i++) + { + writer.Write(info.addr[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(info.start[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(info.step[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(info.bank[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(info.play[i]); + } + for (i = 0; i < 0x10; i++) + { + writer.Write(info.wreg[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(info.pcmbuf_offset[i]); + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + info.vol[i][j] = reader.ReadByte(); + } + } + for (i = 0; i < 2; i++) + { + info.addr[i] = reader.ReadUInt32(); + } + for (i = 0; i < 2; i++) + { + info.start[i] = reader.ReadUInt32(); + } + for (i = 0; i < 2; i++) + { + info.step[i] = reader.ReadUInt32(); + } + for (i = 0; i < 2; i++) + { + info.bank[i] = reader.ReadUInt32(); + } + for (i = 0; i < 2; i++) + { + info.play[i] = reader.ReadInt32(); + } + for (i = 0; i < 0x10; i++) + { + info.wreg[i] = reader.ReadByte(); + } + for (i = 0; i < 2; i++) + { + info.pcmbuf_offset[i] = reader.ReadInt32(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K007232.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K007232.cs.meta new file mode 100644 index 00000000..e2f22aac --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K007232.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48a23952a1691ad4cbee825bf612fc57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K053260.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K053260.cs new file mode 100644 index 00000000..c85f18ed --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K053260.cs @@ -0,0 +1,429 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class K053260 + { + public struct k053260_channel_def + { + public uint rate; + public uint size; + public uint start; + public uint bank; + public uint volume; + public int play; + public uint pan; + public uint pos; + public int loop; + public int ppcm; + public int ppcm_data; + }; + public struct k053260_chip_def + { + public int mode; + public int[] regs; + public int rom_size; + public uint[] delta_table; + public k053260_channel_def[] channels; + }; + public static byte[] k053260rom; + public static k053260_chip_def ic1; + public static void InitDeltaTable(int rate, int clock) + { + int i; + double base1 = (double)rate; + double max = (double)(clock); + uint val; + for (i = 0; i < 0x1000; i++) + { + double v = (double)(0x1000 - i); + double target = (max) / v; + double fixed1 = (double)(1 << 16); + if ((target != 0) && (base1 != 0)) + { + target = fixed1 / (base1 / target); + val = (uint)target; + if (val == 0) + { + val = 1; + } + } + else + { + val = 1; + } + ic1.delta_table[i] = val; + } + } + public static void k053260_reset() + { + int i; + for (i = 0; i < 4; i++) + { + ic1.channels[i].rate = 0; + ic1.channels[i].size = 0; + ic1.channels[i].start = 0; + ic1.channels[i].bank = 0; + ic1.channels[i].volume = 0; + ic1.channels[i].play = 0; + ic1.channels[i].pan = 0; + ic1.channels[i].pos = 0; + ic1.channels[i].loop = 0; + ic1.channels[i].ppcm = 0; + ic1.channels[i].ppcm_data = 0; + } + } + public static byte k053260_read(int chip, int offset) + { + byte result = 0; + switch (offset) + { + case 0x29: + { + int i, status = 0; + for (i = 0; i < 4; i++) + { + status |= ic1.channels[i].play << i; + } + result = (byte)status; + } + break; + + case 0x2e: /* read rom */ + if ((ic1.mode & 1) != 0) + { + int offs = (int)(ic1.channels[0].start + (ic1.channels[0].pos >> 16) + (ic1.channels[0].bank << 16)); + ic1.channels[0].pos += (1 << 16); + if (offs > ic1.rom_size) + { + result = 0; + } + result = k053260rom[offs]; + } + break; + default: + result = (byte)ic1.regs[offset]; + break; + } + return result; + } + public static byte k053260_0_r(int offset) + { + return k053260_read(0, offset); + } + public static void k053260_update(int offset, int length) + { + long[] dpcmcnv = new long[] { 0, 1, 2, 4, 8, 16, 32, 64, -128, -64, -32, -16, -8, -4, -2, -1 }; + int i, j; + uint[] rom_offset; + int[] lvol, rvol, play, loop, ppcm_data, ppcm; + rom_offset = new uint[4]; + lvol = new int[4]; + rvol = new int[4]; + play = new int[4]; + loop = new int[4]; + ppcm_data = new int[4]; + ppcm = new int[4]; + byte[] rom; + rom = new byte[4]; + uint[] delta, end, pos; + delta = new uint[4]; + end = new uint[4]; + pos = new uint[4]; + int dataL, dataR; + sbyte d; + for (i = 0; i < 4; i++) + { + rom_offset[i] = ic1.channels[i].start + (ic1.channels[i].bank << 16); + delta[i] = ic1.delta_table[ic1.channels[i].rate]; + lvol[i] = (int)(ic1.channels[i].volume * ic1.channels[i].pan); + rvol[i] = (int)(ic1.channels[i].volume * (8 - ic1.channels[i].pan)); + end[i] = ic1.channels[i].size; + pos[i] = ic1.channels[i].pos; + play[i] = ic1.channels[i].play; + loop[i] = ic1.channels[i].loop; + ppcm[i] = ic1.channels[i].ppcm; + ppcm_data[i] = ic1.channels[i].ppcm_data; + if (ppcm[i] != 0) + { + delta[i] /= 2; + } + } + for (j = 0; j < length; j++) + { + dataL = dataR = 0; + for (i = 0; i < 4; i++) + { + if (play[i] != 0) + { + if ((pos[i] >> 16) >= end[i]) + { + ppcm_data[i] = 0; + if (loop[i] != 0) + { + pos[i] = 0; + } + else + { + play[i] = 0; + continue; + } + } + if (ppcm[i] != 0) + { + if (pos[i] == 0 || ((pos[i] ^ (pos[i] - delta[i])) & 0x8000) == 0x8000) + { + int newdata; + if ((pos[i] & 0x8000) != 0) + { + newdata = (k053260rom[rom_offset[i] + (pos[i] >> 16)] >> 4) & 0x0f; + } + else + { + newdata = k053260rom[rom_offset[i] + (pos[i] >> 16)] & 0x0f; + } + ppcm_data[i] = (int)(((ppcm_data[i] * 62) >> 6) + dpcmcnv[newdata]); + if (ppcm_data[i] > 127) + { + ppcm_data[i] = 127; + } + else + { + if (ppcm_data[i] < -128) + { + ppcm_data[i] = -128; + } + } + } + d = (sbyte)ppcm_data[i]; + pos[i] += delta[i]; + } + else + { + d = (sbyte)k053260rom[rom_offset[i] + (pos[i] >> 16)]; + pos[i] += delta[i]; + } + if ((ic1.mode & 2) != 0) + { + dataL += (d * lvol[i]) >> 2; + dataR += (d * rvol[i]) >> 2; + } + } + } + if (dataL < -32768) + { + dataL = -32768; + } + else if (dataL > 32767) + { + dataL = 32767; + } + if (dataR < -32768) + { + dataR = -32768; + } + else if (dataR > 32767) + { + dataR = 32767; + } + Sound.k053260stream.streamoutput_Ptrs[1][offset + j] = dataL; + Sound.k053260stream.streamoutput_Ptrs[0][offset + j] = dataR; + } + for (i = 0; i < 4; i++) + { + ic1.channels[i].pos = pos[i]; + ic1.channels[i].play = play[i]; + ic1.channels[i].ppcm_data = ppcm_data[i]; + } + } + public static void k053260_start(int clock) + { + int rate = clock / 32; + int i; + ic1.regs = new int[0x30]; + ic1.channels = new k053260_channel_def[4]; + ic1.mode = 0; + ic1.rom_size = k053260rom.Length - 1; + k053260_reset(); + for (i = 0; i < 0x30; i++) + { + ic1.regs[i] = 0; + } + ic1.delta_table = new uint[0x1000]; + InitDeltaTable(rate, clock); + } + public static void check_bounds(int channel) + { + int channel_start = (int)((ic1.channels[channel].bank << 16) + ic1.channels[channel].start); + int channel_end = (int)(channel_start + ic1.channels[channel].size - 1); + if (channel_start > ic1.rom_size) + { + ic1.channels[channel].play = 0; + return; + } + + if (channel_end > ic1.rom_size) + { + ic1.channels[channel].size = (uint)(ic1.rom_size - channel_start); + } + } + public static void k053260_write(int chip, int offset, byte data) + { + int i, t; + int r = offset; + int v = data; + if (r > 0x2f) + { + return; + } + Sound.k053260stream.stream_update(); + if (r == 0x28) + { + t = ic1.regs[r] ^ v; + for (i = 0; i < 4; i++) + { + if ((t & (1 << i)) != 0) + { + if ((v & (1 << i)) != 0) + { + ic1.channels[i].play = 1; + ic1.channels[i].pos = 0; + ic1.channels[i].ppcm_data = 0; + check_bounds(i); + } + else + { + ic1.channels[i].play = 0; + } + } + } + ic1.regs[r] = v; + return; + } + ic1.regs[r] = v; + if (r < 8) + { + return; + } + if (r < 0x28) + { + int channel = (r - 8) / 8; + switch ((r - 8) & 0x07) + { + case 0: + ic1.channels[channel].rate &= 0x0f00; + ic1.channels[channel].rate |= (uint)v; + break; + case 1: + ic1.channels[channel].rate &= 0x00ff; + ic1.channels[channel].rate |= (uint)((v & 0x0f) << 8); + break; + case 2: + ic1.channels[channel].size &= 0xff00; + ic1.channels[channel].size |= (uint)v; + break; + case 3: + ic1.channels[channel].size &= 0x00ff; + ic1.channels[channel].size |= (uint)(v << 8); + break; + case 4: + ic1.channels[channel].start &= 0xff00; + ic1.channels[channel].start |= (uint)v; + break; + case 5: + ic1.channels[channel].start &= 0x00ff; + ic1.channels[channel].start |= (uint)(v << 8); + break; + case 6: + ic1.channels[channel].bank = (uint)(v & 0xff); + break; + case 7: + ic1.channels[channel].volume = (uint)(((v & 0x7f) << 1) | (v & 1)); + break; + } + return; + } + switch (r) + { + case 0x2a: + for (i = 0; i < 4; i++) + ic1.channels[i].loop = ((v & (1 << i)) != 0 ? 1 : 0); + for (i = 4; i < 8; i++) + ic1.channels[i - 4].ppcm = ((v & (1 << i)) != 0 ? 1 : 0); + break; + case 0x2c: + ic1.channels[0].pan = (uint)(v & 7); + ic1.channels[1].pan = (uint)((v >> 3) & 7); + break; + case 0x2d: + ic1.channels[2].pan = (uint)(v & 7); + ic1.channels[3].pan = (uint)((v >> 3) & 7); + break; + case 0x2f: + ic1.mode = v & 7; + break; + } + } + public static void k053260_0_w(int offset, byte data) + { + k053260_write(0, offset, data); + } + public static void k053260_0_lsb_w(int offset, ushort data) + { + //if (ACCESSING_BITS_0_7) + { + k053260_0_w(offset, (byte)(data & 0xff)); + } + } + public static void k053260_0_lsb_w2(int offset, byte data) + { + k053260_0_w(offset, data); + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + writer.Write(ic1.mode); + for (i = 0; i < 0x30; i++) + { + writer.Write(ic1.regs[i]); + } + for (i = 0; i < 4; i++) + { + writer.Write(ic1.channels[i].rate); + writer.Write(ic1.channels[i].size); + writer.Write(ic1.channels[i].start); + writer.Write(ic1.channels[i].bank); + writer.Write(ic1.channels[i].volume); + writer.Write(ic1.channels[i].play); + writer.Write(ic1.channels[i].pan); + writer.Write(ic1.channels[i].pos); + writer.Write(ic1.channels[i].loop); + writer.Write(ic1.channels[i].ppcm); + writer.Write(ic1.channels[i].ppcm_data); + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + ic1.mode = reader.ReadInt32(); + for (i = 0; i < 0x30; i++) + { + ic1.regs[i] = reader.ReadInt32(); + } + for (i = 0; i < 4; i++) + { + ic1.channels[i].rate = reader.ReadUInt32(); + ic1.channels[i].size = reader.ReadUInt32(); + ic1.channels[i].start = reader.ReadUInt32(); + ic1.channels[i].bank = reader.ReadUInt32(); + ic1.channels[i].volume = reader.ReadUInt32(); + ic1.channels[i].play = reader.ReadInt32(); + ic1.channels[i].pan = reader.ReadUInt32(); + ic1.channels[i].pos = reader.ReadUInt32(); + ic1.channels[i].loop = reader.ReadInt32(); + ic1.channels[i].ppcm = reader.ReadInt32(); + ic1.channels[i].ppcm_data = reader.ReadInt32(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K053260.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K053260.cs.meta new file mode 100644 index 00000000..0d5760e9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K053260.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eec5e4b530833594cab5990daf0fd0f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K054539.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K054539.cs new file mode 100644 index 00000000..eaa0862c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K054539.cs @@ -0,0 +1,629 @@ +using System; +using System.IO; + +namespace MAME.Core +{ + public unsafe class K054539 + { + public struct k054539_channel + { + public int pos; + public int pfrac; + public int val; + public int pval; + } + public struct k054539_info + { + public double[] voltab; + public double[] pantab; + + public double[] k054539_gain; + public byte[][] k054539_posreg_latch; + public int k054539_flags; + + public byte[] regs; + public short[] ram; + public int reverb_pos; + + public int cur_ptr; + public int cur_limit; + public byte[] cur_zone; + public byte[] rom; + public int rom_size; + public uint rom_mask; + + public k054539_channel[] channels; + } + public static byte[] k054539rom; + public static k054539_info info; + public static int zoneflag, zonedata; + public static apanhandler apan; + public static irqhandler irq; + public delegate void apanhandler(double d1, double d2); + public delegate void irqhandler(); + public static bool k054539_regupdate() + { + return (info.regs[0x22f] & 0x80) == 0; + } + public static void k054539_keyon(int channel) + { + if (k054539_regupdate()) + { + info.regs[0x22c] |= (byte)(1 << channel); + } + } + public static void k054539_keyoff(int channel) + { + if (k054539_regupdate()) + { + info.regs[0x22c] &= (byte)(~(1 << channel)); + } + } + public static void k054539_update(int offset, int length) + { + short[] dpcm = new short[16] { + 0<<8, 1<<8, 4<<8, 9<<8, 16<<8, 25<<8, 36<<8, 49<<8, + -64<<8, -49<<8, -36<<8, -25<<8, -16<<8, -9<<8, -4<<8, -1<<8 + }; + int j, ch, reverb_pos; + byte[] samples; + int rom_mask; + int offset1; + int base1_offset, base2_offset; + k054539_channel chan; + int cur_pos, cur_pfrac, cur_val, cur_pval; + int delta, rdelta, fdelta, pdelta; + int vol, bval, pan, i; + double gain, lvol, rvol, rbvol; + reverb_pos = info.reverb_pos; + for (i = 0; i < 2; i++) + { + for (j = 0; j < length; j++) + { + Sound.k054539stream.streamoutput_Ptrs[i][offset + j] = 0; + } + } + samples = k054539rom;//info.rom; + rom_mask = (int)info.rom_mask; + if ((info.regs[0x22f] & 1) == 0) + { + return; + } + info.reverb_pos = (reverb_pos + length) & 0x3fff; + for (ch = 0; ch < 8; ch++) + { + if ((info.regs[0x22c] & (1 << ch)) != 0) + { + base1_offset = 0x20 * ch; + base2_offset = 0x200 + 0x2 * ch; + chan = info.channels[ch]; + delta = info.regs[base1_offset + 0x00] | (info.regs[base1_offset + 0x01] << 8) | (info.regs[base1_offset + 0x02] << 16); + vol = info.regs[base1_offset + 0x03]; + bval = vol + info.regs[base1_offset + 0x04]; + if (bval > 255) + { + bval = 255; + } + pan = info.regs[base1_offset + 0x05]; + if (pan >= 0x81 && pan <= 0x8f) + { + pan -= 0x81; + } + else if (pan >= 0x11 && pan <= 0x1f) + { + pan -= 0x11; + } + else + { + pan = 0x18 - 0x11; + } + gain = info.k054539_gain[ch]; + lvol = info.voltab[vol] * info.pantab[pan] * gain; + if (lvol > 1.80) + { + lvol = 1.80; + } + rvol = info.voltab[vol] * info.pantab[0xe - pan] * gain; + if (rvol > 1.80) + { + rvol = 1.80; + } + rbvol = info.voltab[bval] * gain / 2; + if (rbvol > 1.80) + { + rbvol = 1.80; + } + rdelta = (info.regs[base1_offset + 6] | (info.regs[base1_offset + 7] << 8)) >> 3; + rdelta = (int)(rdelta + reverb_pos) & 0x3fff; + cur_pos = (info.regs[base1_offset + 0x0c] | (info.regs[base1_offset + 0x0d] << 8) | (info.regs[base1_offset + 0x0e] << 16)) & rom_mask; + offset1 = offset; + if ((info.regs[base2_offset + 0] & 0x20) != 0) + { + delta = -delta; + fdelta = +0x10000; + pdelta = -1; + } + else + { + fdelta = -0x10000; + pdelta = +1; + } + if (cur_pos != chan.pos) + { + chan.pos = cur_pos; + cur_pfrac = 0; + cur_val = 0; + cur_pval = 0; + } + else + { + cur_pfrac = chan.pfrac; + cur_val = chan.val; + cur_pval = chan.pval; + } + switch (info.regs[base2_offset + 0] & 0xc) + { + case 0x0: + { + for (i = 0; i < length; i++) + { + cur_pfrac += delta; + while ((cur_pfrac & ~0xffff) != 0) + { + cur_pfrac += fdelta; + cur_pos += pdelta; + cur_pval = cur_val; + cur_val = (short)(samples[cur_pos] << 8); + if (cur_val == unchecked((short)0x8000)) + { + if ((info.regs[base2_offset + 1] & 1) != 0) + { + cur_pos = (info.regs[base1_offset + 0x08] | (info.regs[base1_offset + 0x09] << 8) | (info.regs[base1_offset + 0x0a] << 16)) & rom_mask; + cur_val = (short)(samples[cur_pos] << 8); + if (cur_val != (int)(unchecked((short)0x8000))) + { + continue; + } + } + k054539_keyoff(ch); + goto end_channel_0; + } + } + Sound.k054539stream.streamoutput_Ptrs[0][offset1] += (short)(cur_val * lvol); + Sound.k054539stream.streamoutput_Ptrs[1][offset1] += (short)(cur_val * rvol); + offset1++; + info.ram[rdelta] += (short)(cur_val * rbvol); + rdelta++; + rdelta &= 0x3fff; + } + end_channel_0: + break; + } + case 0x4: + { + pdelta <<= 1; + + for (i = 0; i < length; i++) + { + cur_pfrac += delta; + while ((cur_pfrac & ~0xffff) != 0) + { + cur_pfrac += fdelta; + cur_pos += pdelta; + + cur_pval = cur_val; + cur_val = (short)(samples[cur_pos] | samples[cur_pos + 1] << 8); + if (cur_val == unchecked((short)0x8000)) + { + if ((info.regs[base2_offset + 1] & 1) != 0) + { + cur_pos = (info.regs[base1_offset + 0x08] | (info.regs[base1_offset + 0x09] << 8) | (info.regs[base1_offset + 0x0a] << 16)) & rom_mask; + cur_val = (short)(samples[cur_pos] | samples[cur_pos + 1] << 8); + if (cur_val != unchecked((short)0x8000)) + continue; + } + k054539_keyoff(ch); + goto end_channel_4; + } + } + Sound.k054539stream.streamoutput_Ptrs[0][offset1] += (short)(cur_val * lvol); + Sound.k054539stream.streamoutput_Ptrs[1][offset1] += (short)(cur_val * rvol); + offset1++; + info.ram[rdelta] += (short)(cur_val * rbvol); + rdelta++; + rdelta &= 0x3fff; + } + end_channel_4: + break; + } + case 0x8: + { + cur_pos <<= 1; + cur_pfrac <<= 1; + if ((cur_pfrac & 0x10000) != 0) + { + cur_pfrac &= 0xffff; + cur_pos |= 1; + } + for (i = 0; i < length; i++) + { + cur_pfrac += delta; + while ((cur_pfrac & ~0xffff) != 0) + { + cur_pfrac += fdelta; + cur_pos += pdelta; + cur_pval = cur_val; + cur_val = samples[cur_pos >> 1]; + if (cur_val == 0x88) + { + if ((info.regs[base2_offset + 1] & 1) != 0) + { + cur_pos = ((info.regs[base1_offset + 0x08] | (info.regs[base1_offset + 0x09] << 8) | (info.regs[base1_offset + 0x0a] << 16)) & rom_mask) << 1; + cur_val = samples[cur_pos >> 1]; + if (cur_val != 0x88) + goto next_iter; + } + k054539_keyoff(ch); + goto end_channel_8; + } + next_iter: + if ((cur_pos & 1) != 0) + { + cur_val >>= 4; + } + else + { + cur_val &= 15; + } + cur_val = cur_pval + dpcm[cur_val]; + if (cur_val < -32768) + { + cur_val = -32768; + } + else if (cur_val > 32767) + { + cur_val = 32767; + } + } + Sound.k054539stream.streamoutput_Ptrs[0][offset1] += (short)(cur_val * lvol); + Sound.k054539stream.streamoutput_Ptrs[1][offset1] += (short)(cur_val * rvol); + offset1++; + info.ram[rdelta] += (short)(cur_val * rbvol); + rdelta++; + rdelta &= 0x3fff; + } + end_channel_8: + cur_pfrac >>= 1; + if ((cur_pos & 1) != 0) + { + cur_pfrac |= 0x8000; + } + cur_pos >>= 1; + break; + } + default: + break; + } + chan.pos = cur_pos; + chan.pfrac = cur_pfrac; + chan.pval = cur_pval; + chan.val = cur_val; + if (k054539_regupdate()) + { + info.regs[base1_offset + 0x0c] = (byte)(cur_pos & 0xff); + info.regs[base1_offset + 0x0d] = (byte)(cur_pos >> 8 & 0xff); + info.regs[base1_offset + 0x0e] = (byte)(cur_pos >> 16 & 0xff); + } + } + } + if ((info.k054539_flags & 2) == 0) + { + for (i = 0; i < length; i++) + { + short val = info.ram[(i + reverb_pos) & 0x3fff]; + Sound.k054539stream.streamoutput_Ptrs[0][offset + i] += val; + Sound.k054539stream.streamoutput_Ptrs[1][offset + i] += val; + } + } + if (reverb_pos + length > 0x4000) + { + i = 0x4000 - reverb_pos; + for (j = 0; j < i; j++) + { + info.ram[reverb_pos + j] = 0; + } + for (j = 0; j < length - i; j++) + { + info.ram[j] = 0; + } + } + else + { + for (j = 0; j < length; j++) + { + info.ram[reverb_pos + j] = 0; + } + } + } + public static void k054539_irq() + { + if ((info.regs[0x22f] & 0x20) != 0) + { + irq(); + } + } + public static void k054539_init_chip(int clock) + { + int i; + info.k054539_flags |= 4; + info.ram = new short[0x4000 + clock / 50]; + info.reverb_pos = 0; + info.cur_ptr = 0; + info.rom_size = k054539rom.Length; + info.rom_mask = 0xffffffff; + for (i = 0; i < 32; i++) + { + if ((1U << i) >= info.rom_size) + { + info.rom_mask = (1U << i) - 1; + break; + } + } + if (irq != null) + { + EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 480)), EmuTimer.TIME_ACT.K054539_k054539_irq); + } + } + static void k054539_w(int chip, int offset, byte data) + { + int latch, offs, ch, pan; + int regptr_offset; + latch = ((info.k054539_flags & 4) != 0) && ((info.regs[0x22f] & 1) != 0) ? 1 : 0; + if (latch != 0 && offset < 0x100) + { + offs = (offset & 0x1f) - 0xc; + ch = offset >> 5; + if (offs >= 0 && offs <= 2) + { + info.k054539_posreg_latch[ch][offs] = data; + return; + } + } + else + { + switch (offset) + { + case 0x13f: + pan = data >= 0x11 && data <= 0x1f ? data - 0x11 : 0x18 - 0x11; + if (apan != null) + { + apan(info.pantab[pan], info.pantab[0xe - pan]); + } + break; + case 0x214: + if (latch != 0) + { + for (ch = 0; ch < 8; ch++) + { + if ((data & (1 << ch)) != 0) + { + regptr_offset = (ch << 5) + 0xc; + info.regs[regptr_offset] = info.k054539_posreg_latch[ch][0]; + info.regs[regptr_offset + 1] = info.k054539_posreg_latch[ch][1]; + info.regs[regptr_offset + 2] = info.k054539_posreg_latch[ch][2]; + k054539_keyon(ch); + } + } + } + else + { + for (ch = 0; ch < 8; ch++) + { + if ((data & (1 << ch)) != 0) + { + k054539_keyon(ch); + } + } + } + break; + case 0x215: + for (ch = 0; ch < 8; ch++) + { + if ((data & (1 << ch)) != 0) + { + k054539_keyoff(ch); + } + } + break; + case 0x22d: + if (info.regs[0x22e] == 0x80) + { + if (zoneflag == 1) + { + if (info.cur_ptr % 2 == 0) + { + info.ram[info.cur_ptr / 2] = (short)((data << 8) | (info.ram[info.cur_ptr / 2] & 0xff)); + } + else if (info.cur_ptr % 2 == 1) + { + info.ram[info.cur_ptr / 2] = (short)((info.ram[info.cur_ptr / 2] & 0xff00) | data); + } + } + else if (zoneflag == 2) + { + k054539rom[zonedata + info.cur_ptr] = data; + } + } + info.cur_ptr++; + if (info.cur_ptr == info.cur_limit) + { + info.cur_ptr = 0; + } + break; + case 0x22e: + if (data == 0x80) + { + zoneflag = 1; + } + else + { + zoneflag = 2; + zonedata = 0x20000 * data; + } + info.cur_limit = data == 0x80 ? 0x4000 : 0x20000; + info.cur_ptr = 0; + break; + default: + break; + } + } + info.regs[offset] = data; + } + public static byte k054539_r(int chip, int offset) + { + switch (offset) + { + case 0x22d: + if ((info.regs[0x22f] & 0x10) != 0) + { + byte res = 0; + if (zoneflag == 1) + { + if (info.cur_ptr % 2 == 0) + { + res = (byte)(info.ram[info.cur_ptr / 2] >> 8); + } + else if (info.cur_ptr % 2 == 1) + { + res = (byte)info.ram[info.cur_ptr / 2]; + } + } + else if (zoneflag == 2) + { + res = k054539rom[zonedata + info.cur_ptr]; + } + info.cur_ptr++; + if (info.cur_ptr == info.cur_limit) + { + info.cur_ptr = 0; + } + return res; + } + else + { + return 0; + } + case 0x22c: + break; + default: + break; + } + return info.regs[offset]; + } + public static void k054539_start(int clock) + { + int i; + info = new k054539_info(); + info.voltab = new double[256]; + info.pantab = new double[0xf]; + info.k054539_gain = new double[8]; + info.k054539_posreg_latch = new byte[8][]; + info.regs = new byte[0x230]; + + for (i = 0; i < 8; i++) + { + info.k054539_gain[i] = 1.0; + info.k054539_posreg_latch[i] = new byte[3]; + } + info.k054539_flags = 0; + info.channels = new k054539_channel[8]; + irq = null; + switch (Machine.sBoard) + { + case "Konami 68000": + switch (Machine.sName) + { + case "prmrsocr": + irq = Konami68000.sound_nmi; + break; + } + break; + } + for (i = 0; i < 256; i++) + { + info.voltab[i] = Math.Pow(10.0, (-36.0 * (double)i / (double)0x40) / 20.0) / 4.0; + } + for (i = 0; i < 0xf; i++) + { + info.pantab[i] = Math.Sqrt(i) / Math.Sqrt(0xe); + } + k054539_init_chip(clock); + } + public static void k054539_0_w(int offset, byte data) + { + k054539_w(0, offset, data); + } + public static byte k054539_0_r(int offset) + { + return k054539_r(0, offset); + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 3; j++) + { + writer.Write(info.k054539_posreg_latch[i][j]); + } + } + writer.Write(info.k054539_flags); + writer.Write(info.regs, 0, 0x230); + for (i = 0; i < info.ram.Length; i++) + { + writer.Write(info.ram[i]); + } + writer.Write(info.reverb_pos); + writer.Write(info.cur_ptr); + writer.Write(info.cur_limit); + for (i = 0; i < 8; i++) + { + writer.Write(info.channels[i].pos); + writer.Write(info.channels[i].pfrac); + writer.Write(info.channels[i].val); + writer.Write(info.channels[i].pval); + } + writer.Write(zoneflag); + writer.Write(zonedata); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 3; j++) + { + info.k054539_posreg_latch[i][j] = reader.ReadByte(); + } + } + info.k054539_flags = reader.ReadInt32(); + info.regs = reader.ReadBytes(0x230); + for (i = 0; i < info.ram.Length; i++) + { + info.ram[i] = reader.ReadInt16(); + } + info.reverb_pos = reader.ReadInt32(); + info.cur_ptr = reader.ReadInt32(); + info.cur_limit = reader.ReadInt32(); + for (i = 0; i < 8; i++) + { + info.channels[i].pos = reader.ReadInt32(); + info.channels[i].pfrac = reader.ReadInt32(); + info.channels[i].val = reader.ReadInt32(); + info.channels[i].pval = reader.ReadInt32(); + } + zoneflag = reader.ReadInt32(); + zonedata = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K054539.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K054539.cs.meta new file mode 100644 index 00000000..0d14f1b2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/K054539.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1894a88ee97eda45a352c5c451e01b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/MSM5205.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/MSM5205.cs new file mode 100644 index 00000000..5d94b311 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/MSM5205.cs @@ -0,0 +1,284 @@ +using System; +using System.IO; + +namespace MAME.Core +{ + public unsafe class MSM5205 + { + public struct MSM5205Voice + { + public vclk_delegate vclk_callback; + public int select; + public sound_stream stream; /* number of stream system */ + public int index; + public int clock; /* clock rate */ + public int data; /* next adpcm data */ + public int vclk; /* vclk signal (external mode) */ + public int reset; /* reset pin signal */ + public int prescaler; /* prescaler selector S1 and S2 */ + public int bitwidth; /* bit width selector -3B/4B */ + public int signal; /* current ADPCM signal */ + public int step; /* current ADPCM step */ + }; + public delegate void vclk_delegate(int i); + public static int[] diff_lookup; + public static int[] index_shift = new int[8] { -1, -1, -1, -1, 2, 4, 6, 8 }; + public MSM5205Voice voice; + public static EmuTimer.emu_timer[] timer = new EmuTimer.emu_timer[2]; + public static MSM5205[] mm1 = new MSM5205[2]; + public static void ComputeTables() + { + int[,] nbl2bit = new int[16, 4] + { + { 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1}, + { 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1}, + {-1, 0, 0, 0}, {-1, 0, 0, 1}, {-1, 0, 1, 0}, {-1, 0, 1, 1}, + {-1, 1, 0, 0}, {-1, 1, 0, 1}, {-1, 1, 1, 0}, {-1, 1, 1, 1} + }; + int step, nib; + diff_lookup = new int[49 * 16]; + for (step = 0; step <= 48; step++) + { + int stepval = (int)Math.Floor(16.0 * Math.Pow(11.0 / 10.0, (double)step)); + for (nib = 0; nib < 16; nib++) + { + diff_lookup[step * 16 + nib] = nbl2bit[nib, 0] * + (stepval * nbl2bit[nib, 1] + + stepval / 2 * nbl2bit[nib, 2] + + stepval / 4 * nbl2bit[nib, 3] + + stepval / 8); + } + } + } + public void MSM5205_update(int offset, int length) + { + int i; + if (voice.signal != 0) + { + short val = (short)(voice.signal * 16); + for (i = 0; i < length; i++) + { + voice.stream.streamoutput_Ptrs[0][offset + i] = val; + } + } + else + { + for (i = 0; i < length; i++) + { + voice.stream.streamoutput_Ptrs[0][offset + i] = 0; + } + } + } + public static void MSM5205_vclk_callback0() + { + int val; + int new_signal; + if (mm1[0].voice.vclk_callback != null) + { + mm1[0].voice.vclk_callback(mm1[0].voice.index); + } + if (mm1[0].voice.reset != 0) + { + new_signal = 0; + mm1[0].voice.step = 0; + } + else + { + val = mm1[0].voice.data; + new_signal = mm1[0].voice.signal + diff_lookup[mm1[0].voice.step * 16 + (val & 15)]; + if (new_signal > 2047) + { + new_signal = 2047; + } + else if (new_signal < -2048) + { + new_signal = -2048; + } + mm1[0].voice.step += index_shift[val & 7]; + if (mm1[0].voice.step > 48) + { + mm1[0].voice.step = 48; + } + else if (mm1[0].voice.step < 0) + { + mm1[0].voice.step = 0; + } + } + if (mm1[0].voice.signal != new_signal) + { + mm1[0].voice.stream.stream_update(); + mm1[0].voice.signal = new_signal; + } + } + public static void MSM5205_vclk_callback1() + { + int val; + int new_signal; + if (mm1[1].voice.vclk_callback != null) + { + mm1[1].voice.vclk_callback(mm1[1].voice.index); + } + if (mm1[1].voice.reset != 0) + { + new_signal = 0; + mm1[1].voice.step = 0; + } + else + { + val = mm1[1].voice.data; + new_signal = mm1[1].voice.signal + diff_lookup[mm1[1].voice.step * 16 + (val & 15)]; + if (new_signal > 2047) + { + new_signal = 2047; + } + else if (new_signal < -2048) + { + new_signal = -2048; + } + mm1[1].voice.step += index_shift[val & 7]; + if (mm1[1].voice.step > 48) + { + mm1[1].voice.step = 48; + } + else if (mm1[1].voice.step < 0) + { + mm1[1].voice.step = 0; + } + } + if (mm1[1].voice.signal != new_signal) + { + mm1[1].voice.stream.stream_update(); + mm1[1].voice.signal = new_signal; + } + } + public void msm5205_reset() + { + voice.data = 0; + voice.vclk = 0; + voice.reset = 0; + voice.signal = 0; + voice.step = 0; + msm5205_playmode_w(voice.index, voice.select); + } + public static void msm5205_start(int sndindex, int clock, vclk_delegate vclk, int select) + { + //struct MSM5205Voice *voice; + /*voice = auto_malloc(sizeof(*voice)); + memset(voice, 0, sizeof(*voice)); + sndintrf_register_token(voice);*/ + //voice.intf = config; + mm1[sndindex] = new MSM5205(); + mm1[sndindex].voice.vclk_callback = vclk; + mm1[sndindex].voice.select = select; + mm1[sndindex].voice.index = sndindex; + mm1[sndindex].voice.clock = clock; + ComputeTables(); + /* stream system initialize */ + mm1[sndindex].voice.stream = new sound_stream(clock, 0, 1, mm1[sndindex].MSM5205_update); + if (sndindex == 0) + { + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.MSM5205_MSM5205_vclk_callback0, false); + } + else if (sndindex == 1) + { + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.MSM5205_MSM5205_vclk_callback1, false); + } + mm1[sndindex].msm5205_reset(); + } + public static void null_vclk(int i) + { + + } + public static void msm5205_vclk_w(int num, int vclk) + { + if (mm1[num].voice.prescaler != 0) + { + //logerror("error: msm5205_vclk_w() called with chip = %d, but VCLK selected master mode\n", num); + } + else + { + if (mm1[num].voice.vclk != vclk) + { + mm1[num].voice.vclk = vclk; + if (vclk == 0) + { + if (num == 0) + { + MSM5205_vclk_callback0(); + } + else if (num == 1) + { + MSM5205_vclk_callback1(); + } + } + } + } + } + public static void msm5205_reset_w(int num, int reset) + { + mm1[num].voice.reset = reset; + } + public static void msm5205_data_w(int num, int data) + { + if (mm1[num].voice.bitwidth == 4) + { + mm1[num].voice.data = data & 0x0f; + } + else + { + mm1[num].voice.data = (data & 0x07) << 1; /* unknown */ + } + } + public static void msm5205_playmode_w(int num, int select) + { + int[] prescaler_table = new int[4] { 96, 48, 64, 0 }; + int prescaler = prescaler_table[select & 3]; + int bitwidth = ((select & 4) != 0) ? 4 : 3; + if (mm1[num].voice.prescaler != prescaler) + { + mm1[num].voice.stream.stream_update(); + mm1[num].voice.prescaler = prescaler; + if (prescaler != 0) + { + Atime period = Attotime.attotime_mul(Attotime.ATTOTIME_IN_HZ(mm1[num].voice.clock), (uint)prescaler); + EmuTimer.timer_adjust_periodic(timer[num], period, period); + } + else + { + EmuTimer.timer_adjust_periodic(timer[num], Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + } + } + if (mm1[num].voice.bitwidth != bitwidth) + { + mm1[num].voice.stream.stream_update(); + mm1[num].voice.bitwidth = bitwidth; + } + } + public void SaveStateBinary(BinaryWriter writer) + { + writer.Write(voice.select); + writer.Write(voice.index); + writer.Write(voice.clock); + writer.Write(voice.data); + writer.Write(voice.vclk); + writer.Write(voice.reset); + writer.Write(voice.prescaler); + writer.Write(voice.bitwidth); + writer.Write(voice.signal); + writer.Write(voice.step); + } + public void LoadStateBinary(BinaryReader reader) + { + voice.select = reader.ReadInt32(); + voice.index = reader.ReadInt32(); + voice.clock = reader.ReadInt32(); + voice.data = reader.ReadInt32(); + voice.vclk = reader.ReadInt32(); + voice.reset = reader.ReadInt32(); + voice.prescaler = reader.ReadInt32(); + voice.bitwidth = reader.ReadInt32(); + voice.signal = reader.ReadInt32(); + voice.step = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/MSM5205.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/MSM5205.cs.meta new file mode 100644 index 00000000..5f345e66 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/MSM5205.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c7b3958e21cd99c4e9b71a5f832da7a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Namco.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Namco.cs new file mode 100644 index 00000000..f4c26dcb --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Namco.cs @@ -0,0 +1,313 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class Namco + { + public struct sound_channel + { + public int frequency; + public int counter; + public int[] volume; + public int noise_sw; + public int noise_state; + public int noise_seed; + public int noise_counter; + public int noise_hold; + public int waveform_select; + }; + public struct namco_sound + { + public sound_channel[] channel_list; + public int wave_size; + public int num_voices; + public int sound_enable; + public sound_stream stream; + public int namco_clock; + public int sample_rate; + public int f_fracbits; + public int stereo; + public short[][] waveform; + }; + public static byte[] namco_wavedata; + public static namco_sound nam1; + public static void update_namco_waveform(int offset, byte data) + { + if (nam1.wave_size == 1) + { + short wdata; + int v; + for (v = 0; v < 16; v++) + { + wdata = (short)(((data >> 4) & 0x0f) - 8); + nam1.waveform[v][offset * 2] = (short)((wdata * v) * 0x100 / nam1.num_voices); + wdata = (short)((data & 0x0f) - 8); + nam1.waveform[v][offset * 2 + 1] = (short)((wdata * v) * 0x100 / nam1.num_voices); + } + } + else + { + int v; + for (v = 0; v < 16; v++) + nam1.waveform[v][offset] = (short)((((data & 0x0f) - 8) * v) * 0x100 / nam1.num_voices); + } + } + public static void build_decoded_waveform() + { + int offset; + int v; + nam1.wave_size = 1; + nam1.waveform = new short[16][]; + for (v = 0; v < 16; v++) + { + nam1.waveform[v] = new short[32 * 16]; + } + for (offset = 0; offset < 256; offset++) + update_namco_waveform(offset, namco_wavedata[offset]); + } + public static uint namco_update_one(int[] buffer, int length, short[] wave, uint counter, uint freq) + { + int i; + for (i = 0; i < length; i++) + { + buffer[i] += wave[((counter) >> nam1.f_fracbits) & 0x1f]; + counter += freq; + } + return counter; + } + public static void namco_update_stereo(int offset, int length) + { + int voice; + int i; + int counter; + for (i = 0; i < length; i++) + { + Sound.namcostream.streamoutput_Ptrs[0][offset + i] = 0; + Sound.namcostream.streamoutput_Ptrs[1][offset + i] = 0; + } + for (voice = 0; voice < 8; voice++) + { + int lv = nam1.channel_list[voice].volume[0]; + int rv = nam1.channel_list[voice].volume[1]; + if (nam1.channel_list[voice].noise_sw != 0) + { + int f = nam1.channel_list[voice].frequency & 0xff; + if ((lv != 0 || rv != 0) && f != 0) + { + int hold_time = 1 << (nam1.f_fracbits - 16); + int hold = nam1.channel_list[voice].noise_hold; + int delta = f << 4; + int c = nam1.channel_list[voice].noise_counter; + short l_noise_data = (short)((0x07 * (lv >> 1)) * 32); + short r_noise_data = (short)((0x07 * (rv >> 1)) * 32); + for (i = 0; i < length; i++) + { + int cnt; + if (nam1.channel_list[voice].noise_state != 0) + { + Sound.namcostream.streamoutput_Ptrs[0][offset + i] += l_noise_data; + Sound.namcostream.streamoutput_Ptrs[1][offset + i] += r_noise_data; + } + else + { + Sound.namcostream.streamoutput_Ptrs[0][offset + i] += l_noise_data; + Sound.namcostream.streamoutput_Ptrs[1][offset + i] += r_noise_data; + } + if (hold != 0) + { + hold--; + continue; + } + hold = hold_time; + c += delta; + cnt = (c >> 12); + c &= (1 << 12) - 1; + for (; cnt > 0; cnt--) + { + if (((nam1.channel_list[voice].noise_seed + 1) & 2) != 0) + nam1.channel_list[voice].noise_state ^= 1; + if ((nam1.channel_list[voice].noise_seed & 1) != 0) + nam1.channel_list[voice].noise_seed ^= 0x28000; + nam1.channel_list[voice].noise_seed >>= 1; + } + } + nam1.channel_list[voice].noise_counter = c; + nam1.channel_list[voice].noise_hold = hold; + } + } + else + { + if (nam1.channel_list[voice].frequency != 0) + { + int c = nam1.channel_list[voice].counter; + if (lv != 0) + { + counter = nam1.channel_list[voice].counter; + for (i = 0; i < length; i++) + { + Sound.namcostream.streamoutput_Ptrs[0][offset + i] += nam1.waveform[lv][nam1.channel_list[voice].waveform_select * 32 + (counter >> nam1.f_fracbits) & 0x1f]; + counter += nam1.channel_list[voice].frequency; + } + c = counter; + } + if (rv != 0) + { + counter = nam1.channel_list[voice].counter; + for (i = 0; i < length; i++) + { + Sound.namcostream.streamoutput_Ptrs[1][offset + i] += nam1.waveform[rv][nam1.channel_list[voice].waveform_select * 32 + (counter >> nam1.f_fracbits) & 0x1f]; + counter += nam1.channel_list[voice].frequency; + } + c = counter; + } + nam1.channel_list[voice].counter = c; + } + } + } + } + public static void namco_start() + { + int voice; + nam1.num_voices = 8; + nam1.namco_clock = 192000; + nam1.f_fracbits = 4 + 15; + nam1.sample_rate = nam1.namco_clock; + build_decoded_waveform(); + nam1.channel_list = new sound_channel[8]; + for (voice = 0; voice < 8; voice++) + { + int state_index = voice; + nam1.channel_list[voice].frequency = 0; + nam1.channel_list[voice].volume = new int[2]; + nam1.channel_list[voice].volume[0] = nam1.channel_list[voice].volume[1] = 0; + nam1.channel_list[voice].waveform_select = 0; + nam1.channel_list[voice].counter = 0; + nam1.channel_list[voice].noise_sw = 0; + nam1.channel_list[voice].noise_state = 0; + nam1.channel_list[voice].noise_seed = 1; + nam1.channel_list[voice].noise_counter = 0; + nam1.channel_list[voice].noise_hold = 0; + } + } + public static void namcos1_sound_w(int offset, byte data) + { + int ch, ch1; + int nssw; + if (offset > 63) + { + return; + } + if (namco_wavedata[0x100 + offset] == data) + return; + Sound.namcostream.stream_update(); + namco_wavedata[0x100 + offset] = data; + ch = offset / 8; + if (ch >= nam1.num_voices) + return; + ch1 = ch; + switch (offset - ch * 8) + { + case 0x00: + nam1.channel_list[ch1].volume[0] = data & 0x0f; + break; + + case 0x01: + nam1.channel_list[ch1].waveform_select = (data >> 4) & 15; + nam1.channel_list[ch1].frequency = (namco_wavedata[0x100 + ch * 8 + 0x01] & 15) << 16; + nam1.channel_list[ch1].frequency += namco_wavedata[0x100 + ch * 8 + 0x02] << 8; + nam1.channel_list[ch1].frequency += namco_wavedata[0x100 + ch * 8 + 0x03]; + break; + case 0x02: + case 0x03: + nam1.channel_list[ch1].frequency = (namco_wavedata[0x100 + ch * 8 + 0x01] & 15) << 16; + nam1.channel_list[ch1].frequency += namco_wavedata[0x100 + ch * 8 + 0x02] << 8; + nam1.channel_list[ch1].frequency += namco_wavedata[0x100 + ch * 8 + 0x03]; + break; + + case 0x04: + nam1.channel_list[ch1].volume[1] = data & 0x0f; + nssw = ((data & 0x80) >> 7); + if (ch1 == 7) + { + ch1 = 0; + } + nam1.channel_list[ch1].noise_sw = nssw; + break; + } + } + public static void namcos1_cus30_w(int offset, byte data) + { + if (offset < 0x100) + { + if (namco_wavedata[offset] != data) + { + Sound.namcostream.stream_update(); + namco_wavedata[offset] = data; + update_namco_waveform(offset, data); + } + } + else if (offset < 0x140) + namcos1_sound_w(offset - 0x100, data); + else + namco_wavedata[offset] = data; + } + public static byte namcos1_cus30_r(int offset) + { + return namco_wavedata[offset]; + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + writer.Write(nam1.num_voices); + writer.Write(nam1.sound_enable); + for (i = 0; i < 16; i++) + { + for (j = 0; j < 32 * 16; j++) + { + writer.Write(nam1.waveform[i][j]); + } + } + for (i = 0; i < 8; i++) + { + writer.Write(nam1.channel_list[i].frequency); + writer.Write(nam1.channel_list[i].counter); + writer.Write(nam1.channel_list[i].volume[0]); + writer.Write(nam1.channel_list[i].volume[1]); + writer.Write(nam1.channel_list[i].noise_sw); + writer.Write(nam1.channel_list[i].noise_state); + writer.Write(nam1.channel_list[i].noise_seed); + writer.Write(nam1.channel_list[i].noise_hold); + writer.Write(nam1.channel_list[i].noise_counter); + writer.Write(nam1.channel_list[i].waveform_select); + } + writer.Write(namco_wavedata, 0, 0x400); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + nam1.num_voices = reader.ReadInt32(); + nam1.sound_enable = reader.ReadInt32(); + for (i = 0; i < 16; i++) + { + for (j = 0; j < 32 * 16; j++) + { + nam1.waveform[i][j] = reader.ReadInt16(); + } + } + for (i = 0; i < 8; i++) + { + nam1.channel_list[i].frequency = reader.ReadInt32(); + nam1.channel_list[i].counter = reader.ReadInt32(); + nam1.channel_list[i].volume[0] = reader.ReadInt32(); + nam1.channel_list[i].volume[1] = reader.ReadInt32(); + nam1.channel_list[i].noise_sw = reader.ReadInt32(); + nam1.channel_list[i].noise_state = reader.ReadInt32(); + nam1.channel_list[i].noise_seed = reader.ReadInt32(); + nam1.channel_list[i].noise_hold = reader.ReadInt32(); + nam1.channel_list[i].noise_counter = reader.ReadInt32(); + nam1.channel_list[i].waveform_select = reader.ReadInt32(); + } + namco_wavedata = reader.ReadBytes(0x400); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Namco.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Namco.cs.meta new file mode 100644 index 00000000..1a362d24 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Namco.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b8509c2dbe87c447a51073b8204a387 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/OKI6295.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/OKI6295.cs new file mode 100644 index 00000000..b3f31c39 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/OKI6295.cs @@ -0,0 +1,308 @@ +using System; +using System.IO; + +namespace MAME.Core +{ + public class OKI6295 + { + public struct adpcm_state + { + public int signal; + public int step; + }; + public struct ADPCMVoice + { + public bool playing; + public uint base_offset; + public uint sample; + public uint count; + public uint volume; + }; + public struct okim6295Struct + { + public ADPCMVoice[] voice; + public int command; + public int bank_offset; + public uint master_clock; + }; + public static byte[] okirom; + public static okim6295Struct OKI; + public static adpcm_state[] adpcm; + private static int[] index_shift = new int[8] { -1, -1, -1, -1, 2, 4, 6, 8 }; + private static int[] diff_lookup = new int[49 * 16]; + private static uint[] volume_table = new uint[16]; + private static int tables_computed = 0; + private static void compute_tables() + { + int[,] nbl2bit = new int[16, 4] + { + { 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1}, + { 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1}, + {-1, 0, 0, 0}, {-1, 0, 0, 1}, {-1, 0, 1, 0}, {-1, 0, 1, 1}, + {-1, 1, 0, 0}, {-1, 1, 0, 1}, {-1, 1, 1, 0}, {-1, 1, 1, 1} + }; + int step, nib; + for (step = 0; step <= 48; step++) + { + int stepval = (int)Math.Floor(16.0 * Math.Pow(11.0 / 10.0, (double)step)); + for (nib = 0; nib < 16; nib++) + { + diff_lookup[step * 16 + nib] = nbl2bit[nib, 0] * + (stepval * nbl2bit[nib, 1] + + stepval / 2 * nbl2bit[nib, 2] + + stepval / 4 * nbl2bit[nib, 3] + + stepval / 8); + } + } + for (step = 0; step < 16; step++) + { + double dout = 256.0; + int vol = step; + while (vol-- > 0) + dout /= 1.412537545; + volume_table[step] = (uint)dout; + } + tables_computed = 1; + } + private static void reset_adpcm(int i) + { + if (tables_computed == 0) + { + compute_tables(); + } + adpcm[i].signal = -2; + adpcm[i].step = 0; + } + private static short clock_adpcm(int i, byte nibble) + { + adpcm[i].signal += diff_lookup[adpcm[i].step * 16 + (nibble & 15)]; + if (adpcm[i].signal > 2047) + adpcm[i].signal = 2047; + else if (adpcm[i].signal < -2048) + adpcm[i].signal = -2048; + adpcm[i].step += index_shift[nibble & 7]; + if (adpcm[i].step > 48) + adpcm[i].step = 48; + else if (adpcm[i].step < 0) + adpcm[i].step = 0; + return (short)(adpcm[i].signal << 4); + } + private static void generate_adpcm(int i, short[] buffer, int samples) + { + int i1 = 0; + if (OKI.voice[i].playing) + { + int bbase = (int)(OKI.bank_offset + OKI.voice[i].base_offset); + int sample = (int)OKI.voice[i].sample; + int count = (int)OKI.voice[i].count; + while (samples != 0) + { + int nibble = okirom[bbase + sample / 2] >> (((sample & 1) << 2) ^ 4); + buffer[i1] = (short)(clock_adpcm(i, (byte)nibble) * OKI.voice[i].volume / 256); + i1++; + samples--; + if (++sample >= count) + { + OKI.voice[i].playing = false; + break; + } + } + OKI.voice[i].sample = (uint)sample; + } + while ((samples--) != 0) + { + buffer[i1] = 0; + i1++; + } + } + //TODO 移动到这里,但是大小,还需要考虑 + static short[] sample_data = new short[10000]; + public unsafe static void okim6295_update(int offset, int length) + { + int i; + for (i = 0; i < length; i++) + { + Sound.okistream.streamoutput_Ptrs[0][offset + i] = 0; + } + for (i = 0; i < 4; i++) + { + //不每次new,避免GC,排除问题。待验证影响 + //short[] sample_data = new short[10000]; + int remaining = length; + while (remaining != 0) + { + int samples1 = (remaining > 10000) ? 10000 : remaining; + int samp; + generate_adpcm(i, sample_data, samples1); + for (samp = 0; samp < length; samp++) + { + Sound.okistream.streamoutput_Ptrs[0][offset + samp] += sample_data[samp]; + } + remaining -= samples1; + } + } + } + public static void okim6295_start() + { + int voice; + compute_tables(); + OKI.command = -1; + OKI.bank_offset = 0; + OKI.master_clock = 1000000; + OKI.voice = new ADPCMVoice[4]; + adpcm = new adpcm_state[4]; + for (voice = 0; voice < 4; voice++) + { + OKI.voice[voice].volume = 255; + reset_adpcm(voice); + } + } + public static void okim6295_reset() + { + int i; + Sound.okistream.stream_update(); + for (i = 0; i < 4; i++) + { + OKI.voice[i].playing = false; + } + } + public static void okim6295_set_bank_base(int base1) + { + Sound.okistream.stream_update(); + OKI.bank_offset = base1; + } + public static void okim6295_set_pin7(int pin7) + { + int divisor = pin7 != 0 ? 132 : 165; + //stream_set_sample_rate(info->stream, info->master_clock / divisor); + } + public static int okim6295_status_r() + { + int i, result; + result = 0xf0; + Sound.okistream.stream_update(); + for (i = 0; i < 4; i++) + { + ADPCMVoice voice = OKI.voice[i]; + if (voice.playing) + result |= 1 << i; + } + return result; + } + private static void okim6295_data_w(int num, int data) + { + if (OKI.command != -1) + { + int temp = data >> 4, i, start, stop; + int baseoffset; + Sound.okistream.stream_update(); + for (i = 0; i < 4; i++, temp >>= 1) + { + if ((temp & 1) != 0) + { + baseoffset = OKI.bank_offset + OKI.command * 8; + start = ((okirom[baseoffset + 0] << 16) + (okirom[baseoffset + 1] << 8) + okirom[baseoffset + 2]) & 0x3ffff; + stop = ((okirom[baseoffset + 3] << 16) + (okirom[baseoffset + 4] << 8) + okirom[baseoffset + 5]) & 0x3ffff; + if (start < stop) + { + if (!OKI.voice[i].playing) + { + OKI.voice[i].playing = true; + OKI.voice[i].base_offset = (uint)start; + OKI.voice[i].sample = 0; + OKI.voice[i].count = (uint)(2 * (stop - start + 1)); + reset_adpcm(i); + OKI.voice[i].volume = volume_table[data & 0x0f]; + } + else + { + + } + } + else + { + OKI.voice[i].playing = false; + } + } + } + OKI.command = -1; + } + else if ((data & 0x80) != 0) + { + OKI.command = data & 0x7f; + } + else + { + int temp = data >> 3, i; + Sound.okistream.stream_update(); + for (i = 0; i < 4; i++, temp >>= 1) + { + if ((temp & 1) != 0) + { + OKI.voice[i].playing = false; + } + } + } + } + public static byte okim6295_status_0_r() + { + int i; + byte result; + result = 0xf0; + Sound.okistream.stream_update(); + for (i = 0; i < 4; i++) + { + if (OKI.voice[i].playing) + { + result |= (byte)(1 << i); + } + } + return result; + } + public static int okim6295_status_0_lsb_r() + { + return okim6295_status_r(); + } + public static void okim6295_data_0_w(byte data) + { + okim6295_data_w(0, data); + } + public static void okim6295_data_0_lsb_w(byte data) + { + //if (ACCESSING_BITS_0_7) + okim6295_data_w(0, data & 0xff); + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + writer.Write(OKI.command); + writer.Write(OKI.bank_offset); + for (i = 0; i < 4; i++) + { + writer.Write(OKI.voice[i].playing); + writer.Write(OKI.voice[i].sample); + writer.Write(OKI.voice[i].count); + writer.Write(OKI.voice[i].volume); + writer.Write(OKI.voice[i].base_offset); + writer.Write(adpcm[i].signal); + writer.Write(adpcm[i].step); + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + OKI.command = reader.ReadInt32(); + OKI.bank_offset = reader.ReadInt32(); + for (i = 0; i < 4; i++) + { + OKI.voice[i].playing = reader.ReadBoolean(); + OKI.voice[i].sample = reader.ReadUInt32(); + OKI.voice[i].count = reader.ReadUInt32(); + OKI.voice[i].volume = reader.ReadUInt32(); + OKI.voice[i].base_offset = reader.ReadUInt32(); + adpcm[i].signal = reader.ReadInt32(); + adpcm[i].step = reader.ReadInt32(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/OKI6295.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/OKI6295.cs.meta new file mode 100644 index 00000000..5b4035b7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/OKI6295.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd6b07530fd00cb4cb421f938d5d9d46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/QSound.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/QSound.cs new file mode 100644 index 00000000..06870a8e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/QSound.cs @@ -0,0 +1,239 @@ +using System; +using System.IO; + +namespace MAME.Core +{ + public struct QSOUND_CHANNEL + { + public int bank; /* bank (x16) */ + public int address; /* start address */ + public int pitch; /* pitch */ + public int reg3; /* unknown (always 0x8000) */ + public int loop; /* loop address */ + public int end; /* end address */ + public int vol; /* master volume */ + public int pan; /* Pan value */ + public int reg9; /* unknown */ + /* Work variables */ + public int key; /* Key on / key off */ + public int lvol; /* left volume */ + public int rvol; /* right volume */ + public int lastdt; /* last sample value */ + public int offset; /* current offset counter */ + }; + public struct qsound_info + { + /* Private variables */ + public QSOUND_CHANNEL[] channel; + public int data; /* register latch data */ + public int sample_rom_length; + public int[] pan_table; /* Pan volume table */ + public float frq_ratio; /* Frequency ratio */ + }; + public unsafe class QSound + { + public static sbyte[] qsoundrom; + public static qsound_info QChip; + public static void qsound_start() + { + int i; + QChip.sample_rom_length = qsoundrom.Length; + QChip.channel = new QSOUND_CHANNEL[16]; + //QChip.frq_ratio = 16.0; + QChip.pan_table = new int[33]; + for (i = 0; i < 33; i++) + { + QChip.pan_table[i] = (int)((256 / Math.Sqrt(32)) * Math.Sqrt(i)); + } + } + public static void qsound_data_h_w(byte data) + { + QChip.data = (QChip.data & 0xff) | (data << 8); + } + public static void qsound_data_l_w(byte data) + { + QChip.data = (QChip.data & 0xff00) | data; + } + public static void qsound_cmd_w(byte data) + { + qsound_set_command(data, QChip.data); + } + public static byte qsound_status_r() + { + /* Port ready bit (0x80 if ready) */ + return 0x80; + } + private static void qsound_set_command(int data, int value) + { + int ch = 0, reg = 0; + if (data < 0x80) + { + ch = data >> 3; + reg = data & 0x07; + } + else + { + if (data < 0x90) + { + ch = data - 0x80; + reg = 8; + } + else + { + if (data >= 0xba && data < 0xca) + { + ch = data - 0xba; + reg = 9; + } + else + { + /* Unknown registers */ + ch = 99; + reg = 99; + } + } + } + switch (reg) + { + case 0: /* Bank */ + ch = (ch + 1) & 0x0f; /* strange ... */ + QChip.channel[ch].bank = (value & 0x7f) << 16; + break; + case 1: /* start */ + QChip.channel[ch].address = value; + break; + case 2: /* pitch */ + QChip.channel[ch].pitch = value * 16; + if (value == 0) + { + /* Key off */ + QChip.channel[ch].key = 0; + } + break; + case 3: /* unknown */ + QChip.channel[ch].reg3 = value; + break; + case 4: /* loop offset */ + QChip.channel[ch].loop = value; + break; + case 5: /* end */ + QChip.channel[ch].end = value; + break; + case 6: /* master volume */ + if (value == 0) + { + /* Key off */ + QChip.channel[ch].key = 0; + } + else if (QChip.channel[ch].key == 0) + { + /* Key on */ + QChip.channel[ch].key = 1; + QChip.channel[ch].offset = 0; + QChip.channel[ch].lastdt = 0; + } + QChip.channel[ch].vol = value; + break; + case 7: /* unused */ + break; + case 8: + { + int pandata = (value - 0x10) & 0x3f; + if (pandata > 32) + { + pandata = 32; + } + QChip.channel[ch].rvol = QChip.pan_table[pandata]; + QChip.channel[ch].lvol = QChip.pan_table[32 - pandata]; + QChip.channel[ch].pan = value; + } + break; + case 9: + QChip.channel[ch].reg9 = value; + break; + } + } + public static void qsound_update(int offset, int length) + { + int i, j; + int rvol, lvol, count; + for (i = 0; i < length; i++) + { + Sound.qsoundstream.streamoutput_Ptrs[0][offset + i] = 0; + Sound.qsoundstream.streamoutput_Ptrs[1][offset + i] = 0; + } + for (i = 0; i < 16; i++) + { + if (QChip.channel[i].key != 0) + { + rvol = (QChip.channel[i].rvol * QChip.channel[i].vol) >> 8; + lvol = (QChip.channel[i].lvol * QChip.channel[i].vol) >> 8; + for (j = 0; j < length; j++) + { + count = (QChip.channel[i].offset) >> 16; + QChip.channel[i].offset &= 0xffff; + if (count != 0) + { + QChip.channel[i].address += count; + if (QChip.channel[i].address >= QChip.channel[i].end) + { + if (QChip.channel[i].loop == 0) + { + /* Reached the end of a non-looped sample */ + QChip.channel[i].key = 0; + break; + } + /* Reached the end, restart the loop */ + QChip.channel[i].address = (QChip.channel[i].end - QChip.channel[i].loop) & 0xffff; + } + QChip.channel[i].lastdt = qsoundrom[(QChip.channel[i].bank + QChip.channel[i].address) % (QChip.sample_rom_length)]; + } + Sound.qsoundstream.streamoutput_Ptrs[0][offset + j] += ((QChip.channel[i].lastdt * lvol) >> 6); + Sound.qsoundstream.streamoutput_Ptrs[1][offset + j] += ((QChip.channel[i].lastdt * rvol) >> 6); + QChip.channel[i].offset += QChip.channel[i].pitch; + } + } + } + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + for (i = 0; i < 16; i++) + { + writer.Write(QChip.channel[i].bank); + writer.Write(QChip.channel[i].address); + writer.Write(QChip.channel[i].pitch); + writer.Write(QChip.channel[i].loop); + writer.Write(QChip.channel[i].end); + writer.Write(QChip.channel[i].vol); + writer.Write(QChip.channel[i].pan); + writer.Write(QChip.channel[i].key); + writer.Write(QChip.channel[i].lvol); + writer.Write(QChip.channel[i].rvol); + writer.Write(QChip.channel[i].lastdt); + writer.Write(QChip.channel[i].offset); + } + writer.Write(QChip.data); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + for (i = 0; i < 16; i++) + { + QChip.channel[i].bank = reader.ReadInt32(); + QChip.channel[i].address = reader.ReadInt32(); + QChip.channel[i].pitch = reader.ReadInt32(); + QChip.channel[i].loop = reader.ReadInt32(); + QChip.channel[i].end = reader.ReadInt32(); + QChip.channel[i].vol = reader.ReadInt32(); + QChip.channel[i].pan = reader.ReadInt32(); + QChip.channel[i].key = reader.ReadInt32(); + QChip.channel[i].lvol = reader.ReadInt32(); + QChip.channel[i].rvol = reader.ReadInt32(); + QChip.channel[i].lastdt = reader.ReadInt32(); + QChip.channel[i].offset = reader.ReadInt32(); + } + QChip.data = reader.ReadInt32(); + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/QSound.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/QSound.cs.meta new file mode 100644 index 00000000..fa285b70 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/QSound.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67c93ff7eaa15f1498b497ee164c6e42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sample.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sample.cs new file mode 100644 index 00000000..641232ef --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sample.cs @@ -0,0 +1,220 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe class Sample + { + public struct sample_channel + { + //public short[] source; + + #region //指针化 source + short[] source_src; + GCHandle source_handle; + public short* source; + public int sourceLength; + public bool source_IsNull => source == null; + public short[] source_set + { + set + { + source_handle.ReleaseGCHandle(); + if (value == null) + return; + source_src = value; + sourceLength = value.Length; + source_src.GetObjectPtr(ref source_handle, ref source); + } + } + #endregion + + public int source_length; + public int source_num; + public uint pos; + public uint frac; + public uint step; + public uint basefreq; + public byte loop; + public byte paused; + } + public struct samples_info + { + public int numchannels; + public sample_channel[] channel; + public loaded_samples[] samples; + public starthandler starthandler; + } + public struct loaded_sample + { + public int length; + public int frequency; + } + public struct loaded_samples + { + public int total; + public loaded_sample[] sample; + } + public static samples_info info = new samples_info(); + public delegate void starthandler(); + public static void sample_start_raw_n(int num, int channel, short* sampledata, int samples, int frequency, int loop) + { + Sound.samplestream.stream_update(); + info.channel[channel].source_length = samples; + info.channel[channel].source_set = new short[samples]; + AxiArray.Copy(sampledata, 0, info.channel[channel].source, 0, samples); + info.channel[channel].source_num = -1; + info.channel[channel].pos = 0; + info.channel[channel].frac = 0; + info.channel[channel].basefreq = (uint)frequency; + info.channel[channel].step = (uint)(((long)info.channel[channel].basefreq << 24) / 48000); + info.channel[channel].loop = (byte)loop; + } + public static void sample_start_raw(int channel, short* sampledata, int samples, int frequency, int loop) + { + sample_start_raw_n(0, channel, sampledata, samples, frequency, loop); + } + public static void sample_stop_n(int num, int channel) + { + Sound.samplestream.stream_update(); + info.channel[channel].source = null; + info.channel[channel].source_num = -1; + } + public static void sample_stop(int channel) + { + sample_stop_n(0, channel); + } + public static int sample_playing_n(int num, int channel) + { + Sound.samplestream.stream_update(); + return (info.channel[channel].source != null) ? 1 : 0; + } + public static int sample_playing(int channel) + { + return sample_playing_n(0, channel); + } + public static void sample_update_sound(int offset, int length) + { + int i, j; + if (info.channel[0].source != null && info.channel[0].paused == 0) + { + uint pos = info.channel[0].pos; + uint frac = info.channel[0].frac; + uint step = info.channel[0].step; + int sample_length = info.channel[0].source_length; + for (i = 0; i < length; i++) + { + int sample1 = info.channel[0].source[pos]; + int sample2 = info.channel[0].source[(pos + 1) % sample_length]; + int fracmult = (int)(frac >> (24 - 14)); + Sound.samplestream.streamoutput_Ptrs[0][offset + i] = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14; + frac += step; + pos += frac >> 24; + frac = frac & ((1 << 24) - 1); + if (pos >= sample_length) + { + if (info.channel[0].loop != 0) + { + pos %= (uint)sample_length; + } + else + { + info.channel[0].source = null; + info.channel[0].source_num = -1; + if (i + 1 < length) + { + for (j = i + 1; j < length; j++) + { + Sound.samplestream.streamoutput_Ptrs[0][offset + j] = 0; + } + } + break; + } + } + } + info.channel[0].pos = pos; + info.channel[0].frac = frac; + } + else + { + for (i = 0; i < length; i++) + { + Sound.samplestream.streamoutput_Ptrs[0][offset + i] = 0; + } + } + } + public static void samples_start() + { + int i; + info.numchannels = 1; + info.channel = new sample_channel[info.numchannels]; + for (i = 0; i < info.numchannels; i++) + { + info.channel[i].source = null; + info.channel[i].source_num = -1; + info.channel[i].step = 0; + info.channel[i].loop = 0; + info.channel[i].paused = 0; + } + switch (Machine.sName) + { + case "starfigh": + info.starthandler = SunA8.suna8_sh_start; + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + info.starthandler = Konami68000.tmnt_decode_sample; + break; + default: + info.starthandler = null; + break; + } + if (info.starthandler != null) + { + info.starthandler(); + } + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + for (i = 0; i < info.numchannels; i++) + { + writer.Write(info.channel[i].source_length); + writer.Write(info.channel[i].source_num); + writer.Write(info.channel[i].pos); + writer.Write(info.channel[i].frac); + writer.Write(info.channel[i].step); + writer.Write(info.channel[i].basefreq); + writer.Write(info.channel[i].loop); + writer.Write(info.channel[i].paused); + } + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + for (i = 0; i < info.numchannels; i++) + { + info.channel[i].source_length = reader.ReadInt32(); + info.channel[i].source_num = reader.ReadInt32(); + info.channel[i].pos = reader.ReadUInt32(); + info.channel[i].frac = reader.ReadUInt32(); + info.channel[i].step = reader.ReadUInt32(); + info.channel[i].basefreq = reader.ReadUInt32(); + info.channel[i].loop = reader.ReadByte(); + info.channel[i].paused = reader.ReadByte(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sample.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sample.cs.meta new file mode 100644 index 00000000..7af78d64 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: defb0f19bbe52c641b7b9ed5213512f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sound.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sound.cs new file mode 100644 index 00000000..39f114d5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sound.cs @@ -0,0 +1,1744 @@ +using MAME.Core; +using System; + +namespace MAME.Core +{ + public unsafe partial class Sound + { + public static EmuTimer.emu_timer sound_update_timer; + private static int[] leftmix, rightmix; + private static byte[] finalmixb; + private static int sound_muted; + public static ushort[] latched_value, utempdata; + public static Action sound_update; + //public static SecondaryBuffer buf2; + private static int stream_buffer_in; + + #region 抽象出去 + static Action Act_BufferWirte; + static Action Act_SetVolume; + static Action Act_SubmitSamples; + public delegate void DGetCurrentPosition(out int play_position, out int write_position); + public static event DGetCurrentPosition Act_DGetCurrentPosition; + + public static void BindFunc(ISoundPlayer Isp) + { + Act_BufferWirte -= Act_BufferWirte; + Act_SetVolume -= Act_SetVolume; + Act_SubmitSamples -= Act_SubmitSamples; + Act_DGetCurrentPosition -= Act_DGetCurrentPosition; + + + Act_BufferWirte += Isp.BufferWirte; + Act_SetVolume += Isp.SetVolume; + Act_SubmitSamples += Isp.SubmitSamples; + Act_DGetCurrentPosition += Isp.GetCurrentPosition; + } + + static void BufferWirte(int Off, byte[] Data) + { + Act_BufferWirte.Invoke(Off, Data); + } + + static void SubmitSamples(byte[] buffer, int samples_a) + { + Act_SubmitSamples.Invoke(buffer, samples_a); + } + + public static void SetVolume(int Vol) + { + Act_SetVolume.Invoke(Vol); + } + + static void GetCurrentPosition(out int play_position, out int write_position) + { + play_position = 0; + write_position = 0; + Act_DGetCurrentPosition?.Invoke(out play_position, out write_position); + } + #endregion + + public static void sound_init() + { + leftmix = new int[0x3c0]; + rightmix = new int[0x3c0]; + finalmixb = new byte[0xf00]; + sound_muted = 0; + //buf2.Play(0, BufferPlayFlags.Looping); + last_update_second = 0; + //WavWrite.CreateSoundFile(@"\VS2008\compare1\compare1\bin\Debug\2.wav"); + Atime update_frequency = new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / 50); + switch (Machine.sBoard) + { + case "CPS-1": + latched_value = new ushort[2]; + utempdata = new ushort[2]; + sound_update = sound_updateC; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2151.ym2151_init(3579545); + OKI6295.okim6295_start(); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + okistream = new sound_stream(1000000 / 132, 0, 1, OKI6295.okim6295_update); + mixerstream = new sound_stream(48000, 3, 0, null); + break; + case "CPS-1(QSound)": + case "CPS2": + sound_update = sound_updateQ; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + QSound.qsound_start(); + qsoundstream = new sound_stream(4000000 / 166, 0, 2, QSound.qsound_update); + mixerstream = new sound_stream(48000, 2, 0, null); + break; + case "Data East": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + sound_update = sound_updateDataeast_pcktgal; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2203.ym2203_start(0, 1500000); + YM3812.ym3812_start(3000000); + MSM5205.msm5205_start(0, 384000, Dataeast.pcktgal_adpcm_int, 5); + ym3812stream = new sound_stream(41666, 0, 1, FMOpl.ym3812_update_one); + mixerstream = new sound_stream(48000, 6, 0, null); + break; + case "Tehkan": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + sound_update = sound_updateTehkan_pbaction; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + AY8910.ay8910_interface generic_ay8910 = new AY8910.ay8910_interface(); + generic_ay8910.flags = 1; + generic_ay8910.res_load = new int[3] { 1000, 1000, 1000 }; + generic_ay8910.portAread = null; + generic_ay8910.portBread = null; + generic_ay8910.portAwrite = null; + generic_ay8910.portBwrite = null; + AY8910.ay8910_start_ym(6, 0, 1500000, generic_ay8910); + AY8910.ay8910_start_ym(6, 1, 1500000, generic_ay8910); + AY8910.ay8910_start_ym(6, 2, 1500000, generic_ay8910); + mixerstream = new sound_stream(48000, 9, 0, null); + break; + case "Neo Geo": + latched_value = new ushort[2]; + utempdata = new ushort[2]; + sound_update = sound_updateN; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2610.ym2610_start(8000000); + ym2610stream = new sound_stream(111111, 0, 2, YM2610.F2610.ym2610_update_one); + mixerstream = new sound_stream(48000, 3, 0, null); + break; + case "SunA8": + latched_value = new ushort[2]; + utempdata = new ushort[2]; + sound_update = sound_updateSunA8; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM3812.ym3812_start(4000000); + AY8910.ay8910_interface starfigh_ay8910_interface = new AY8910.ay8910_interface(); + starfigh_ay8910_interface.flags = 1; + starfigh_ay8910_interface.res_load = new int[3] { 1000, 1000, 1000 }; + starfigh_ay8910_interface.portAread = null; + starfigh_ay8910_interface.portBread = null; + starfigh_ay8910_interface.portAwrite = SunA8.suna8_play_samples_w; + starfigh_ay8910_interface.portBwrite = SunA8.suna8_samples_number_w; + Sample.samples_start(); + ym3812stream = new sound_stream(55555, 0, 1, FMOpl.ym3812_update_one); + AY8910.ay8910_start_ym(6, 0, 1500000, starfigh_ay8910_interface); + samplestream = new sound_stream(48000, 0, 1, Sample.sample_update_sound); + mixerstream = new sound_stream(48000, 5, 0, null); + break; + case "Namco System 1": + sound_update = sound_updateNa; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2151.ym2151_init(3579580); + Namco.namco_start(); + DAC.dac_start(); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + namcostream = new sound_stream(192000, 0, 2, Namco.namco_update_stereo); + dacstream = new sound_stream(192000, 0, 1, DAC.DAC_update); + mixerstream = new sound_stream(48000, 5, 0, null); + break; + case "IGS011": + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + sound_update = sound_updateIGS011_drgnwrld; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + OKI6295.okim6295_start(); + YM3812.ym3812_start(3579545); + okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); + ym3812stream = new sound_stream(49715, 0, 1, FMOpl.ym3812_update_one); + mixerstream = new sound_stream(48000, 2, 0, null); + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + case "xymg": + case "wlcc": + sound_update = sound_updateIGS011_lhb; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + OKI6295.okim6295_start(); + okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); + mixerstream = new sound_stream(48000, 1, 0, null); + break; + case "lhb2": + case "nkishusp": + sound_update = sound_updateIGS011_lhb2; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + OKI6295.okim6295_start(); + YM2413.ym2413_start(3579545); + okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); + ym2413stream = new sound_stream(49715, 0, 2, YM2413.ym2413_update_one); + mixerstream = new sound_stream(48000, 3, 0, null); + break; + case "vbowl": + case "vbowlj": + sound_update = sound_updateIGS011_vbowl; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + ICS2115.ics2115_start(); + ics2115stream = new sound_stream(33075, 0, 2, ICS2115.ics2115_update); + mixerstream = new sound_stream(48000, 2, 0, null); + break; + } + break; + case "PGM": + latched_value = new ushort[3]; + utempdata = new ushort[3]; + sound_update = sound_updatePGM; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + ICS2115.ics2115_start(); + ics2115stream = new sound_stream(33075, 0, 2, ICS2115.ics2115_update); + mixerstream = new sound_stream(48000, 2, 0, null); + break; + case "M72": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + sound_update = sound_updateM72; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2151.ym2151_init(3579545); + DAC.dac_start(); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + dacstream = new sound_stream(192000, 0, 1, DAC.DAC_update); + mixerstream = new sound_stream(48000, 3, 0, null); + break; + case "M92": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + sound_update = sound_updateM92; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2151.ym2151_init(3579545); + Iremga20.iremga20_start(); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + iremga20stream = new sound_stream(894886, 0, 2, Iremga20.iremga20_update); + mixerstream = new sound_stream(48000, 4, 0, null); + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + latched_value = new ushort[2]; + utempdata = new ushort[2]; + sound_update = sound_updateTaito_tokio; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2203.ym2203_start(0, 3000000); + mixerstream = new sound_stream(48000, 4, 0, null); + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + latched_value = new ushort[2]; + utempdata = new ushort[2]; + sound_update = sound_updateTaito_bublbobl; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2203.ym2203_start(0, 3000000); + YM3812.ym3526_start(3000000); + ym3526stream = new sound_stream(41666, 0, 1, FMOpl.ym3526_update_one); + mixerstream = new sound_stream(48000, 5, 0, null); + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + sound_update = sound_updateTaito_opwolf; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + YM2151.ym2151_init(4000000); + ym2151stream = new sound_stream(62500, 0, 2, YM2151.ym2151_update_one); + MSM5205.msm5205_start(0, 384000, Taito.opwolf_msm5205_vck, 5); + MSM5205.msm5205_start(1, 384000, Taito.opwolf_msm5205_vck, 5); + mixerstream = new sound_stream(48000, 4, 0, null); + break; + } + break; + case "Taito B": + latched_value = new ushort[2]; + utempdata = new ushort[2]; + YM2610.ym2610_start(8000000); + switch (Machine.sName) + { + case "pbobble": + ym2610stream = new sound_stream(111111, 0, 2, YM2610.F2610.ym2610b_update_one); + break; + case "silentd": + case "silentdj": + case "silentdu": + ym2610stream = new sound_stream(111111, 0, 2, YM2610.F2610.ym2610_update_one); + break; + } + AY8910.AA8910[0].stream.gain = 0x100; + ym2610stream.gain = 0x100; + sound_update = sound_updateTaitoB; + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + mixerstream = new sound_stream(48000, 3, 0, null); + break; + case "Konami 68000": + switch (Machine.sName) + { + case "cuebrick": + YM2151.ym2151_init(3579545); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + sound_update = sound_updateKonami68000_cuebrick; + mixerstream = new sound_stream(48000, 2, 0, null); + break; + case "mia": + case "mia2": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + YM2151.ym2151_init(3579545); + K007232.k007232_start(3579545); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + k007232stream = new sound_stream(27965, 0, 2, K007232.KDAC_A_update); + sound_update = sound_updateKonami68000_mia; + mixerstream = new sound_stream(48000, 4, 0, null); + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + YM2151.ym2151_init(3579545); + K007232.k007232_start(3579545); + Upd7759.upd7759_start(640000); + Sample.samples_start(); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + k007232stream = new sound_stream(27965, 0, 2, K007232.KDAC_A_update); + upd7759stream = new sound_stream(160000, 0, 1, Upd7759.upd7759_update); + samplestream = new sound_stream(48000, 0, 1, Sample.sample_update_sound); + sound_update = sound_updateKonami68000_tmnt; + mixerstream = new sound_stream(48000, 6, 0, null); + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + YM2151.ym2151_init(3579545); + K053260.k053260_start(3579545); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + k053260stream = new sound_stream(111860, 0, 2, K053260.k053260_update); + sound_update = sound_updateKonami68000_ssriders; + mixerstream = new sound_stream(48000, 4, 0, null); + break; + case "blswhstl": + case "blswhstla": + case "detatwin": + YM2151.ym2151_init(3579545); + K053260.k053260_start(3579545); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + k053260stream = new sound_stream(111860, 0, 2, K053260.k053260_update); + sound_update = sound_updateKonami68000_blswhstl; + mixerstream = new sound_stream(48000, 4, 0, null); + break; + case "glfgreat": + case "glfgreatj": + K053260.k053260_start(3579545); + k053260stream = new sound_stream(111860, 0, 2, K053260.k053260_update); + sound_update = sound_updateKonami68000_glfgreat; + mixerstream = new sound_stream(48000, 2, 0, null); + break; + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + YM2151.ym2151_init(3579545); + K053260.k053260_start(3579545); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + k053260stream = new sound_stream(111860, 0, 2, K053260.k053260_update); + sound_update = sound_updateKonami68000_tmnt2; + mixerstream = new sound_stream(48000, 4, 0, null); + break; + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + YM2151.ym2151_init(3579545); + K053260.k053260_start(3579545); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + k053260stream = new sound_stream(111860, 0, 2, K053260.k053260_update); + sound_update = sound_updateKonami68000_thndrx2; + mixerstream = new sound_stream(48000, 4, 0, null); + break; + case "prmrsocr": + case "prmrsocrj": + latched_value = new ushort[3]; + utempdata = new ushort[3]; + K054539.k054539_start(48000); + k054539stream = new sound_stream(48000, 0, 2, K054539.k054539_update); + sound_update = sound_updateKonami68000_prmrsocr; + mixerstream = new sound_stream(48000, 2, 0, null); + break; + } + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + break; + case "Capcom": + latched_value = new ushort[1]; + utempdata = new ushort[1]; + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + latched_value = new ushort[2]; + utempdata = new ushort[2]; + YM2203.ym2203_start(0, 1500000); + YM2203.ym2203_start(1, 1500000); + sound_update = sound_updateCapcom_gng; + mixerstream = new sound_stream(48000, 8, 0, null); + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + YM2151.ym2151_init(3579545); + ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); + MSM5205.msm5205_start(0, 384000, MSM5205.null_vclk, 7); + MSM5205.msm5205_start(1, 384000, MSM5205.null_vclk, 7); + sound_update = sound_updateCapcom_sf; + mixerstream = new sound_stream(48000, 4, 0, null); + break; + } + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); + break; + } + EmuTimer.timer_adjust_periodic(sound_update_timer, update_frequency, update_frequency); + } + public static void sound_reset() + { + switch (Machine.sBoard) + { + case "CPS-1": + YM2151.ym2151_reset_chip(); + OKI6295.okim6295_reset(); + break; + case "CPS-1(QSound)": + case "CPS2": + break; + case "Data East": + YM2203.FF2203[0].ym2203_reset_chip(); + FMOpl.ym3812_reset_chip(); + break; + case "Tehkan": + AY8910.AA8910[0].ay8910_reset_ym(); + AY8910.AA8910[1].ay8910_reset_ym(); + AY8910.AA8910[2].ay8910_reset_ym(); + break; + case "Neo Geo": + YM2610.F2610.ym2610_reset_chip(); + break; + case "SunA8": + FMOpl.ym3812_reset_chip(); + AY8910.AA8910[0].ay8910_reset_ym(); + break; + case "Namco System 1": + YM2151.ym2151_reset_chip(); + break; + case "IGS011": + switch (Machine.sName) + { + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + OKI6295.okim6295_reset(); + FMOpl.ym3812_reset_chip(); + break; + case "lhb": + case "lhbv33c": + case "dbc": + case "ryukobou": + case "xymg": + case "wlcc": + OKI6295.okim6295_reset(); + break; + case "lhb2": + case "nkishusp": + OKI6295.okim6295_reset(); + YM2413.ym2413_reset_chip(); + break; + case "vbowl": + case "vbowlj": + ICS2115.ics2115_reset(); + break; + } + break; + case "PGM": + ICS2115.ics2115_reset(); + break; + case "M72": + YM2151.ym2151_reset_chip(); + break; + case "M92": + YM2151.ym2151_reset_chip(); + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + YM2203.FF2203[0].ym2203_reset_chip(); + break; + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + YM2203.FF2203[0].ym2203_reset_chip(); + FMOpl.ym3526_reset_chip(); + break; + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + YM2151.ym2151_reset_chip(); + break; + } + break; + case "Taito B": + YM2610.F2610.ym2610_reset_chip(); + break; + case "Konami 68000": + switch (Machine.sName) + { + case "cuebrick": + case "mia": + case "mia2": + YM2151.ym2151_reset_chip(); + break; + case "tmnt": + case "tmntu": + case "tmntua": + case "tmntub": + case "tmht": + case "tmhta": + case "tmhtb": + case "tmntj": + case "tmnta": + case "tmht2p": + case "tmht2pa": + case "tmnt2pj": + case "tmnt2po": + YM2151.ym2151_reset_chip(); + Upd7759.upd7759_reset(); + break; + case "punkshot": + case "punkshot2": + case "punkshotj": + case "lgtnfght": + case "lgtnfghta": + case "lgtnfghtu": + case "trigon": + case "blswhstl": + case "blswhstla": + case "detatwin": + case "tmnt2": + case "tmnt2a": + case "tmht22pe": + case "tmht24pe": + case "tmnt22pu": + case "qgakumon": + case "ssriders": + case "ssriderseaa": + case "ssridersebd": + case "ssridersebc": + case "ssridersuda": + case "ssridersuac": + case "ssridersuab": + case "ssridersubc": + case "ssridersadd": + case "ssridersabd": + case "ssridersjad": + case "ssridersjac": + case "ssridersjbd": + case "thndrx2": + case "thndrx2a": + case "thndrx2j": + YM2151.ym2151_reset_chip(); + K053260.k053260_reset(); + break; + case "glfgreat": + case "glfgreatj": + K053260.k053260_reset(); + break; + case "prmrsocr": + case "prmrsocrj": + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + YM2203.FF2203[0].ym2203_reset_chip(); + YM2203.FF2203[1].ym2203_reset_chip(); + break; + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + YM2151.ym2151_reset_chip(); + break; + } + break; + } + } + public static void sound_pause(bool pause) + { + if (pause) + { + sound_muted |= 0x02; + //buf2.Volume = -10000; + Sound.SetVolume(-10000); + } + else + { + sound_muted &= ~0x02; + //Sound.buf2.Volume = 0; + Sound.SetVolume(0); + } + //osd_set_mastervolume(sound_muted ? -32 : 0); + } + public static void sound_updateC() + { + int sampindex; + ym2151stream.stream_update(); + okistream.stream_update(); + generate_resampled_dataY5(0x59); + generate_resampled_dataO(0x4c, 2); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateC(); + } + public static void sound_updateQ() + { + int sampindex; + qsoundstream.stream_update(); + generate_resampled_dataQ(); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateQ(); + } + public static void sound_updateDataeast_pcktgal() + { + int sampindex; + AY8910.AA8910[0].stream.stream_update(); + YM2203.FF2203[0].stream.stream_update(); + ym3812stream.stream_update(); + MSM5205.mm1[0].voice.stream.stream_update(); + generate_resampled_dataA3(0, 0x99, 0); + generate_resampled_dataYM2203(0, 0x99, 3); + generate_resampled_dataYM3812(0x100, 4); + generate_resampled_dataMSM5205_0(0xb3, 5); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex] + mixerstream.streaminput_Ptrs[5][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateDataeast_pcktgal(); + } + public static void sound_updateTehkan_pbaction() + { + int sampindex; + AY8910.AA8910[0].stream.stream_update(); + AY8910.AA8910[1].stream.stream_update(); + AY8910.AA8910[2].stream.stream_update(); + generate_resampled_dataA3(0, 0x40, 0); + generate_resampled_dataA3(1, 0x40, 3); + generate_resampled_dataA3(2, 0x40, 6); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex] + mixerstream.streaminput_Ptrs[5][sampindex] + mixerstream.streaminput_Ptrs[6][sampindex] + mixerstream.streaminput_Ptrs[7][sampindex] + mixerstream.streaminput_Ptrs[8][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateTehkan(); + } + public static void sound_updateN() + { + int sampindex; + AY8910.AA8910[0].stream.stream_update(); + ym2610stream.stream_update(); + generate_resampled_dataA_neogeo(); + generate_resampled_dataY6(); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateN(); + } + public static void sound_updateSunA8() + { + int sampindex; + ym3812stream.stream_update(); + AY8910.AA8910[0].stream.stream_update(); + samplestream.stream_update(); + generate_resampled_dataYM3812(0x100, 0); + generate_resampled_dataA3(0, 0x80, 1); + generate_resampled_dataSample(0x80, 4); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateSunA8(); + } + public static void sound_updateNa() + { + int sampindex; + ym2151stream.stream_update(); + namcostream.stream_update(); + dacstream.stream_update(); + generate_resampled_dataY5(0x80); + generate_resampled_dataNa(); + generate_resampled_dataDac(0x100, 4); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateNa(); + } + public static void sound_updateIGS011_drgnwrld() + { + int sampindex; + okistream.stream_update(); + ym3812stream.stream_update(); + generate_resampled_dataO(0x100, 0); + generate_resampled_dataYM3812(0x200, 1); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateIGS011_drgnwrld(); + } + public static void sound_updateIGS011_lhb() + { + int sampindex; + okistream.stream_update(); + generate_resampled_dataO(0x100, 0); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateIGS011_lhb(); + } + public static void sound_updateIGS011_lhb2() + { + int sampindex; + okistream.stream_update(); + ym2413stream.stream_update(); + generate_resampled_dataO(0x100, 0); + generate_resampled_dataYM2413(0x200, 1); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateIGS011_lhb2(); + } + public static void sound_updateIGS011_vbowl() + { + int sampindex; + ics2115stream.stream_update(); + generate_resampled_dataIcs2115(0x500); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateIGS011_vbowl(); + } + public static void sound_updatePGM() + { + int sampindex; + ics2115stream.stream_update(); + generate_resampled_dataIcs2115(0x500); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updatePGM(); + } + public static void sound_updateM72() + { + int sampindex; + ym2151stream.stream_update(); + dacstream.stream_update(); + generate_resampled_dataY5(0x100); + generate_resampled_dataDac(0x66, 2); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateM72(); + } + public static void sound_updateM92() + { + int sampindex; + ym2151stream.stream_update(); + iremga20stream.stream_update(); + generate_resampled_dataY5(0x66); + generate_resampled_dataIremga20(0x100); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateM92(); + } + public static void sound_updateTaito_tokio() + { + int sampindex; + AY8910.AA8910[0].stream.stream_update(); + YM2203.FF2203[0].stream.stream_update(); + generate_resampled_dataA3(0, 0x14, 0); + generate_resampled_dataYM2203(0, 0x100, 3); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateTaito_tokio(); + } + public static void sound_updateTaito_bublbobl() + { + int sampindex; + AY8910.AA8910[0].stream.stream_update(); + YM2203.FF2203[0].stream.stream_update(); + ym3526stream.stream_update(); + generate_resampled_dataA3(0, 0x40, 0); + generate_resampled_dataYM2203(0, 0x40, 3); + generate_resampled_dataYM3526(0x80, 4); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateTaito_bublbobl(); + } + public static void sound_updateTaito_opwolf() + { + int sampindex; + ym2151stream.stream_update(); + MSM5205.mm1[0].voice.stream.stream_update(); + MSM5205.mm1[1].voice.stream.stream_update(); + generate_resampled_dataY5(0xc0); + generate_resampled_dataMSM5205_0(0x99, 2); + generate_resampled_dataMSM5205_1(0x99, 3); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateCapcom_sf(); + } + public static void sound_updateTaitoB() + { + int sampindex; + AY8910.AA8910[0].stream.stream_update(); + ym2610stream.stream_update(); + generate_resampled_dataA_taitob(); + generate_resampled_dataY6(); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateN(); + } + public static void sound_updateKonami68000_cuebrick() + { + int sampindex; + ym2151stream.stream_update(); + generate_resampled_dataY5(0x100); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_cuebrick(); + } + public static void sound_updateKonami68000_mia() + { + int sampindex; + ym2151stream.stream_update(); + k007232stream.stream_update(); + generate_resampled_dataY5(0x100); + generate_resampled_dataK007232(0x33); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_mia(); + } + public static void sound_updateKonami68000_tmnt() + { + int sampindex; + ym2151stream.stream_update(); + k007232stream.stream_update(); + upd7759stream.stream_update(); + samplestream.stream_update(); + generate_resampled_dataY5(0x100); + generate_resampled_dataK007232(0x33); + generate_resampled_dataUpd7759(0x99); + generate_resampled_dataSample(0x100, 5); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex] + mixerstream.streaminput_Ptrs[5][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex] + mixerstream.streaminput_Ptrs[5][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_tmnt(); + } + public static void sound_updateKonami68000_blswhstl() + { + int sampindex; + ym2151stream.stream_update(); + k053260stream.stream_update(); + generate_resampled_dataY5(0xb3); + generate_resampled_dataK053260(0x80, 2, 3); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_ssriders(); + } + public static void sound_updateKonami68000_glfgreat() + { + int sampindex; + k053260stream.stream_update(); + generate_resampled_dataK053260(0x100, 0, 1); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_glfgreat(); + } + public static void sound_updateKonami68000_tmnt2() + { + int sampindex; + ym2151stream.stream_update(); + k053260stream.stream_update(); + generate_resampled_dataY5(0x100); + generate_resampled_dataK053260(0xc0, 2, 3); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_ssriders(); + } + public static void sound_updateKonami68000_ssriders() + { + int sampindex; + ym2151stream.stream_update(); + k053260stream.stream_update(); + generate_resampled_dataY5(0x100); + generate_resampled_dataK053260(0xb3, 2, 3); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_ssriders(); + } + public static void sound_updateKonami68000_thndrx2() + { + int sampindex; + ym2151stream.stream_update(); + k053260stream.stream_update(); + generate_resampled_dataY5(0x100); + generate_resampled_dataK053260(0xc0, 2, 3); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_ssriders(); + } + public static void sound_updateKonami68000_prmrsocr() + { + int sampindex; + k054539stream.stream_update(); + generate_resampled_dataK054539(0x100); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateKonami68000_prmrsocr(); + } + public static void sound_updateCapcom_gng() + { + int sampindex; + AY8910.AA8910[0].stream.stream_update(); + AY8910.AA8910[1].stream.stream_update(); + YM2203.FF2203[0].stream.stream_update(); + YM2203.FF2203[1].stream.stream_update(); + generate_resampled_dataA3(0, 0x66, 0); + generate_resampled_dataYM2203(0, 0x33, 3); + generate_resampled_dataA3(1, 0x66, 4); + generate_resampled_dataYM2203(1, 0x33, 7); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int samp; + samp = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex] + mixerstream.streaminput_Ptrs[4][sampindex] + mixerstream.streaminput_Ptrs[5][sampindex] + mixerstream.streaminput_Ptrs[6][sampindex] + mixerstream.streaminput_Ptrs[7][sampindex]; + if (samp < -32768) + { + samp = -32768; + } + else if (samp > 32767) + { + samp = 32767; + } + finalmixb[sampindex * 4] = (byte)samp; + finalmixb[sampindex * 4 + 1] = (byte)((samp & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)samp; + finalmixb[sampindex * 4 + 3] = (byte)((samp & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateCapcom_gng(); + } + public static void sound_updateCapcom_sf() + { + int sampindex; + ym2151stream.stream_update(); + MSM5205.mm1[0].voice.stream.stream_update(); + MSM5205.mm1[1].voice.stream.stream_update(); + generate_resampled_dataY5(0x99); + generate_resampled_dataMSM5205_0(0x100, 2); + generate_resampled_dataMSM5205_1(0x100, 3); + mixerstream.output_sampindex += 0x3c0; + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int sampL, sampR; + sampL = mixerstream.streaminput_Ptrs[0][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampL < -32768) + { + sampL = -32768; + } + else if (sampL > 32767) + { + sampL = 32767; + } + sampR = mixerstream.streaminput_Ptrs[1][sampindex] + mixerstream.streaminput_Ptrs[2][sampindex] + mixerstream.streaminput_Ptrs[3][sampindex]; + if (sampR < -32768) + { + sampR = -32768; + } + else if (sampR > 32767) + { + sampR = 32767; + } + finalmixb[sampindex * 4] = (byte)sampL; + finalmixb[sampindex * 4 + 1] = (byte)((sampL & 0xff00) >> 8); + finalmixb[sampindex * 4 + 2] = (byte)sampR; + finalmixb[sampindex * 4 + 3] = (byte)((sampR & 0xff00) >> 8); + } + osd_update_audio_stream(finalmixb, 0x3c0); + streams_updateCapcom_sf(); + } + public static void latch_callback() + { + latched_value[0] = utempdata[0]; + } + public static void latch_callback2() + { + latched_value[1] = utempdata[1]; + } + public static void latch_callback3() + { + latched_value[2] = utempdata[2]; + } + public static void latch_callback4() + { + latched_value[3] = utempdata[3]; + } + public static ushort latch_r(int which) + { + return latched_value[which]; + } + public static void soundlatch_w(ushort data) + { + utempdata[0] = data; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback); + } + public static void soundlatch2_w(ushort data) + { + utempdata[1] = data; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback2); + } + public static void soundlatch3_w(ushort data) + { + utempdata[2] = data; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback3); + } + public static void soundlatch4_w(ushort data) + { + utempdata[3] = data; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback4); + } + public static ushort soundlatch_r() + { + return latched_value[0]; + } + public static ushort soundlatch2_r() + { + return latched_value[1]; + } + public static ushort soundlatch3_r() + { + return latched_value[2]; + } + public static ushort soundlatch4_r() + { + return latched_value[3]; + } + private static void osd_update_audio_stream(byte[] buffer, int samples_this_frame) + { + ////只需要这部分逻辑 + SubmitSamples(buffer, samples_this_frame); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sound.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sound.cs.meta new file mode 100644 index 00000000..0dcdb4a1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Sound.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 968000bbdbc89724b90eb07981d03337 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs new file mode 100644 index 00000000..21eb07f0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs @@ -0,0 +1,1393 @@ +using System; +using System.Runtime.InteropServices; + +namespace MAME.Core +{ + public unsafe class sound_stream + { + public int sample_rate; + public int new_sample_rate; + public int gain; + public long attoseconds_per_sample; + public int max_samples_per_update; + public int inputs; + public int outputs; + public int output_sampindex; + public int output_base_sampindex; + //改成指针读取 + private int[][] streaminput; + GCHandle[] streaminput_handles; + public int*[] streaminput_Ptrs; + //改成指针读取 + private int[][] streamoutput; + GCHandle[] streamoutput_handles; + public int*[] streamoutput_Ptrs; + + private updatedelegate updatecallback; + public delegate void updatedelegate(int offset, int length); + public sound_stream(int _sample_rate, int _inputs, int _outputs, updatedelegate callback) + { + int i; + sample_rate = _sample_rate; + inputs = _inputs; + outputs = _outputs; + attoseconds_per_sample = Attotime.ATTOSECONDS_PER_SECOND / sample_rate; + max_samples_per_update = (int)((Sound.update_attoseconds + attoseconds_per_sample - 1) / attoseconds_per_sample); + output_base_sampindex = -max_samples_per_update; + streaminput = new int[inputs][]; + // + streaminput_handles = new GCHandle[inputs]; + streaminput_Ptrs = new int*[inputs]; + for (i = 0; i < inputs; i++) + { + streaminput[i] = new int[max_samples_per_update]; + // + streaminput_handles[i] = GCHandle.Alloc(streaminput[i], GCHandleType.Pinned); + streaminput_Ptrs[i] = (int*)streaminput_handles[i].AddrOfPinnedObject(); + + } + streamoutput = new int[outputs][]; + // + streamoutput_handles = new GCHandle[outputs]; + streamoutput_Ptrs = new int*[outputs]; + for (i = 0; i < outputs; i++) + { + streamoutput[i] = new int[5 * max_samples_per_update]; + // + streamoutput_handles[i] = GCHandle.Alloc(streamoutput[i], GCHandleType.Pinned); + streamoutput_Ptrs[i] = (int*)streamoutput_handles[i].AddrOfPinnedObject(); + } + updatecallback = callback; + } + + ~sound_stream() + { + // 释放句柄 + if (streaminput_handles != null) + { + for (int i = 0; i < streaminput_handles.Length; i++) + { + if (streaminput_handles[i].IsAllocated) + streaminput_handles[i].Free(); + } + streaminput_handles = null; + streaminput_Ptrs = null; + } + + + if (streamoutput_handles != null) + { + for (int i = 0; i < streamoutput_handles.Length; i++) + { + if (streamoutput_handles[i].IsAllocated) + streamoutput_handles[i].Free(); + } + streamoutput_handles = null; + streamoutput_Ptrs = null; + } + } + public void stream_update() + { + int update_sampindex = time_to_sampindex(EmuTimer.get_current_time()); + int offset, samples; + samples = update_sampindex - output_sampindex; + if (samples > 0) + { + offset = output_sampindex - output_base_sampindex; + updatecallback(offset, samples); + } + output_sampindex = update_sampindex; + } + public void adjuststream(bool second_tick) + { + int i, j; + int output_bufindex = output_sampindex - output_base_sampindex; + if (second_tick) + { + output_sampindex -= sample_rate; + output_base_sampindex -= sample_rate; + } + if (output_bufindex > 3 * max_samples_per_update) + { + int samples_to_lose = output_bufindex - max_samples_per_update; + for (i = 0; i < streamoutput.Length; i++) + { + for (j = 0; j < max_samples_per_update; j++) + { + streamoutput[i][j] = streamoutput[i][samples_to_lose + j]; + } + } + output_base_sampindex += samples_to_lose; + } + } + private int time_to_sampindex(Atime time) + { + int sample = (int)(time.attoseconds / attoseconds_per_sample); + if (time.seconds > Sound.last_update_second) + { + sample += sample_rate; + } + if (time.seconds < Sound.last_update_second) + { + sample -= sample_rate; + } + return sample; + } + public void updatesamplerate() + { + int i; + if (new_sample_rate != 0) + { + int old_rate = sample_rate; + sample_rate = new_sample_rate; + new_sample_rate = 0; + attoseconds_per_sample = (long)1e18 / sample_rate; + max_samples_per_update = (int)((Sound.update_attoseconds + attoseconds_per_sample - 1) / attoseconds_per_sample); + output_sampindex = (int)((long)output_sampindex * (long)sample_rate / old_rate); + output_base_sampindex = output_sampindex - max_samples_per_update; + for (i = 0; i < outputs; i++) + { + Array.Clear(streamoutput[i], 0, max_samples_per_update); + } + } + } + }; + public unsafe partial class Sound + { + public static int last_update_second; + public static sound_stream ym2151stream, okistream, mixerstream; + public static sound_stream qsoundstream; + public static sound_stream ym2610stream; + public static sound_stream namcostream, dacstream; + public static sound_stream ics2115stream; + public static sound_stream ym3812stream, ym3526stream, ym2413stream; + public static sound_stream iremga20stream; + public static sound_stream k053260stream; + public static sound_stream upd7759stream; + public static sound_stream k007232stream; + public static sound_stream samplestream; + public static sound_stream k054539stream; + public static long update_attoseconds = Attotime.ATTOSECONDS_PER_SECOND / 50; + private unsafe static void generate_resampled_dataY5(int gain) + { + int offset; + int sample0, sample1; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / ym2151stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / ym2151stream.attoseconds_per_sample) - 1); + offset = basesample - ym2151stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * ym2151stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)ym2151stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample0 = ym2151stream.streamoutput_Ptrs[0][offset + tpos] * scale; + sample1 = ym2151stream.streamoutput_Ptrs[1][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample0 += ym2151stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + sample1 += ym2151stream.streamoutput_Ptrs[1][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample0 += ym2151stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample1 += ym2151stream.streamoutput_Ptrs[1][offset + tpos] * remainder; + sample0 /= smallstep; + sample1 /= smallstep; + mixerstream.streaminput_Ptrs[0][sampindex] = (sample0 * gain) >> 8; + mixerstream.streaminput_Ptrs[1][sampindex] = (sample1 * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private unsafe static void generate_resampled_dataO(int gain, int minput) + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - okistream.attoseconds_per_sample * 2; + if (basetime >= 0) + basesample = (int)(basetime / okistream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / okistream.attoseconds_per_sample) - 1); + offset = basesample - okistream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * okistream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)okistream.sample_rate << 22) / 48000); + if (step < 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int interp_frac = (int)(basefrac >> 10); + sample = (okistream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + okistream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12; + mixerstream.streaminput_Ptrs[minput][sampindex] = (sample * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataQ() + { + int offset; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - qsoundstream.attoseconds_per_sample * 2; + if (basetime >= 0) + basesample = (int)(basetime / qsoundstream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / qsoundstream.attoseconds_per_sample) - 1); + offset = basesample - qsoundstream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * qsoundstream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)qsoundstream.sample_rate << 22) / 48000); + if (step < 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int interp_frac = (int)(basefrac >> 10); + mixerstream.streaminput_Ptrs[0][sampindex] = (qsoundstream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + qsoundstream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12; + mixerstream.streaminput_Ptrs[1][sampindex] = (qsoundstream.streamoutput_Ptrs[1][offset] * (0x1000 - interp_frac) + qsoundstream.streamoutput_Ptrs[1][offset + 1] * interp_frac) >> 12; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataA_neogeo() + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / AY8910.AA8910[0].stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / AY8910.AA8910[0].stream.attoseconds_per_sample) - 1); + offset = basesample - AY8910.AA8910[0].stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * AY8910.AA8910[0].stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)AY8910.AA8910[0].stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample = AY8910.AA8910[0].stream.streamoutput_Ptrs[0][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample += AY8910.AA8910[0].stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample += AY8910.AA8910[0].stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample /= smallstep; + mixerstream.streaminput_Ptrs[0][sampindex] = (sample * 0x99) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataA3(int chip, int gain, int start) + { + int offset; + int sample0, sample1, sample2; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / AY8910.AA8910[chip].stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / AY8910.AA8910[chip].stream.attoseconds_per_sample) - 1); + offset = basesample - AY8910.AA8910[chip].stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * AY8910.AA8910[chip].stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)AY8910.AA8910[chip].stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample0 = AY8910.AA8910[chip].stream.streamoutput_Ptrs[0][offset + tpos] * scale; + sample1 = AY8910.AA8910[chip].stream.streamoutput_Ptrs[1][offset + tpos] * scale; + sample2 = AY8910.AA8910[chip].stream.streamoutput_Ptrs[2][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample0 += AY8910.AA8910[chip].stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + sample1 += AY8910.AA8910[chip].stream.streamoutput_Ptrs[1][offset + tpos] * 0x100; + sample2 += AY8910.AA8910[chip].stream.streamoutput_Ptrs[2][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample0 += AY8910.AA8910[chip].stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample1 += AY8910.AA8910[chip].stream.streamoutput_Ptrs[1][offset + tpos] * remainder; + sample2 += AY8910.AA8910[chip].stream.streamoutput_Ptrs[2][offset + tpos] * remainder; + sample0 /= smallstep; + sample1 /= smallstep; + sample2 /= smallstep; + mixerstream.streaminput_Ptrs[start][sampindex] = (sample0 * gain) >> 8; + mixerstream.streaminput_Ptrs[start + 1][sampindex] = (sample1 * gain) >> 8; + mixerstream.streaminput_Ptrs[start + 2][sampindex] = (sample2 * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataA_taitob() + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int gain; + int sampindex; + gain = (0x40 * AY8910.AA8910[0].stream.gain) >> 8; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / AY8910.AA8910[0].stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / AY8910.AA8910[0].stream.attoseconds_per_sample) - 1); + offset = basesample - AY8910.AA8910[0].stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * AY8910.AA8910[0].stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)AY8910.AA8910[0].stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample = AY8910.AA8910[0].stream.streamoutput_Ptrs[0][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample += AY8910.AA8910[0].stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample += AY8910.AA8910[0].stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample /= smallstep; + mixerstream.streaminput_Ptrs[0][sampindex] = (sample * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataYM2203(int c, int gain, int minput) + { + int offset; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - YM2203.FF2203[c].stream.attoseconds_per_sample * 2; + if (basetime >= 0) + basesample = (int)(basetime / YM2203.FF2203[c].stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / YM2203.FF2203[c].stream.attoseconds_per_sample) - 1); + offset = basesample - YM2203.FF2203[c].stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * YM2203.FF2203[c].stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)YM2203.FF2203[c].stream.sample_rate << 22) / 48000); + if (step < 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int interp_frac = (int)(basefrac >> 10); + int i2 = YM2203.FF2203[c].stream.streamoutput_Ptrs[0][offset]; + int i3 = YM2203.FF2203[c].stream.streamoutput_Ptrs[0][offset + 1]; + int i4 = (((YM2203.FF2203[c].stream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + YM2203.FF2203[c].stream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12) * gain) >> 8; + mixerstream.streaminput_Ptrs[minput][sampindex] = (((YM2203.FF2203[c].stream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + YM2203.FF2203[c].stream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12) * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataYM3526(int gain, int minput) + { + int offset; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / ym3526stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / ym3526stream.attoseconds_per_sample) - 1); + offset = basesample - ym3526stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * ym3526stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)ym3526stream.sample_rate << 22) / 48000); + if (step < 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int interp_frac = (int)(basefrac >> 10); + mixerstream.streaminput_Ptrs[minput][sampindex] = (((ym3526stream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + ym3526stream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12) * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataY6() + { + int offset; + int sample0, sample1; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / ym2610stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / ym2610stream.attoseconds_per_sample) - 1); + offset = basesample - ym2610stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * ym2610stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)ym2610stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample0 = ym2610stream.streamoutput_Ptrs[0][offset + tpos] * scale; + sample1 = ym2610stream.streamoutput_Ptrs[1][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample0 += ym2610stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + sample1 += ym2610stream.streamoutput_Ptrs[1][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample0 += ym2610stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample1 += ym2610stream.streamoutput_Ptrs[1][offset + tpos] * remainder; + sample0 /= smallstep; + sample1 /= smallstep; + mixerstream.streaminput_Ptrs[1][sampindex] = sample0; + mixerstream.streaminput_Ptrs[2][sampindex] = sample1; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataNa() + { + int offset; + int sample0, sample1; + long basetime; + int basesample; + uint basefrac; + uint step; + int gain; + int sampindex; + gain = 0x80; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / namcostream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / namcostream.attoseconds_per_sample) - 1); + offset = basesample - namcostream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * namcostream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)namcostream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> (14)); + sample0 = namcostream.streamoutput_Ptrs[0][offset + tpos] * scale; + sample1 = namcostream.streamoutput_Ptrs[1][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample0 += namcostream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + sample1 += namcostream.streamoutput_Ptrs[1][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample0 += namcostream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample1 += namcostream.streamoutput_Ptrs[1][offset + tpos] * remainder; + sample0 /= smallstep; + sample1 /= smallstep; + mixerstream.streaminput_Ptrs[2][sampindex] = (sample0 * gain) >> 8; + mixerstream.streaminput_Ptrs[3][sampindex] = (sample1 * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataDac(int gain, int minput) + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / dacstream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / dacstream.attoseconds_per_sample) - 1); + offset = basesample - dacstream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * dacstream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)dacstream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> (14)); + sample = dacstream.streamoutput_Ptrs[0][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample += dacstream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample += dacstream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample /= smallstep; + mixerstream.streaminput_Ptrs[minput][sampindex] = (sample * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataYM2413(int gain, int minput) + { + int offset; + int sample0, sample1; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / ym2413stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / ym2413stream.attoseconds_per_sample) - 1); + offset = basesample - ym2413stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * ym2413stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)ym2413stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample0 = ym2413stream.streamoutput_Ptrs[0][offset + tpos] * scale; + sample1 = ym2413stream.streamoutput_Ptrs[1][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample0 += ym2413stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + sample1 += ym2413stream.streamoutput_Ptrs[1][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample0 += ym2413stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample1 += ym2413stream.streamoutput_Ptrs[1][offset + tpos] * remainder; + sample0 /= smallstep; + sample1 /= smallstep; + mixerstream.streaminput_Ptrs[minput][sampindex] = (sample0 * gain) >> 8; + mixerstream.streaminput_Ptrs[minput + 1][sampindex] = (sample1 * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataYM3812(int gain, int minput) + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / ym3812stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / ym3812stream.attoseconds_per_sample) - 1); + offset = basesample - ym3812stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * ym3812stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)ym3812stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample = ym3812stream.streamoutput_Ptrs[0][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample += ym3812stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample += ym3812stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample /= smallstep; + mixerstream.streaminput_Ptrs[minput][sampindex] = (sample * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + else if (step < 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int interp_frac = (int)(basefrac >> 10); + mixerstream.streaminput_Ptrs[minput][sampindex] = (((ym3812stream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + ym3812stream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12) * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + private static void generate_resampled_dataIcs2115(int gain) + { + int offset; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - ics2115stream.attoseconds_per_sample * 2; + if (basetime >= 0) + basesample = (int)(basetime / ics2115stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / ics2115stream.attoseconds_per_sample) - 1); + offset = basesample - ics2115stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * ics2115stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)ics2115stream.sample_rate << 22) / 48000); + if (step < 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int interp_frac = (int)(basefrac >> 10); + mixerstream.streaminput_Ptrs[0][sampindex] = (((ics2115stream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + ics2115stream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12) * gain) >> 8; + mixerstream.streaminput_Ptrs[1][sampindex] = (((ics2115stream.streamoutput_Ptrs[1][offset] * (0x1000 - interp_frac) + ics2115stream.streamoutput_Ptrs[1][offset + 1] * interp_frac) >> 12) * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + public static void generate_resampled_dataIremga20(int gain) + { + int offset; + int sample0, sample1; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / iremga20stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / iremga20stream.attoseconds_per_sample) - 1); + offset = basesample - iremga20stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * iremga20stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)iremga20stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample0 = iremga20stream.streamoutput_Ptrs[0][offset + tpos] * scale; + sample1 = iremga20stream.streamoutput_Ptrs[1][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample0 += iremga20stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + sample1 += iremga20stream.streamoutput_Ptrs[1][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample0 += iremga20stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample1 += iremga20stream.streamoutput_Ptrs[1][offset + tpos] * remainder; + sample0 /= smallstep; + sample1 /= smallstep; + mixerstream.streaminput_Ptrs[2][sampindex] = (sample0 * gain) >> 8; + mixerstream.streaminput_Ptrs[3][sampindex] = (sample1 * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + public static void generate_resampled_dataK053260(int gain, int minput1, int minput2) + { + int offset; + int sample0, sample1; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / k053260stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / k053260stream.attoseconds_per_sample) - 1); + offset = basesample - k053260stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * k053260stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)k053260stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample0 = k053260stream.streamoutput_Ptrs[0][offset + tpos] * scale; + sample1 = k053260stream.streamoutput_Ptrs[1][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample0 += k053260stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + sample1 += k053260stream.streamoutput_Ptrs[1][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample0 += k053260stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample1 += k053260stream.streamoutput_Ptrs[1][offset + tpos] * remainder; + sample0 /= smallstep; + sample1 /= smallstep; + mixerstream.streaminput_Ptrs[minput1][sampindex] = (sample0 * gain) >> 8; + mixerstream.streaminput_Ptrs[minput2][sampindex] = (sample1 * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + public static void generate_resampled_dataK007232(int gain) + { + int offset; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - k007232stream.attoseconds_per_sample * 2; + if (basetime >= 0) + basesample = (int)(basetime / k007232stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / k007232stream.attoseconds_per_sample) - 1); + offset = basesample - k007232stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * k007232stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)k007232stream.sample_rate << 22) / 48000); + if (step < 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int interp_frac = (int)(basefrac >> 10); + mixerstream.streaminput_Ptrs[2][sampindex] = (((k007232stream.streamoutput_Ptrs[0][offset] * (0x1000 - interp_frac) + k007232stream.streamoutput_Ptrs[0][offset + 1] * interp_frac) >> 12) * gain) >> 8; + mixerstream.streaminput_Ptrs[3][sampindex] = (((k007232stream.streamoutput_Ptrs[1][offset] * (0x1000 - interp_frac) + k007232stream.streamoutput_Ptrs[1][offset + 1] * interp_frac) >> 12) * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + public static void generate_resampled_dataUpd7759(int gain) + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / upd7759stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / upd7759stream.attoseconds_per_sample) - 1); + offset = basesample - upd7759stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * upd7759stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)upd7759stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample = upd7759stream.streamoutput_Ptrs[0][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample += upd7759stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample += upd7759stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample /= smallstep; + mixerstream.streaminput_Ptrs[4][sampindex] = (sample * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + public static void generate_resampled_dataSample(int gain, int minput) + { + int offset; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / samplestream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / samplestream.attoseconds_per_sample) - 1); + offset = basesample - samplestream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * samplestream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)samplestream.sample_rate << 22) / 48000); + if (step == 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + mixerstream.streaminput_Ptrs[minput][sampindex] = (samplestream.streamoutput_Ptrs[0][offset + sampindex] * gain) >> 8; + } + } + } + public static void generate_resampled_dataK054539(int gain) + { + int offset; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / k054539stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / k054539stream.attoseconds_per_sample) - 1); + offset = basesample - k054539stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * k054539stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)k054539stream.sample_rate << 22) / 48000); + if (step == 0x400000) + { + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + mixerstream.streaminput_Ptrs[0][sampindex] = (k054539stream.streamoutput_Ptrs[0][offset + sampindex] * gain) >> 8; + mixerstream.streaminput_Ptrs[1][sampindex] = (k054539stream.streamoutput_Ptrs[1][offset + sampindex] * gain) >> 8; + } + } + } + public static void generate_resampled_dataMSM5205_0(int gain, int minput) + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / MSM5205.mm1[0].voice.stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / MSM5205.mm1[0].voice.stream.attoseconds_per_sample) - 1); + offset = basesample - MSM5205.mm1[0].voice.stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * MSM5205.mm1[0].voice.stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)MSM5205.mm1[0].voice.stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample = MSM5205.mm1[0].voice.stream.streamoutput_Ptrs[0][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample += MSM5205.mm1[0].voice.stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample += MSM5205.mm1[0].voice.stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample /= smallstep; + mixerstream.streaminput_Ptrs[minput][sampindex] = (sample * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + public static void generate_resampled_dataMSM5205_1(int gain, int minput) + { + int offset; + int sample; + long basetime; + int basesample; + uint basefrac; + uint step; + int sampindex; + basetime = mixerstream.output_sampindex * mixerstream.attoseconds_per_sample - mixerstream.attoseconds_per_sample; + if (basetime >= 0) + basesample = (int)(basetime / MSM5205.mm1[1].voice.stream.attoseconds_per_sample); + else + basesample = (int)(-(-basetime / MSM5205.mm1[1].voice.stream.attoseconds_per_sample) - 1); + offset = basesample - MSM5205.mm1[1].voice.stream.output_base_sampindex; + basefrac = (uint)((basetime - basesample * MSM5205.mm1[1].voice.stream.attoseconds_per_sample) / (Attotime.ATTOSECONDS_PER_SECOND >> 22)); + step = (uint)(((ulong)MSM5205.mm1[1].voice.stream.sample_rate << 22) / 48000); + if (step > 0x400000) + { + int smallstep = (int)(step >> 14); + for (sampindex = 0; sampindex < 0x3c0; sampindex++) + { + int remainder = smallstep; + int tpos = 0; + int scale; + scale = (int)((0x400000 - basefrac) >> 14); + sample = MSM5205.mm1[1].voice.stream.streamoutput_Ptrs[0][offset + tpos] * scale; + tpos++; + remainder -= scale; + while (remainder > 0x100) + { + sample += MSM5205.mm1[1].voice.stream.streamoutput_Ptrs[0][offset + tpos] * 0x100; + tpos++; + remainder -= 0x100; + } + sample += MSM5205.mm1[1].voice.stream.streamoutput_Ptrs[0][offset + tpos] * remainder; + sample /= smallstep; + mixerstream.streaminput_Ptrs[minput][sampindex] = (sample * gain) >> 8; + basefrac += step; + offset += (int)(basefrac >> 22); + basefrac &= 0x3fffff; + } + } + } + public static void streams_updateC() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + okistream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateQ() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + qsoundstream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateDataeast_pcktgal() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + AY8910.AA8910[0].stream.adjuststream(second_tick); + YM2203.FF2203[0].stream.adjuststream(second_tick); + ym3812stream.adjuststream(second_tick); + MSM5205.mm1[0].voice.stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + AY8910.AA8910[0].stream.updatesamplerate(); + } + private static void streams_updateTehkan() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + AY8910.AA8910[0].stream.adjuststream(second_tick); + AY8910.AA8910[1].stream.adjuststream(second_tick); + AY8910.AA8910[2].stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + AY8910.AA8910[0].stream.updatesamplerate(); + AY8910.AA8910[1].stream.updatesamplerate(); + AY8910.AA8910[2].stream.updatesamplerate(); + } + private static void streams_updateN() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + AY8910.AA8910[0].stream.adjuststream(second_tick); + ym2610stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + AY8910.AA8910[0].stream.updatesamplerate(); + } + private static void streams_updateSunA8() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym3812stream.adjuststream(second_tick); + AY8910.AA8910[0].stream.adjuststream(second_tick); + samplestream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + //AY8910.AA8910[0].stream.updatesamplerate(); + } + private static void streams_updateNa() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + namcostream.adjuststream(second_tick); + dacstream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateIGS011_drgnwrld() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + okistream.adjuststream(second_tick); + ym3812stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateIGS011_lhb() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + okistream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateIGS011_lhb2() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + okistream.adjuststream(second_tick); + ym2413stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateIGS011_vbowl() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ics2115stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updatePGM() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ics2115stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateM72() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + dacstream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateM92() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + iremga20stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateTaito_tokio() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + AY8910.AA8910[0].stream.adjuststream(second_tick); + YM2203.FF2203[0].stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateTaito_bublbobl() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + AY8910.AA8910[0].stream.adjuststream(second_tick); + YM2203.FF2203[0].stream.adjuststream(second_tick); + ym3526stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + AY8910.AA8910[0].stream.updatesamplerate(); + } + private static void streams_updateKonami68000_cuebrick() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateKonami68000_mia() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + k007232stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateKonami68000_tmnt() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + k007232stream.adjuststream(second_tick); + upd7759stream.adjuststream(second_tick); + samplestream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateKonami68000_glfgreat() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + k053260stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateKonami68000_ssriders() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + k053260stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateKonami68000_prmrsocr() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + k054539stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + private static void streams_updateCapcom_gng() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + AY8910.AA8910[0].stream.adjuststream(second_tick); + AY8910.AA8910[1].stream.adjuststream(second_tick); + YM2203.FF2203[0].stream.adjuststream(second_tick); + YM2203.FF2203[1].stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + AY8910.AA8910[0].stream.updatesamplerate(); + AY8910.AA8910[1].stream.updatesamplerate(); + } + private static void streams_updateCapcom_sf() + { + Atime curtime = EmuTimer.global_basetime; + bool second_tick = false; + if (curtime.seconds != last_update_second) + { + second_tick = true; + } + ym2151stream.adjuststream(second_tick); + MSM5205.mm1[0].voice.stream.adjuststream(second_tick); + MSM5205.mm1[1].voice.stream.adjuststream(second_tick); + mixerstream.adjuststream(second_tick); + last_update_second = curtime.seconds; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs.meta new file mode 100644 index 00000000..1e77885d --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb6d202115df41344a3227bb8d4a40ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Taitosnd.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Taitosnd.cs new file mode 100644 index 00000000..75bf5fd9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Taitosnd.cs @@ -0,0 +1,225 @@ +using System.IO; + +namespace MAME.Core +{ + public class Taitosnd + { + public static byte TC0140SYT_PORT01_FULL, TC0140SYT_PORT23_FULL, TC0140SYT_PORT01_FULL_MASTER, TC0140SYT_PORT23_FULL_MASTER; + public struct TC0140SYT + { + public byte[] slavedata; + public byte[] masterdata; + public byte mainmode; + public byte submode; + public byte status; + public byte nmi_enabled; + public byte nmi_req; + } + public static TC0140SYT tc0140syt; + public static void taitosnd_start() + { + tc0140syt = new TC0140SYT(); + tc0140syt.slavedata = new byte[4]; + tc0140syt.masterdata = new byte[4]; + tc0140syt.mainmode = 0; + tc0140syt.submode = 0; + tc0140syt.status = 0; + tc0140syt.nmi_enabled = 0; + tc0140syt.nmi_req = 0; + TC0140SYT_PORT01_FULL = 0x01; + TC0140SYT_PORT23_FULL = 0x02; + TC0140SYT_PORT01_FULL_MASTER = 0x04; + TC0140SYT_PORT23_FULL_MASTER = 0x08; + } + public static void Interrupt_Controller() + { + if ((tc0140syt.nmi_req != 0) && (tc0140syt.nmi_enabled != 0)) + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.PULSE_LINE); + tc0140syt.nmi_req = 0; + } + } + public static void taitosound_port_w(int offset, byte data) + { + data &= 0x0f; + tc0140syt.mainmode = data; + } + public static void taitosound_comm_w(int offset, byte data) + { + data &= 0x0f; /*this is important, otherwise ballbros won't work*/ + switch (tc0140syt.mainmode) + { + case 0x00: // mode #0 + tc0140syt.slavedata[tc0140syt.mainmode++] = data; + break; + case 0x01: // mode #1 + tc0140syt.slavedata[tc0140syt.mainmode++] = data; + tc0140syt.status |= TC0140SYT_PORT01_FULL; + tc0140syt.nmi_req = 1; + break; + case 0x02: // mode #2 + tc0140syt.slavedata[tc0140syt.mainmode++] = data; + break; + case 0x03: // mode #3 + tc0140syt.slavedata[tc0140syt.mainmode++] = data; + tc0140syt.status |= TC0140SYT_PORT23_FULL; + tc0140syt.nmi_req = 1; + break; + case 0x04: // port status + /* this does a hi-lo transition to reset the sound cpu */ + if (data != 0) + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, LineState.ASSERT_LINE); + } + else + { + Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, LineState.CLEAR_LINE); + Cpuexec.cpu_spin(); /* otherwise no sound in driftout */ + } + break; + default: + break; + } + } + public static byte taitosound_comm_r(int offset) + { + byte result; + switch (tc0140syt.mainmode) + { + case 0x00: // mode #0 + result = tc0140syt.masterdata[tc0140syt.mainmode++]; + break; + case 0x01: // mode #1 + tc0140syt.status &= (byte)(~TC0140SYT_PORT01_FULL_MASTER); + result = tc0140syt.masterdata[tc0140syt.mainmode++]; + break; + case 0x02: // mode #2 + result = tc0140syt.masterdata[tc0140syt.mainmode++]; + break; + case 0x03: // mode #3 + tc0140syt.status &= (byte)(~TC0140SYT_PORT23_FULL_MASTER); + result = tc0140syt.masterdata[tc0140syt.mainmode++]; + break; + case 0x04: // port status + result = tc0140syt.status; + break; + default: + result = 0; + break; + } + return result; + } + public static void taitosound_slave_port_w(byte data) + { + data &= 0x0f; + tc0140syt.submode = data; + } + public static void taitosound_slave_comm_w(byte data) + { + data &= 0x0f; + switch (tc0140syt.submode) + { + case 0x00: // mode #0 + tc0140syt.masterdata[tc0140syt.submode++] = data; + break; + case 0x01: // mode #1 + tc0140syt.masterdata[tc0140syt.submode++] = data; + tc0140syt.status |= TC0140SYT_PORT01_FULL_MASTER; + Cpuexec.cpu_spin(); /* writing should take longer than emulated, so spin */ + break; + case 0x02: // mode #2 + tc0140syt.masterdata[tc0140syt.submode++] = data; + break; + case 0x03: // mode #3 + tc0140syt.masterdata[tc0140syt.submode++] = data; + tc0140syt.status |= TC0140SYT_PORT23_FULL_MASTER; + Cpuexec.cpu_spin(); /* writing should take longer than emulated, so spin */ + break; + case 0x04: // port status + break; + case 0x05: // nmi disable + tc0140syt.nmi_enabled = 0; + break; + case 0x06: // nmi enable + tc0140syt.nmi_enabled = 1; + break; + default: + break; + } + Interrupt_Controller(); + } + public static byte taitosound_slave_comm_r() + { + byte res = 0; + switch (tc0140syt.submode) + { + case 0x00: // mode #0 + res = tc0140syt.slavedata[tc0140syt.submode++]; + break; + case 0x01: // mode #1 + tc0140syt.status &= unchecked((byte)(~0x01)); + res = tc0140syt.slavedata[tc0140syt.submode++]; + break; + case 0x02: // mode #2 + res = tc0140syt.slavedata[tc0140syt.submode++]; + break; + case 0x03: // mode #3 + tc0140syt.status &= unchecked((byte)(~0x02)); + res = tc0140syt.slavedata[tc0140syt.submode++]; + break; + case 0x04: // port status + res = tc0140syt.status; + break; + default: + res = 0; + break; + } + Interrupt_Controller(); + return res; + } + public static void taitosound_port16_msb_w(ushort data) + { + //if (ACCESSING_BITS_8_15) + taitosound_port_w(0, (byte)(data >> 8)); + } + public static void taitosound_port16_msb_w1(byte data) + { + //if (ACCESSING_BITS_8_15) + taitosound_port_w(0, data); + } + public static void taitosound_comm16_msb_w(ushort data) + { + //if (ACCESSING_BITS_8_15) + taitosound_comm_w(0, (byte)(data >> 8)); + } + public static void taitosound_comm16_msb_w1(byte data) + { + //if (ACCESSING_BITS_8_15) + taitosound_comm_w(0, data); + } + public static ushort taitosound_comm16_msb_r() + { + return (ushort)(taitosound_comm_r(0) << 8); + } + public static void SaveStateBinary(BinaryWriter writer) + { + writer.Write(tc0140syt.slavedata, 0, 4); + writer.Write(tc0140syt.masterdata, 0, 4); + writer.Write(tc0140syt.mainmode); + writer.Write(tc0140syt.submode); + writer.Write(tc0140syt.status); + writer.Write(tc0140syt.nmi_enabled); + writer.Write(tc0140syt.nmi_req); + } + public static void LoadStateBinary(BinaryReader reader) + { + tc0140syt.slavedata = reader.ReadBytes(4); + tc0140syt.masterdata = reader.ReadBytes(4); + tc0140syt.mainmode = reader.ReadByte(); + tc0140syt.submode = reader.ReadByte(); + tc0140syt.status = reader.ReadByte(); + tc0140syt.nmi_enabled = reader.ReadByte(); + tc0140syt.nmi_req = reader.ReadByte(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Taitosnd.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Taitosnd.cs.meta new file mode 100644 index 00000000..ac2acb24 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Taitosnd.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f5d38e1226899e4a9f9c41d821f2df9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Upd7759.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Upd7759.cs new file mode 100644 index 00000000..153ecb09 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Upd7759.cs @@ -0,0 +1,420 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class Upd7759 + { + public struct upd7759_chip + { + public uint pos; + public uint step; + public Atime clock_period; + public EmuTimer.emu_timer timer; + + public byte fifo_in; + public byte reset; + public byte start; + public byte drq; + public drqcallback drqcallback; + + public sbyte state; + public int clocks_left; + public ushort nibbles_left; + public byte repeat_count; + public sbyte post_drq_state; + public int post_drq_clocks; + public byte req_sample; + public byte last_sample; + public byte block_header; + public byte sample_rate; + public byte first_valid_header; + public uint offset; + public uint repeat_offset; + + public sbyte adpcm_state; + public byte adpcm_data; + public short sample; + + public int rombase; + public uint romoffset; + } + public static int[,] upd7759_step = new int[16, 16] + { + { 0, 0, 1, 2, 3, 5, 7, 10, 0, 0, -1, -2, -3, -5, -7, -10 }, + { 0, 1, 2, 3, 4, 6, 8, 13, 0, -1, -2, -3, -4, -6, -8, -13 }, + { 0, 1, 2, 4, 5, 7, 10, 15, 0, -1, -2, -4, -5, -7, -10, -15 }, + { 0, 1, 3, 4, 6, 9, 13, 19, 0, -1, -3, -4, -6, -9, -13, -19 }, + { 0, 2, 3, 5, 8, 11, 15, 23, 0, -2, -3, -5, -8, -11, -15, -23 }, + { 0, 2, 4, 7, 10, 14, 19, 29, 0, -2, -4, -7, -10, -14, -19, -29 }, + { 0, 3, 5, 8, 12, 16, 22, 33, 0, -3, -5, -8, -12, -16, -22, -33 }, + { 1, 4, 7, 10, 15, 20, 29, 43, -1, -4, -7, -10, -15, -20, -29, -43 }, + { 1, 4, 8, 13, 18, 25, 35, 53, -1, -4, -8, -13, -18, -25, -35, -53 }, + { 1, 6, 10, 16, 22, 31, 43, 64, -1, -6, -10, -16, -22, -31, -43, -64 }, + { 2, 7, 12, 19, 27, 37, 51, 76, -2, -7, -12, -19, -27, -37, -51, -76 }, + { 2, 9, 16, 24, 34, 46, 64, 96, -2, -9, -16, -24, -34, -46, -64, -96 }, + { 3, 11, 19, 29, 41, 57, 79, 117, -3, -11, -19, -29, -41, -57, -79, -117 }, + { 4, 13, 24, 36, 50, 69, 96, 143, -4, -13, -24, -36, -50, -69, -96, -143 }, + { 4, 16, 29, 44, 62, 85, 118, 175, -4, -16, -29, -44, -62, -85, -118, -175 }, + { 6, 20, 36, 54, 76, 104, 144, 214, -6, -20, -36, -54, -76, -104, -144, -214 }, + }; + public static int[] upd7759_state = new int[16] { -1, -1, 0, 0, 1, 2, 2, 3, -1, -1, 0, 0, 1, 2, 2, 3 }; + public static upd7759_chip chip; + public static byte[] updrom; + public delegate void drqcallback(int irq); + + + public static void update_adpcm(int data) + { + chip.sample += (short)upd7759_step[chip.adpcm_state, data]; + chip.adpcm_state += (sbyte)upd7759_state[data]; + if (chip.adpcm_state < 0) + { + chip.adpcm_state = 0; + } + else if (chip.adpcm_state > 15) + { + chip.adpcm_state = 15; + } + } + public static void advance_state() + { + switch (chip.state) + { + case 0: + chip.clocks_left = 4; + break; + case 1: + chip.drq = 0; + chip.clocks_left = chip.post_drq_clocks; + chip.state = chip.post_drq_state; + break; + case 2: + chip.req_sample = (byte)(updrom != null ? chip.fifo_in : 0x10); + chip.clocks_left = 70; + chip.state = 3; + break; + case 3: + chip.drq = 1; + chip.clocks_left = 44; + chip.state = 4; + break; + case 4: + chip.last_sample = updrom != null ? updrom[0] : chip.fifo_in; + chip.drq = 1; + chip.clocks_left = 28; + chip.state = (sbyte)((chip.req_sample > chip.last_sample) ? 0 : 5); + break; + case 5: + chip.drq = 1; + chip.clocks_left = 32; + chip.state = 6; + break; + case 6: + chip.offset = (uint)((updrom != null ? updrom[chip.req_sample * 2 + 5] : chip.fifo_in) << 9); + chip.drq = 1; + chip.clocks_left = 44; + chip.state = 7; + break; + case 7: + chip.offset |= (uint)((updrom != null ? updrom[chip.req_sample * 2 + 6] : chip.fifo_in) << 1); + chip.drq = 1; + chip.clocks_left = 36; + chip.state = 8; + break; + case 8: + chip.offset++; + chip.first_valid_header = 0; + chip.drq = 1; + chip.clocks_left = 36; + chip.state = 9; + break; + case 9: + if (chip.repeat_count != 0) + { + chip.repeat_count--; + chip.offset = chip.repeat_offset; + } + chip.block_header = updrom != null ? updrom[chip.offset++ & 0x1ffff] : chip.fifo_in; + chip.drq = 1; + switch (chip.block_header & 0xc0) + { + case 0x00: + chip.clocks_left = 1024 * ((chip.block_header & 0x3f) + 1); + chip.state = (sbyte)((chip.block_header == 0 && chip.first_valid_header != 0) ? 0 : 9); + chip.sample = 0; + chip.adpcm_state = 0; + break; + case 0x40: + chip.sample_rate = (byte)((chip.block_header & 0x3f) + 1); + chip.nibbles_left = 256; + chip.clocks_left = 36; + chip.state = 11; + break; + case 0x80: + chip.sample_rate = (byte)((chip.block_header & 0x3f) + 1); + chip.clocks_left = 36; + chip.state = 10; + break; + case 0xc0: + chip.repeat_count = (byte)((chip.block_header & 7) + 1); + chip.repeat_offset = chip.offset; + chip.clocks_left = 36; + chip.state = 9; + break; + } + if (chip.block_header != 0) + { + chip.first_valid_header = 1; + } + break; + case 10: + chip.nibbles_left = (ushort)((updrom != null ? updrom[chip.offset++ & 0x1ffff] : chip.fifo_in) + 1); + chip.drq = 1; + chip.clocks_left = 36; + chip.state = 11; + break; + case 11: + chip.adpcm_data = updrom != null ? updrom[chip.offset++ & 0x1ffff] : chip.fifo_in; + update_adpcm(chip.adpcm_data >> 4); + chip.drq = 1; + chip.clocks_left = chip.sample_rate * 4; + if (--chip.nibbles_left == 0) + { + chip.state = 9; + } + else + { + chip.state = 12; + } + break; + case 12: + update_adpcm(chip.adpcm_data & 15); + chip.clocks_left = chip.sample_rate * 4; + if (--chip.nibbles_left == 0) + { + chip.state = 9; + } + else + { + chip.state = 11; + } + break; + } + if (chip.drq != 0) + { + chip.post_drq_state = chip.state; + chip.post_drq_clocks = chip.clocks_left - 21; + chip.state = 1; + chip.clocks_left = 21; + } + } + public static void upd7759_update(int offset, int length) + { + int clocks_left = chip.clocks_left; + short sample = chip.sample; + uint step = chip.step; + uint pos = chip.pos; + int i = 0, j; + if (chip.state != 0) + { + for (i = 0; i < length; i++) + { + Sound.upd7759stream.streamoutput_Ptrs[0][offset + i] = sample << 7; + pos += step; + while (updrom != null && pos >= 0x100000) + { + int clocks_this_time = (int)(pos >> 20); + if (clocks_this_time > clocks_left) + { + clocks_this_time = clocks_left; + } + pos -= (uint)(clocks_this_time * 0x100000); + clocks_left -= clocks_this_time; + if (clocks_left == 0) + { + advance_state(); + if (chip.state == 0) + { + break; + } + clocks_left = chip.clocks_left; + sample = chip.sample; + } + } + } + } + if (i < length - 1) + { + for (j = i; j < length; j++) + { + Sound.upd7759stream.streamoutput_Ptrs[0][offset + j] = 0; + } + } + chip.clocks_left = clocks_left; + chip.pos = pos; + } + public static void upd7759_slave_update() + { + byte olddrq = chip.drq; + Sound.upd7759stream.stream_update(); + //stream_update(chip.channel); + advance_state(); + if (olddrq != chip.drq && chip.drqcallback != null) + { + chip.drqcallback(chip.drq); + } + if (chip.state != 0) + { + EmuTimer.timer_adjust_periodic(chip.timer, Attotime.attotime_mul(chip.clock_period, (uint)chip.clocks_left), Attotime.ATTOTIME_NEVER); + } + } + public static void upd7759_reset() + { + chip.pos = 0; + chip.fifo_in = 0; + chip.drq = 0; + chip.state = 0; + chip.clocks_left = 0; + chip.nibbles_left = 0; + chip.repeat_count = 0; + chip.post_drq_state = 0; + chip.post_drq_clocks = 0; + chip.req_sample = 0; + chip.last_sample = 0; + chip.block_header = 0; + chip.sample_rate = 0; + chip.first_valid_header = 0; + chip.offset = 0; + chip.repeat_offset = 0; + chip.adpcm_state = 0; + chip.adpcm_data = 0; + chip.sample = 0; + if (chip.timer != null) + { + EmuTimer.timer_adjust_periodic(chip.timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + } + } + public static void upd7759_start(int clock) + { + chip = new upd7759_chip(); + chip.step = 4 * 0x100000; + chip.clock_period = new Atime(0, (long)(1e18 / clock)); + chip.state = 0; + chip.rombase = 0; + if (updrom == null) + { + chip.timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Upd7759_upd7759_slave_update, false); + } + chip.reset = 1; + chip.start = 1; + upd7759_reset(); + } + public static void upd7759_reset_w(int which, byte data) + { + byte oldreset = chip.reset; + chip.reset = (byte)((data != 0) ? 1 : 0); + Sound.upd7759stream.stream_update(); + if (oldreset != 0 && chip.reset == 0) + { + upd7759_reset(); + } + } + public static void upd7759_start_w(int which, byte data) + { + byte oldstart = chip.start; + chip.start = (byte)((data != 0) ? 1 : 0); + Sound.upd7759stream.stream_update(); + if (chip.state == 0 && oldstart == 0 && chip.start != 0 && chip.reset != 0) + { + chip.state = 2; + if (chip.timer != null) + { + EmuTimer.timer_adjust_periodic(chip.timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + } + } + } + public static void upd7759_port_w(int which, byte data) + { + chip.fifo_in = data; + } + public static int upd7759_busy_r(int which) + { + return (chip.state == 0) ? 1 : 0; + } + public static void upd7759_set_bank_base(int which, uint base1) + { + //chip.rom = chip.rombase + base1; + chip.romoffset = base1; + } + public static void upd7759_0_start_w(byte data) + { + upd7759_start_w(0, data); + } + public static void upd7759_0_reset_w(byte data) + { + upd7759_reset_w(0, data); + } + public static void upd7759_0_port_w(byte data) + { + upd7759_port_w(0, data); + } + public static byte upd7759_0_busy_r() + { + return (byte)upd7759_busy_r(0); + } + public static void SaveStateBinary(BinaryWriter writer) + { + writer.Write(chip.pos); + writer.Write(chip.step); + writer.Write(chip.fifo_in); + writer.Write(chip.reset); + writer.Write(chip.start); + writer.Write(chip.drq); + writer.Write(chip.state); + writer.Write(chip.clocks_left); + writer.Write(chip.nibbles_left); + writer.Write(chip.repeat_count); + writer.Write(chip.post_drq_state); + writer.Write(chip.post_drq_clocks); + writer.Write(chip.req_sample); + writer.Write(chip.last_sample); + writer.Write(chip.block_header); + writer.Write(chip.sample_rate); + writer.Write(chip.first_valid_header); + writer.Write(chip.offset); + writer.Write(chip.repeat_offset); + writer.Write(chip.adpcm_state); + writer.Write(chip.adpcm_data); + writer.Write(chip.sample); + writer.Write(chip.romoffset); + writer.Write(chip.rombase); + } + public static void LoadStateBinary(BinaryReader reader) + { + chip.pos = reader.ReadUInt32(); + chip.step = reader.ReadUInt32(); + chip.fifo_in = reader.ReadByte(); + chip.reset = reader.ReadByte(); + chip.start = reader.ReadByte(); + chip.drq = reader.ReadByte(); + chip.state = reader.ReadSByte(); + chip.clocks_left = reader.ReadInt32(); + chip.nibbles_left = reader.ReadUInt16(); + chip.repeat_count = reader.ReadByte(); + chip.post_drq_state = reader.ReadSByte(); + chip.post_drq_clocks = reader.ReadInt32(); + chip.req_sample = reader.ReadByte(); + chip.last_sample = reader.ReadByte(); + chip.block_header = reader.ReadByte(); + chip.sample_rate = reader.ReadByte(); + chip.first_valid_header = reader.ReadByte(); + chip.offset = reader.ReadUInt32(); + chip.repeat_offset = reader.ReadUInt32(); + chip.adpcm_state = reader.ReadSByte(); + chip.adpcm_data = reader.ReadByte(); + chip.sample = reader.ReadInt16(); + chip.romoffset = reader.ReadUInt32(); + chip.rombase = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Upd7759.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Upd7759.cs.meta new file mode 100644 index 00000000..312ff8dc --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Upd7759.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de1dc55507e0ab9489dc23503341fa97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs new file mode 100644 index 00000000..92ae3115 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs @@ -0,0 +1,83 @@ +using System.IO; + +namespace MAME.Core +{ + public class WavWrite + { + public static FileStream mWaveFile = null; + private static BinaryWriter mWriter = null; + private static int mSampleCount = 0; + public static void CreateSoundFile(string filename) + { + mWaveFile = new FileStream(filename, FileMode.Create); + mWriter = new BinaryWriter(mWaveFile); + /************************************************************************** + Hereiswherethefilewillbecreated.A + wavefileisaRIFFfile,whichhaschunks + ofdatathatdescribewhatthefilecontains. + AwaveRIFFfileisputtogetherlikethis: + The12byteRIFFchunkisconstructedlikethis: + Bytes0-3: 'R''I''F''F' + Bytes4-7: Lengthoffile,minusthefirst8bytesoftheRIFFdescription. + (4bytesfor"WAVE"+24bytesforformatchunklength+ + 8bytesfordatachunkdescription+actualsampledatasize.) + Bytes8-11:'W''A''V''E' + The24byteFORMATchunkisconstructedlikethis: + Bytes0-3:'f''m''t''' + Bytes4-7:Theformatchunklength.Thisisalways16. + Bytes8-9:Filepadding.Always1. + Bytes10-11:Numberofchannels.Either1formono, or2forstereo. + Bytes12-15:Samplerate. + Bytes16-19:Numberofbytespersecond. + Bytes20-21:Bytespersample.1for8bitmono,2for8bitstereoor + 16bitmono,4for16bitstereo. + Bytes22-23:Numberofbitspersample. + TheDATAchunkisconstructedlikethis: + Bytes0-3:'d''a''t''a' + Bytes4-7:Lengthofdata,inbytes. + Bytes8-:Actualsampledata. + ***************************************************************************/ + char[] ChunkRiff = { 'R', 'I', 'F', 'F' }; + char[] ChunkType = { 'W', 'A', 'V', 'E' }; + char[] ChunkFmt = { 'f', 'm', 't', ' ' }; + char[] ChunkData = { 'd', 'a', 't', 'a' }; + short shPad = 1;        //Filepadding + int nFormatChunkLength = 0x10; //Formatchunklength. + int nLength = 0;        //Filelength,minusfirst8bytesofRIFFdescription.Thiswillbefilledinlater. + mSampleCount = 0; + //RIFF + mWriter.Write(ChunkRiff); + mWriter.Write(nLength); + //WAVE + mWriter.Write(ChunkType); + mWriter.Write(ChunkFmt); + mWriter.Write(nFormatChunkLength); + mWriter.Write(shPad); + mWriter.Write((short)2); + mWriter.Write(48000); + mWriter.Write(192000); + mWriter.Write((short)4); + mWriter.Write((short)16); + //data + mWriter.Write(ChunkData); + mWriter.Write((int)0); + } + public static void CloseSoundFile() + { + mWriter.Seek(4, SeekOrigin.Begin); + mWriter.Write((int)(mSampleCount + 36)); + mWriter.Seek(40, SeekOrigin.Begin); + mWriter.Write(mSampleCount); + mWriter.Close(); + mWaveFile.Close(); + mWriter = null; + mWaveFile = null; + } + public static void wav_add_data_16(byte[] bb1, int length) + { + mWriter.Write(bb1, 0, length); + mSampleCount += length; + mWriter.Flush(); + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs.meta new file mode 100644 index 00000000..25e4e953 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a8fdeb6fcc163e48a72e6d600dd63ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2151.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2151.cs new file mode 100644 index 00000000..ad395a83 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2151.cs @@ -0,0 +1,2196 @@ +using System; +using System.IO; + +namespace MAME.Core +{ + public class YM2151 + { + public struct YM2151Operator + { + public uint phase; + public uint freq; + public int dt1; + public uint mul; + public uint dt1_i; + public uint dt2; + + public int mem_value; + + public uint fb_shift; + public int fb_out_curr; + public int fb_out_prev; + public uint kc; + public uint kc_i; + public uint pms; + public uint ams; + + public uint AMmask; + public uint state; + public byte eg_sh_ar; + public byte eg_sel_ar; + public uint tl; + public int volume; + public byte eg_sh_d1r; + public byte eg_sel_d1r; + public uint d1l; + public byte eg_sh_d2r; + public byte eg_sel_d2r; + public byte eg_sh_rr; + public byte eg_sel_rr; + + public uint key; + + public uint ks; + public uint ar; + public uint d1r; + public uint d2r; + public uint rr; + + public uint reserved0; + public uint reserved1; + }; + public struct YM2151Struct + { + public YM2151Operator[] oper; + + public uint[] pan; + + public int lastreg0; + public uint eg_cnt; + public uint eg_timer; + public uint eg_timer_add; + public uint eg_timer_overflow; + + public uint lfo_phase; + public uint lfo_timer; + public uint lfo_timer_add; + public uint lfo_overflow; + public uint lfo_counter; + public uint lfo_counter_add; + public byte lfo_wsel; + public byte amd; + public sbyte pmd; + public uint lfa; + public int lfp; + + public byte test; + public byte ct; + + public uint noise; + public uint noise_rng; + public uint noise_p; + public uint noise_f; + + public uint csm_req; + + public uint irq_enable; + public uint status; + public byte[] connect; + + public EmuTimer.emu_timer timer_A; + public EmuTimer.emu_timer timer_B; + public Atime[] timer_A_time; + public Atime[] timer_B_time; + public int irqlinestate; + + public uint timer_A_index; + public uint timer_B_index; + public uint timer_A_index_old; + public uint timer_B_index_old; + + public uint[] freq; + + public int[] dt1_freq; + + public uint[] noise_tab; + + public int clock; + public int sampfreq; + public irqhandler irqhandler; + public porthandler porthandler; + }; + private static int[] iconnect = new int[32], imem = new int[32];//m2=8,c1=9,c2=10,mem=11,null=12 + private static int[] tl_tab = new int[13 * 2 * 0x100]; + private static uint[] sin_tab = new uint[0x400]; + private static uint[] d1l_tab = new uint[16]; + + private static byte[] eg_inc = new byte[19 * 8]{ + 0,1, 0,1, 0,1, 0,1, + 0,1, 0,1, 1,1, 0,1, + 0,1, 1,1, 0,1, 1,1, + 0,1, 1,1, 1,1, 1,1, + + 1,1, 1,1, 1,1, 1,1, + 1,1, 1,2, 1,1, 1,2, + 1,2, 1,2, 1,2, 1,2, + 1,2, 2,2, 1,2, 2,2, + + 2,2, 2,2, 2,2, 2,2, + 2,2, 2,4, 2,2, 2,4, + 2,4, 2,4, 2,4, 2,4, + 2,4, 4,4, 2,4, 4,4, + + 4,4, 4,4, 4,4, 4,4, + 4,4, 4,8, 4,4, 4,8, + 4,8, 4,8, 4,8, 4,8, + 4,8, 8,8, 4,8, 8,8, + + 8,8, 8,8, 8,8, 8,8, + 16,16,16,16,16,16,16,16, + 0,0, 0,0, 0,0, 0,0, + }; + + private static uint[] dt2_tab = new uint[4] { 0, 384, 500, 608 }; + + private static ushort[] phaseinc_rom = new ushort[768]{ + 1299,1300,1301,1302,1303,1304,1305,1306,1308,1309,1310,1311,1313,1314,1315,1316, + 1318,1319,1320,1321,1322,1323,1324,1325,1327,1328,1329,1330,1332,1333,1334,1335, + 1337,1338,1339,1340,1341,1342,1343,1344,1346,1347,1348,1349,1351,1352,1353,1354, + 1356,1357,1358,1359,1361,1362,1363,1364,1366,1367,1368,1369,1371,1372,1373,1374, + 1376,1377,1378,1379,1381,1382,1383,1384,1386,1387,1388,1389,1391,1392,1393,1394, + 1396,1397,1398,1399,1401,1402,1403,1404,1406,1407,1408,1409,1411,1412,1413,1414, + 1416,1417,1418,1419,1421,1422,1423,1424,1426,1427,1429,1430,1431,1432,1434,1435, + 1437,1438,1439,1440,1442,1443,1444,1445,1447,1448,1449,1450,1452,1453,1454,1455, + 1458,1459,1460,1461,1463,1464,1465,1466,1468,1469,1471,1472,1473,1474,1476,1477, + 1479,1480,1481,1482,1484,1485,1486,1487,1489,1490,1492,1493,1494,1495,1497,1498, + 1501,1502,1503,1504,1506,1507,1509,1510,1512,1513,1514,1515,1517,1518,1520,1521, + 1523,1524,1525,1526,1528,1529,1531,1532,1534,1535,1536,1537,1539,1540,1542,1543, + 1545,1546,1547,1548,1550,1551,1553,1554,1556,1557,1558,1559,1561,1562,1564,1565, + 1567,1568,1569,1570,1572,1573,1575,1576,1578,1579,1580,1581,1583,1584,1586,1587, + 1590,1591,1592,1593,1595,1596,1598,1599,1601,1602,1604,1605,1607,1608,1609,1610, + 1613,1614,1615,1616,1618,1619,1621,1622,1624,1625,1627,1628,1630,1631,1632,1633, + 1637,1638,1639,1640,1642,1643,1645,1646,1648,1649,1651,1652,1654,1655,1656,1657, + 1660,1661,1663,1664,1666,1667,1669,1670,1672,1673,1675,1676,1678,1679,1681,1682, + 1685,1686,1688,1689,1691,1692,1694,1695,1697,1698,1700,1701,1703,1704,1706,1707, + 1709,1710,1712,1713,1715,1716,1718,1719,1721,1722,1724,1725,1727,1728,1730,1731, + 1734,1735,1737,1738,1740,1741,1743,1744,1746,1748,1749,1751,1752,1754,1755,1757, + 1759,1760,1762,1763,1765,1766,1768,1769,1771,1773,1774,1776,1777,1779,1780,1782, + 1785,1786,1788,1789,1791,1793,1794,1796,1798,1799,1801,1802,1804,1806,1807,1809, + 1811,1812,1814,1815,1817,1819,1820,1822,1824,1825,1827,1828,1830,1832,1833,1835, + 1837,1838,1840,1841,1843,1845,1846,1848,1850,1851,1853,1854,1856,1858,1859,1861, + 1864,1865,1867,1868,1870,1872,1873,1875,1877,1879,1880,1882,1884,1885,1887,1888, + 1891,1892,1894,1895,1897,1899,1900,1902,1904,1906,1907,1909,1911,1912,1914,1915, + 1918,1919,1921,1923,1925,1926,1928,1930,1932,1933,1935,1937,1939,1940,1942,1944, + 1946,1947,1949,1951,1953,1954,1956,1958,1960,1961,1963,1965,1967,1968,1970,1972, + 1975,1976,1978,1980,1982,1983,1985,1987,1989,1990,1992,1994,1996,1997,1999,2001, + 2003,2004,2006,2008,2010,2011,2013,2015,2017,2019,2021,2022,2024,2026,2028,2029, + 2032,2033,2035,2037,2039,2041,2043,2044,2047,2048,2050,2052,2054,2056,2058,2059, + 2062,2063,2065,2067,2069,2071,2073,2074,2077,2078,2080,2082,2084,2086,2088,2089, + 2092,2093,2095,2097,2099,2101,2103,2104,2107,2108,2110,2112,2114,2116,2118,2119, + 2122,2123,2125,2127,2129,2131,2133,2134,2137,2139,2141,2142,2145,2146,2148,2150, + 2153,2154,2156,2158,2160,2162,2164,2165,2168,2170,2172,2173,2176,2177,2179,2181, + 2185,2186,2188,2190,2192,2194,2196,2197,2200,2202,2204,2205,2208,2209,2211,2213, + 2216,2218,2220,2222,2223,2226,2227,2230,2232,2234,2236,2238,2239,2242,2243,2246, + 2249,2251,2253,2255,2256,2259,2260,2263,2265,2267,2269,2271,2272,2275,2276,2279, + 2281,2283,2285,2287,2288,2291,2292,2295,2297,2299,2301,2303,2304,2307,2308,2311, + 2315,2317,2319,2321,2322,2325,2326,2329,2331,2333,2335,2337,2338,2341,2342,2345, + 2348,2350,2352,2354,2355,2358,2359,2362,2364,2366,2368,2370,2371,2374,2375,2378, + 2382,2384,2386,2388,2389,2392,2393,2396,2398,2400,2402,2404,2407,2410,2411,2414, + 2417,2419,2421,2423,2424,2427,2428,2431,2433,2435,2437,2439,2442,2445,2446,2449, + 2452,2454,2456,2458,2459,2462,2463,2466,2468,2470,2472,2474,2477,2480,2481,2484, + 2488,2490,2492,2494,2495,2498,2499,2502,2504,2506,2508,2510,2513,2516,2517,2520, + 2524,2526,2528,2530,2531,2534,2535,2538,2540,2542,2544,2546,2549,2552,2553,2556, + 2561,2563,2565,2567,2568,2571,2572,2575,2577,2579,2581,2583,2586,2589,2590,2593 + }; + public static byte[] lfo_noise_waveform = new byte[256]{ + 0xFF,0xEE,0xD3,0x80,0x58,0xDA,0x7F,0x94,0x9E,0xE3,0xFA,0x00,0x4D,0xFA,0xFF,0x6A, + 0x7A,0xDE,0x49,0xF6,0x00,0x33,0xBB,0x63,0x91,0x60,0x51,0xFF,0x00,0xD8,0x7F,0xDE, + 0xDC,0x73,0x21,0x85,0xB2,0x9C,0x5D,0x24,0xCD,0x91,0x9E,0x76,0x7F,0x20,0xFB,0xF3, + 0x00,0xA6,0x3E,0x42,0x27,0x69,0xAE,0x33,0x45,0x44,0x11,0x41,0x72,0x73,0xDF,0xA2, + + 0x32,0xBD,0x7E,0xA8,0x13,0xEB,0xD3,0x15,0xDD,0xFB,0xC9,0x9D,0x61,0x2F,0xBE,0x9D, + 0x23,0x65,0x51,0x6A,0x84,0xF9,0xC9,0xD7,0x23,0xBF,0x65,0x19,0xDC,0x03,0xF3,0x24, + 0x33,0xB6,0x1E,0x57,0x5C,0xAC,0x25,0x89,0x4D,0xC5,0x9C,0x99,0x15,0x07,0xCF,0xBA, + 0xC5,0x9B,0x15,0x4D,0x8D,0x2A,0x1E,0x1F,0xEA,0x2B,0x2F,0x64,0xA9,0x50,0x3D,0xAB, + + 0x50,0x77,0xE9,0xC0,0xAC,0x6D,0x3F,0xCA,0xCF,0x71,0x7D,0x80,0xA6,0xFD,0xFF,0xB5, + 0xBD,0x6F,0x24,0x7B,0x00,0x99,0x5D,0xB1,0x48,0xB0,0x28,0x7F,0x80,0xEC,0xBF,0x6F, + 0x6E,0x39,0x90,0x42,0xD9,0x4E,0x2E,0x12,0x66,0xC8,0xCF,0x3B,0x3F,0x10,0x7D,0x79, + 0x00,0xD3,0x1F,0x21,0x93,0x34,0xD7,0x19,0x22,0xA2,0x08,0x20,0xB9,0xB9,0xEF,0x51, + + 0x99,0xDE,0xBF,0xD4,0x09,0x75,0xE9,0x8A,0xEE,0xFD,0xE4,0x4E,0x30,0x17,0xDF,0xCE, + 0x11,0xB2,0x28,0x35,0xC2,0x7C,0x64,0xEB,0x91,0x5F,0x32,0x0C,0x6E,0x00,0xF9,0x92, + 0x19,0xDB,0x8F,0xAB,0xAE,0xD6,0x12,0xC4,0x26,0x62,0xCE,0xCC,0x0A,0x03,0xE7,0xDD, + 0xE2,0x4D,0x8A,0xA6,0x46,0x95,0x0F,0x8F,0xF5,0x15,0x97,0x32,0xD4,0x28,0x1E,0x55 + }; + public static YM2151Struct PSG; + public static int[] chanout = new int[12]; + public delegate void irqhandler(int irq); + public delegate void porthandler(int offset, byte data); + + private static void init_tables() + { + int i, x, n; + double o, m; + for (x = 0; x < 0x100; x++) + { + m = (1 << 16) / Math.Pow(2, (x + 1) * (1.0 / 256)); + m = Math.Floor(m); + n = (int)m; + n >>= 4; + if ((n & 1) != 0) + { + n = (n >> 1) + 1; + } + else + { + n = n >> 1; + } + n <<= 2; + tl_tab[x * 2] = n; + tl_tab[x * 2 + 1] = -tl_tab[x * 2]; + for (i = 1; i < 13; i++) + { + tl_tab[x * 2 + i * 2 * 0x100] = tl_tab[x * 2] >> i; + tl_tab[x * 2 + 1 + i * 2 * 0x100] = -tl_tab[x * 2 + i * 2 * 0x100]; + } + } + for (i = 0; i < 0x400; i++) + { + m = Math.Sin(((i * 2) + 1) * Math.PI / 0x400); + if (m > 0.0) + { + o = 8 * Math.Log(1.0 / m) / Math.Log(2); + } + else + { + o = 8 * Math.Log(-1.0 / m) / Math.Log(2); + } + o = o / (1.0 / 32); + n = (int)(2.0 * o); + if ((n & 1) != 0) + { + n = (n >> 1) + 1; + } + else + { + n = n >> 1; + } + sin_tab[i] = (uint)(n * 2 + (m >= 0.0 ? 0 : 1)); + } + for (i = 0; i < 16; i++) + { + m = (i != 15 ? i : i + 16) * 32; + d1l_tab[i] = (uint)m; + } + } + private static void init_chip_tables() + { + int i, j; + double mult, phaseinc, Hz; + double scaler; + Atime pom; + scaler = ((double)PSG.clock / 64.0) / ((double)PSG.sampfreq); + /*logerror("scaler = %20.15f\n", scaler);*/ + /* this loop calculates Hertz values for notes from c-0 to b-7 */ + /* including 64 'cents' (100/64 that is 1.5625 of real cent) per note */ + /* i*100/64/1200 is equal to i/768 */ + /* real chip works with 10 bits fixed point values (10.10) */ + mult = (1 << 6); /* -10 because phaseinc_rom table values are already in 10.10 format */ + for (i = 0; i < 768; i++) + { + /* 3.4375 Hz is note A; C# is 4 semitones higher */ + Hz = 1000; + + phaseinc = phaseinc_rom[i]; /* real chip phase increment */ + phaseinc *= scaler; /* adjust */ + + /* octave 2 - reference octave */ + PSG.freq[768 + 2 * 768 + i] = (uint)(((int)(phaseinc * mult)) & 0xffffffc0); /* adjust to X.10 fixed point */ + /* octave 0 and octave 1 */ + for (j = 0; j < 2; j++) + { + PSG.freq[768 + j * 768 + i] = (PSG.freq[768 + 2 * 768 + i] >> (2 - j)) & 0xffffffc0; /* adjust to X.10 fixed point */ + } + /* octave 3 to 7 */ + for (j = 3; j < 8; j++) + { + PSG.freq[768 + j * 768 + i] = PSG.freq[768 + 2 * 768 + i] << (j - 2); + } + } + /* octave -1 (all equal to: oct 0, _KC_00_, _KF_00_) */ + for (i = 0; i < 768; i++) + { + PSG.freq[i] = PSG.freq[768]; + } + /* octave 8 and 9 (all equal to: oct 7, _KC_14_, _KF_63_) */ + for (j = 8; j < 10; j++) + { + for (i = 0; i < 768; i++) + { + PSG.freq[768 + j * 768 + i] = PSG.freq[768 + 8 * 768 - 1]; + } + } + mult = (1 << 16); + for (j = 0; j < 4; j++) + { + for (i = 0; i < 32; i++) + { + Hz = ((double)FM.dt_tab[j * 32 + i] * ((double)PSG.clock / 64.0)) / (double)(1 << 20); + + /*calculate phase increment*/ + phaseinc = (Hz * 0x400) / (double)PSG.sampfreq; + + /*positive and negative values*/ + PSG.dt1_freq[j * 32 + i] = (int)(phaseinc * mult); + PSG.dt1_freq[(j + 4) * 32 + i] = -PSG.dt1_freq[j * 32 + i]; + } + } + /* calculate timers' deltas */ + /* User's Manual pages 15,16 */ + mult = (1 << 16); + for (i = 0; i < 1024; i++) + { + /* ASG 980324: changed to compute both tim_A_tab and timer_A_time */ + pom = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / PSG.clock), (uint)(64 * (1024 - i))); + PSG.timer_A_time[i] = pom;//(long)Math.Pow(10, 18) + } + for (i = 0; i < 256; i++) + { + /* ASG 980324: changed to compute both tim_B_tab and timer_B_time */ + pom = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / PSG.clock), (uint)(1024 * (256 - i))); + PSG.timer_B_time[i] = pom; + } + /* calculate noise periods table */ + //scaler = ((double)PSG.clock / 64.0) / ((double)PSG.sampfreq); + for (i = 0; i < 32; i++) + { + j = (i != 31 ? i : 30); /* rate 30 and 31 are the same */ + j = 32 - j; + j = (int)(65536.0 / (double)(j * 32.0)); /* number of samples per one shift of the shift register */ + /*chip->noise_tab[i] = j * 64;*/ + /* number of chip clock cycles per one shift */ + PSG.noise_tab[i] = (uint)(j * 64 * scaler); + /*logerror("noise_tab[%02x]=%08x\n", i, chip->noise_tab[i]);*/ + } + } + private static void KEY_ON(uint op1, uint key_set)//YM2151Operator op, uint key_set) + { + if (PSG.oper[op1].key == 0) + { + PSG.oper[op1].phase = 0; /* clear phase */ + PSG.oper[op1].state = 4; /* KEY ON = attack */ + PSG.oper[op1].volume += (~PSG.oper[op1].volume * + (eg_inc[PSG.oper[op1].eg_sel_ar + ((PSG.eg_cnt >> PSG.oper[op1].eg_sh_ar) & 7)]) + ) >> 4; + if (PSG.oper[op1].volume <= 0) + { + PSG.oper[op1].volume = 0; + PSG.oper[op1].state = 3; + } + } + PSG.oper[op1].key |= key_set; + } + private static void KEY_OFF(uint op1, uint key_clr)//YM2151Operator op, uint key_clr) + { + if (PSG.oper[op1].key != 0) + { + PSG.oper[op1].key &= key_clr; + if (PSG.oper[op1].key == 0) + { + if (PSG.oper[op1].state > 1) + PSG.oper[op1].state = 1;/* KEY OFF = release */ + } + } + } + private static void envelope_KONKOFF(uint i, int v) + { + if ((v & 0x08) != 0) /* M1 */ + KEY_ON(i, 1); + else + KEY_OFF(i, 0xfffffffe); + if ((v & 0x20) != 0) /* M2 */ + KEY_ON(i + 1, 1); + else + KEY_OFF(i + 1, 0xfffffffe); + if ((v & 0x10) != 0) /* C1 */ + KEY_ON(i + 2, 1); + else + KEY_OFF(i + 2, 0xfffffffe); + if ((v & 0x40) != 0) /* C2 */ + KEY_ON(i + 3, 1); + else + KEY_OFF(i + 3, 0xfffffffe); + } + public static void irqAon_callback() + { + int oldstate = PSG.irqlinestate; + PSG.irqlinestate |= 1; + if (oldstate == 0) + { + PSG.irqhandler(1); + } + } + public static void irqBon_callback() + { + int oldstate = PSG.irqlinestate; + PSG.irqlinestate |= 2; + if (oldstate == 0) + { + PSG.irqhandler(1); + } + } + public static void irqAoff_callback() + { + int oldstate = PSG.irqlinestate; + PSG.irqlinestate &= ~1; + if (oldstate == 1) + { + PSG.irqhandler(0); + } + } + public static void irqBoff_callback() + { + int oldstate = PSG.irqlinestate; + PSG.irqlinestate &= ~2; + if (oldstate == 2) + { + PSG.irqhandler(0); + } + } + public static void timer_callback_a() + { + EmuTimer.timer_adjust_periodic(PSG.timer_A, PSG.timer_A_time[PSG.timer_A_index], Attotime.ATTOTIME_NEVER); + PSG.timer_A_index_old = PSG.timer_A_index; + if ((PSG.irq_enable & 0x04) != 0) + { + PSG.status |= 1; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqAon_callback); + } + if ((PSG.irq_enable & 0x80) != 0) + { + PSG.csm_req = 2; /* request KEY ON / KEY OFF sequence */ + } + } + public static void timer_callback_b() + { + EmuTimer.timer_adjust_periodic(PSG.timer_B, PSG.timer_B_time[PSG.timer_B_index], Attotime.ATTOTIME_NEVER); + PSG.timer_B_index_old = PSG.timer_B_index; + if ((PSG.irq_enable & 0x08) != 0) + { + PSG.status |= 2; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqBon_callback); + } + } + private static void set_connect(int cha, int v) + { + /* set connect algorithm */ + /* MEM is simply one sample delay */ + switch (v & 7) + { + case 0: + /* M1---C1---MEM---M2---C2---OUT */ + //PSG.oper[i1].connect = c1; + //oc1.connect = mem; + //om2.connect = c2; + //PSG.oper[i1].mem_connect = m2; + iconnect[cha * 4] = 9; + iconnect[cha * 4 + 2] = 11; + iconnect[cha * 4 + 1] = 10; + imem[cha * 4] = 8; + break; + + case 1: + /* M1------+-MEM---M2---C2---OUT */ + /* C1-+ */ + //PSG.oper[i1].connect = mem; + //oc1.connect = mem; + //om2.connect = c2; + //PSG.oper[i1].mem_connect = m2; + iconnect[cha * 4] = 11; + iconnect[cha * 4 + 2] = 11; + iconnect[cha * 4 + 1] = 10; + imem[cha * 4] = 8; + break; + + case 2: + /* M1-----------------+-C2---OUT */ + /* C1---MEM---M2-+ */ + //PSG.oper[i1].connect = c2; + //oc1.connect = mem; + //om2.connect = c2; + //PSG.oper[i1].mem_connect = m2; + iconnect[cha * 4] = 10; + iconnect[cha * 4 + 2] = 11; + iconnect[cha * 4 + 1] = 10; + imem[cha * 4] = 8; + break; + + case 3: + /* M1---C1---MEM------+-C2---OUT */ + /* M2-+ */ + //PSG.oper[i1].connect = c1; + //oc1.connect = mem; + //om2.connect = c2; + //PSG.oper[i1].mem_connect = c2; + iconnect[cha * 4] = 9; + iconnect[cha * 4 + 2] = 11; + iconnect[cha * 4 + 1] = 10; + imem[cha * 4] = 10; + break; + + case 4: + /* M1---C1-+-OUT */ + /* M2---C2-+ */ + /* MEM: not used */ + //PSG.oper[i1].connect = c1; + //oc1.connect = chanout[cha]; + //om2.connect = c2; + //PSG.oper[i1].mem_connect = mem; /* store it anywhere where it will not be used */ + iconnect[cha * 4] = 9; + iconnect[cha * 4 + 2] = cha; + iconnect[cha * 4 + 1] = 10; + imem[cha * 4] = 11; + break; + + case 5: + /* +----C1----+ */ + /* M1-+-MEM---M2-+-OUT */ + /* +----C2----+ */ + //PSG.oper[i1].connect = 0; /* special mark */ + //oc1.connect = chanout[cha]; + //om2.connect = chanout[cha]; + //PSG.oper[i1].mem_connect = m2; + iconnect[cha * 4] = 12; + iconnect[cha * 4 + 2] = cha; + iconnect[cha * 4 + 1] = cha; + imem[cha * 4] = 8; + break; + + case 6: + /* M1---C1-+ */ + /* M2-+-OUT */ + /* C2-+ */ + /* MEM: not used */ + //PSG.oper[i1].connect = c1; + //oc1.connect = chanout[cha]; + //om2.connect = chanout[cha]; + //PSG.oper[i1].mem_connect = mem; /* store it anywhere where it will not be used */ + iconnect[cha * 4] = 9; + iconnect[cha * 4 + 2] = cha; + iconnect[cha * 4 + 1] = cha; + imem[cha * 4] = 11; + break; + + case 7: + /* M1-+ */ + /* C1-+-OUT */ + /* M2-+ */ + /* C2-+ */ + /* MEM: not used*/ + //PSG.oper[i1].connect = chanout[cha]; + //oc1.connect = chanout[cha]; + //om2.connect = chanout[cha]; + //PSG.oper[i1].mem_connect = mem; /* store it anywhere where it will not be used */ + iconnect[cha * 4] = cha; + iconnect[cha * 4 + 2] = cha; + iconnect[cha * 4 + 1] = cha; + imem[cha * 4] = 11; + break; + } + } + private static void refresh_EG(int i1) + { + uint kc; + uint v; + kc = PSG.oper[i1].kc; + /* v = 32 + 2*RATE + RKS = max 126 */ + v = kc >> (int)PSG.oper[i1].ks; + if ((PSG.oper[i1].ar + v) < 94) + { + PSG.oper[i1].eg_sh_ar = FM.eg_rate_shift[PSG.oper[i1].ar + v]; + PSG.oper[i1].eg_sel_ar = FM.eg_rate_select[PSG.oper[i1].ar + v]; + } + else + { + PSG.oper[i1].eg_sh_ar = 0; + PSG.oper[i1].eg_sel_ar = 17 * 8; + } + PSG.oper[i1].eg_sh_d1r = FM.eg_rate_shift[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sel_d1r = FM.eg_rate_select[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sh_d2r = FM.eg_rate_shift[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sel_d2r = FM.eg_rate_select[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sh_rr = FM.eg_rate_shift[PSG.oper[i1].rr + v]; + PSG.oper[i1].eg_sel_rr = FM.eg_rate_select[PSG.oper[i1].rr + v]; + i1 += 1; + v = kc >> (int)PSG.oper[i1].ks; + if ((PSG.oper[i1].ar + v) < 94) + { + PSG.oper[i1].eg_sh_ar = FM.eg_rate_shift[PSG.oper[i1].ar + v]; + PSG.oper[i1].eg_sel_ar = FM.eg_rate_select[PSG.oper[i1].ar + v]; + } + else + { + PSG.oper[i1].eg_sh_ar = 0; + PSG.oper[i1].eg_sel_ar = 17 * 8; + } + PSG.oper[i1].eg_sh_d1r = FM.eg_rate_shift[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sel_d1r = FM.eg_rate_select[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sh_d2r = FM.eg_rate_shift[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sel_d2r = FM.eg_rate_select[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sh_rr = FM.eg_rate_shift[PSG.oper[i1].rr + v]; + PSG.oper[i1].eg_sel_rr = FM.eg_rate_select[PSG.oper[i1].rr + v]; + i1 += 1; + v = kc >> (int)PSG.oper[i1].ks; + if ((PSG.oper[i1].ar + v) < 94) + { + PSG.oper[i1].eg_sh_ar = FM.eg_rate_shift[PSG.oper[i1].ar + v]; + PSG.oper[i1].eg_sel_ar = FM.eg_rate_select[PSG.oper[i1].ar + v]; + } + else + { + PSG.oper[i1].eg_sh_ar = 0; + PSG.oper[i1].eg_sel_ar = 17 * 8; + } + PSG.oper[i1].eg_sh_d1r = FM.eg_rate_shift[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sel_d1r = FM.eg_rate_select[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sh_d2r = FM.eg_rate_shift[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sel_d2r = FM.eg_rate_select[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sh_rr = FM.eg_rate_shift[PSG.oper[i1].rr + v]; + PSG.oper[i1].eg_sel_rr = FM.eg_rate_select[PSG.oper[i1].rr + v]; + i1 += 1; + v = kc >> (int)PSG.oper[i1].ks; + if ((PSG.oper[i1].ar + v) < 94) + { + PSG.oper[i1].eg_sh_ar = FM.eg_rate_shift[PSG.oper[i1].ar + v]; + PSG.oper[i1].eg_sel_ar = FM.eg_rate_select[PSG.oper[i1].ar + v]; + } + else + { + PSG.oper[i1].eg_sh_ar = 0; + PSG.oper[i1].eg_sel_ar = 17 * 8; + } + PSG.oper[i1].eg_sh_d1r = FM.eg_rate_shift[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sel_d1r = FM.eg_rate_select[PSG.oper[i1].d1r + v]; + PSG.oper[i1].eg_sh_d2r = FM.eg_rate_shift[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sel_d2r = FM.eg_rate_select[PSG.oper[i1].d2r + v]; + PSG.oper[i1].eg_sh_rr = FM.eg_rate_shift[PSG.oper[i1].rr + v]; + PSG.oper[i1].eg_sel_rr = FM.eg_rate_select[PSG.oper[i1].rr + v]; + } + private static void ym2151_write_reg(int r, int v) + { + int opIndex = (r & 0x07) * 4 + ((r & 0x18) >> 3); + /* adjust bus to 8 bits */ + r &= 0xff; + v &= 0xff; + switch (r & 0xe0) + { + case 0x00: + switch (r) + { + case 0x01: /* LFO reset(bit 1), Test Register (other bits) */ + PSG.test = (byte)v; + if ((v & 2) != 0) + { + PSG.lfo_phase = 0; + } + break; + case 0x08: + envelope_KONKOFF((uint)((v & 7) * 4), v); + break; + case 0x0f: /* noise mode enable, noise period */ + PSG.noise = (uint)v; + PSG.noise_f = PSG.noise_tab[v & 0x1f]; + break; + case 0x10: /* timer A hi */ + PSG.timer_A_index = (PSG.timer_A_index & 0x003) | (uint)(v << 2); + break; + case 0x11: /* timer A low */ + PSG.timer_A_index = (PSG.timer_A_index & 0x3fc) | (uint)(v & 3); + break; + case 0x12: /* timer B */ + PSG.timer_B_index = (uint)v; + break; + case 0x14: /* CSM, irq flag reset, irq enable, timer start/stop */ + PSG.irq_enable = (uint)v; /* bit 3-timer B, bit 2-timer A, bit 7 - CSM */ + if ((v & 0x10) != 0) /* reset timer A irq flag */ + { + PSG.status &= 0xfffffffe; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqAoff_callback); + } + if ((v & 0x20) != 0) /* reset timer B irq flag */ + { + PSG.status &= 0xfffffffd; + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqBoff_callback); + } + if ((v & 0x02) != 0) + { /* load and start timer B */ + /* ASG 980324: added a real timer */ + /* start timer _only_ if it wasn't already started (it will reload time value next round) */ + if (!EmuTimer.timer_enable(PSG.timer_B, true)) + { + EmuTimer.timer_adjust_periodic(PSG.timer_B, PSG.timer_B_time[PSG.timer_B_index], Attotime.ATTOTIME_NEVER); + PSG.timer_B_index_old = PSG.timer_B_index; + } + } + else + { /* stop timer B */ + /* ASG 980324: added a real timer */ + EmuTimer.timer_enable(PSG.timer_B, false); + } + if ((v & 0x01) != 0) + { /* load and start timer A */ + /* ASG 980324: added a real timer */ + /* start timer _only_ if it wasn't already started (it will reload time value next round) */ + if (!EmuTimer.timer_enable(PSG.timer_A, true)) + { + EmuTimer.timer_adjust_periodic(PSG.timer_A, PSG.timer_A_time[PSG.timer_A_index], Attotime.ATTOTIME_NEVER); + PSG.timer_A_index_old = PSG.timer_A_index; + } + } + else + { /* stop timer A */ + /* ASG 980324: added a real timer */ + EmuTimer.timer_enable(PSG.timer_A, false); + } + break; + case 0x18: /* LFO frequency */ + { + PSG.lfo_overflow = (uint)((1 << ((15 - (v >> 4)) + 3)) * (1 << 10)); + PSG.lfo_counter_add = (uint)(0x10 + (v & 0x0f)); + } + break; + case 0x19: /* PMD (bit 7==1) or AMD (bit 7==0) */ + if ((v & 0x80) != 0) + PSG.pmd = (sbyte)(v & 0x7f); + else + PSG.amd = (byte)(v & 0x7f); + break; + case 0x1b: /* CT2, CT1, LFO waveform */ + PSG.ct = (byte)(v >> 6); + PSG.lfo_wsel = (byte)(v & 3); + if (PSG.porthandler != null) + { + PSG.porthandler(0, PSG.ct); + } + break; + default: + //logerror("YM2151 Write %02x to undocumented register #%02x\n", v, r); + break; + } + break; + case 0x20: + int op1 = (r & 7) * 4; + //op = PSG.oper[(r & 7) * 4]; + switch (r & 0x18) + { + case 0x00: /* RL enable, Feedback, Connection */ + PSG.oper[op1].fb_shift = (uint)((((v >> 3) & 7) != 0) ? ((v >> 3) & 7) + 6 : 0); + PSG.pan[(r & 7) * 2] = (uint)(((v & 0x40) != 0) ? ~0 : 0); + PSG.pan[(r & 7) * 2 + 1] = (uint)(((v & 0x80) != 0) ? ~0 : 0); + PSG.connect[r & 7] = (byte)(v & 7); + set_connect(r & 7, v & 7); + break; + case 0x08: /* Key Code */ + v &= 0x7f; + if (v != PSG.oper[op1].kc) + { + uint kc, kc_channel; + kc_channel = (uint)((v - (v >> 2)) * 64); + kc_channel += 768; + kc_channel |= (PSG.oper[op1].kc_i & 63); + PSG.oper[(r & 7) * 4].kc = (uint)v; + PSG.oper[(r & 7) * 4].kc_i = kc_channel; + PSG.oper[(r & 7) * 4 + 1].kc = (uint)v; + PSG.oper[(r & 7) * 4 + 1].kc_i = kc_channel; + PSG.oper[(r & 7) * 4 + 2].kc = (uint)v; + PSG.oper[(r & 7) * 4 + 2].kc_i = kc_channel; + PSG.oper[(r & 7) * 4 + 3].kc = (uint)v; + PSG.oper[(r & 7) * 4 + 3].kc_i = kc_channel; + kc = (uint)(v >> 2); + PSG.oper[(r & 7) * 4].dt1 = PSG.dt1_freq[PSG.oper[(r & 7) * 4].dt1_i + kc]; + PSG.oper[(r & 7) * 4].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4].dt2] + PSG.oper[(r & 7) * 4].dt1) * PSG.oper[(r & 7) * 4].mul) >> 1); + PSG.oper[(r & 7) * 4 + 1].dt1 = PSG.dt1_freq[PSG.oper[(r & 7) * 4 + 1].dt1_i + kc]; + PSG.oper[(r & 7) * 4 + 1].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4 + 1].dt2] + PSG.oper[(r & 7) * 4 + 1].dt1) * PSG.oper[(r & 7) * 4 + 1].mul) >> 1); + PSG.oper[(r & 7) * 4 + 2].dt1 = PSG.dt1_freq[PSG.oper[(r & 7) * 4 + 2].dt1_i + kc]; + PSG.oper[(r & 7) * 4 + 2].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4 + 2].dt2] + PSG.oper[(r & 7) * 4 + 2].dt1) * PSG.oper[(r & 7) * 4 + 2].mul) >> 1); + PSG.oper[(r & 7) * 4 + 3].dt1 = PSG.dt1_freq[PSG.oper[(r & 7) * 4 + 3].dt1_i + kc]; + PSG.oper[(r & 7) * 4 + 3].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4 + 3].dt2] + PSG.oper[(r & 7) * 4 + 3].dt1) * PSG.oper[(r & 7) * 4 + 3].mul) >> 1); + refresh_EG(op1); + } + break; + case 0x10: /* Key Fraction */ + v >>= 2; + if (v != (PSG.oper[(r & 7) * 4].kc_i & 63)) + { + uint kc_channel; + kc_channel = (uint)v; + kc_channel |= (uint)(PSG.oper[(r & 7) * 4].kc_i & ~63); + PSG.oper[(r & 7) * 4].kc_i = kc_channel; + PSG.oper[(r & 7) * 4 + 1].kc_i = kc_channel; + PSG.oper[(r & 7) * 4 + 2].kc_i = kc_channel; + PSG.oper[(r & 7) * 4 + 3].kc_i = kc_channel; + PSG.oper[(r & 7) * 4].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4].dt2] + PSG.oper[(r & 7) * 4].dt1) * PSG.oper[(r & 7) * 4].mul) >> 1); + PSG.oper[(r & 7) * 4 + 1].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4 + 1].dt2] + PSG.oper[(r & 7) * 4 + 1].dt1) * PSG.oper[(r & 7) * 4 + 1].mul) >> 1); + PSG.oper[(r & 7) * 4 + 2].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4 + 2].dt2] + PSG.oper[(r & 7) * 4 + 2].dt1) * PSG.oper[(r & 7) * 4 + 2].mul) >> 1); + PSG.oper[(r & 7) * 4 + 3].freq = (uint)(((PSG.freq[kc_channel + PSG.oper[(r & 7) * 4 + 3].dt2] + PSG.oper[(r & 7) * 4 + 3].dt1) * PSG.oper[(r & 7) * 4 + 3].mul) >> 1); + } + break; + case 0x18: /* PMS, AMS */ + PSG.oper[op1].pms = (uint)((v >> 4) & 7); + PSG.oper[op1].ams = (uint)(v & 3); + break; + } + break; + case 0x40: /* DT1, MUL */ + { + uint olddt1_i = PSG.oper[opIndex].dt1_i; + uint oldmul = PSG.oper[opIndex].mul; + PSG.oper[opIndex].dt1_i = (uint)((v & 0x70) << 1); + PSG.oper[opIndex].mul = (uint)(((v & 0x0f) != 0) ? (v & 0x0f) << 1 : 1); + if (olddt1_i != PSG.oper[opIndex].dt1_i) + PSG.oper[opIndex].dt1 = PSG.dt1_freq[PSG.oper[opIndex].dt1_i + (PSG.oper[opIndex].kc >> 2)]; + if ((olddt1_i != PSG.oper[opIndex].dt1_i) || (oldmul != PSG.oper[opIndex].mul)) + PSG.oper[opIndex].freq = (uint)(((PSG.freq[PSG.oper[opIndex].kc_i + PSG.oper[opIndex].dt2] + PSG.oper[opIndex].dt1) * PSG.oper[opIndex].mul) >> 1); + } + break; + case 0x60: /* TL */ + PSG.oper[opIndex].tl = (uint)((v & 0x7f) << 3); /* 7bit TL */ + break; + case 0x80: /* KS, AR */ + { + uint oldks = PSG.oper[opIndex].ks; + uint oldar = PSG.oper[opIndex].ar; + PSG.oper[opIndex].ks = (uint)(5 - (v >> 6)); + PSG.oper[opIndex].ar = (uint)(((v & 0x1f) != 0) ? 32 + ((v & 0x1f) << 1) : 0); + if ((PSG.oper[opIndex].ar != oldar) || (PSG.oper[opIndex].ks != oldks)) + { + if ((PSG.oper[opIndex].ar + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)) < 32 + 62) + { + PSG.oper[opIndex].eg_sh_ar = FM.eg_rate_shift[PSG.oper[opIndex].ar + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sel_ar = FM.eg_rate_select[PSG.oper[opIndex].ar + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + } + else + { + PSG.oper[opIndex].eg_sh_ar = 0; + PSG.oper[opIndex].eg_sel_ar = 17 * 8; + } + } + if (PSG.oper[opIndex].ks != oldks) + { + PSG.oper[opIndex].eg_sh_d1r = FM.eg_rate_shift[PSG.oper[opIndex].d1r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sel_d1r = FM.eg_rate_select[PSG.oper[opIndex].d1r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sh_d2r = FM.eg_rate_shift[PSG.oper[opIndex].d2r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sel_d2r = FM.eg_rate_select[PSG.oper[opIndex].d2r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sh_rr = FM.eg_rate_shift[PSG.oper[opIndex].rr + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sel_rr = FM.eg_rate_select[PSG.oper[opIndex].rr + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + } + } + break; + case 0xa0: /* LFO AM enable, D1R */ + PSG.oper[opIndex].AMmask = (uint)(((v & 0x80) != 0) ? ~0 : 0); + PSG.oper[opIndex].d1r = (uint)(((v & 0x1f) != 0) ? 32 + ((v & 0x1f) << 1) : 0); + PSG.oper[opIndex].eg_sh_d1r = FM.eg_rate_shift[PSG.oper[opIndex].d1r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sel_d1r = FM.eg_rate_select[PSG.oper[opIndex].d1r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + break; + case 0xc0: /* DT2, D2R */ + { + uint olddt2 = PSG.oper[opIndex].dt2; + PSG.oper[opIndex].dt2 = dt2_tab[v >> 6]; + if (PSG.oper[opIndex].dt2 != olddt2) + PSG.oper[opIndex].freq = (uint)(((PSG.freq[PSG.oper[opIndex].kc_i + PSG.oper[opIndex].dt2] + PSG.oper[opIndex].dt1) * PSG.oper[opIndex].mul) >> 1); + } + PSG.oper[opIndex].d2r = (uint)(((v & 0x1f) != 0) ? 32 + ((v & 0x1f) << 1) : 0); + PSG.oper[opIndex].eg_sh_d2r = FM.eg_rate_shift[PSG.oper[opIndex].d2r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sel_d2r = FM.eg_rate_select[PSG.oper[opIndex].d2r + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + break; + case 0xe0: /* D1L, RR */ + PSG.oper[opIndex].d1l = d1l_tab[v >> 4]; + PSG.oper[opIndex].rr = (uint)(34 + ((v & 0x0f) << 2)); + PSG.oper[opIndex].eg_sh_rr = FM.eg_rate_shift[PSG.oper[opIndex].rr + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + PSG.oper[opIndex].eg_sel_rr = FM.eg_rate_select[PSG.oper[opIndex].rr + (PSG.oper[opIndex].kc >> (int)PSG.oper[opIndex].ks)]; + break; + } + } + public static void ym2151_postload() + { + int j; + for (j = 0; j < 8; j++) + { + set_connect(j, PSG.connect[j]); + } + } + public static void ym2151_init(int clock) + { + PSG.connect = new byte[8]; + PSG.dt1_freq = new int[256]; + PSG.freq = new uint[11 * 768]; + PSG.noise_tab = new uint[32]; + PSG.oper = new YM2151Operator[32]; + PSG.pan = new uint[16]; + PSG.timer_A_time = new Atime[1024]; + PSG.timer_B_time = new Atime[256]; + for (int i1 = 0; i1 < 32; i1++) + { + iconnect[i1] = 12; + } + init_tables(); + PSG.clock = clock;//rate = clock/64 + PSG.sampfreq = clock / 64; + PSG.irqhandler = null; + PSG.porthandler = null; + init_chip_tables(); + PSG.lfo_timer_add = (uint)(0x400 * (clock / 64.0) / PSG.sampfreq); + PSG.eg_timer_add = (uint)(0x10000 * (clock / 64.0) / PSG.sampfreq); + PSG.eg_timer_overflow = 0x30000; + /* this must be done _before_ a call to ym2151_reset_chip() */ + PSG.timer_A = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2151_timer_callback_a, false); + PSG.timer_B = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2151_timer_callback_b, false); + ym2151_reset_chip(); + switch (Machine.sBoard) + { + case "CPS-1": + PSG.irqhandler = Cpuint.cps1_irq_handler_mus; + break; + case "Namco System 1": + PSG.irqhandler = Cpuint.namcos1_sound_interrupt; + break; + case "M72": + PSG.irqhandler = M72.m72_ym2151_irq_handler; + break; + case "M92": + PSG.irqhandler = M92.sound_irq; + break; + case "Taito": + switch (Machine.sName) + { + case "opwolf": + case "opwolfa": + case "opwolfj": + case "opwolfu": + case "opwolfb": + case "opwolfp": + PSG.irqhandler = Taito.irq_handler; + PSG.porthandler = Taito.sound_bankswitch_w; + break; + } + break; + case "Konami 68000": + switch (Machine.sName) + { + case "cuebrick": + PSG.irqhandler = Konami68000.cuebrick_irq_handler; + break; + default: + PSG.irqhandler = Konami68000.konami68000_ym2151_irq_handler; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "sf": + case "sfua": + case "sfj": + case "sfjan": + case "sfan": + case "sfp": + PSG.irqhandler = Capcom.irq_handler; + break; + } + break; + } + } + public static void ym2151_reset_chip() + { + int i; + /* initialize hardware registers */ + for (i = 0; i < 32; i++) + { + PSG.oper[i].volume = 0x3ff; + PSG.oper[i].kc_i = 768; /* min kc_i value */ + } + PSG.eg_timer = 0; + PSG.eg_cnt = 0; + PSG.lfo_timer = 0; + PSG.lfo_counter = 0; + PSG.lfo_phase = 0; + PSG.lfo_wsel = 0; + PSG.pmd = 0; + PSG.amd = 0; + PSG.lfa = 0; + PSG.lfp = 0; + PSG.test = 0; + PSG.irq_enable = 0; + /* ASG 980324 -- reset the timers before writing to the registers */ + EmuTimer.timer_enable(PSG.timer_A, false); + EmuTimer.timer_enable(PSG.timer_B, false); + PSG.timer_A_index = 0; + PSG.timer_B_index = 0; + PSG.timer_A_index_old = 0; + PSG.timer_B_index_old = 0; + PSG.noise = 0; + PSG.noise_rng = 0; + PSG.noise_p = 0; + PSG.noise_f = PSG.noise_tab[0]; + PSG.csm_req = 0; + PSG.status = 0; + ym2151_write_reg(0x1b, 0); /* only because of CT1, CT2 output pins */ + ym2151_write_reg(0x18, 0); /* set LFO frequency */ + for (i = 0x20; i < 0x100; i++) /* set the operators */ + { + ym2151_write_reg(i, 0); + } + } + + unsafe static int op_calc(YM2151Operator* PSGoper, int i1, uint env, int pm) + { + uint p; + p = (env << 3) + sin_tab[(((int)((PSGoper[i1].phase & 0xffff0000) + (pm << 15))) >> 16) & 0x3ff]; + if (p >= 13 * 2 * 0x100) + { + return 0; + } + return tl_tab[p]; + } + + //private static int op_calc(int i1, uint env, int pm) + //{ + // uint p; + // p = (env << 3) + sin_tab[(((int)((PSG.oper[i1].phase & 0xffff0000) + (pm << 15))) >> 16) & 0x3ff]; + // if (p >= 13 * 2 * 0x100) + // { + // return 0; + // } + // return tl_tab[p]; + //} + + + unsafe static int op_calc1(YM2151Operator* PSGoper, int i1, uint env, int pm) + { + uint p; + int i; + i = (int)((PSGoper[i1].phase & 0xffff0000) + pm); + p = (env << 3) + sin_tab[(i >> 16) & 0x3ff]; + if (p >= 13 * 2 * 0x100) + { + return 0; + } + return tl_tab[p]; + } + + //private static int op_calc1_src(int i1, uint env, int pm) + //{ + // uint p; + // int i; + // i = (int)((PSG.oper[i1].phase & 0xffff0000) + pm); + // p = (env << 3) + sin_tab[(i >> 16) & 0x3ff]; + // if (p >= 13 * 2 * 0x100) + // { + // return 0; + // } + // return tl_tab[p]; + //} + + unsafe static uint volume_calc(YM2151Operator* PSGoper, int i1, uint AM) + { + uint i11; + i11 = PSGoper[i1].tl + ((uint)PSGoper[i1].volume) + (AM & PSGoper[i1].AMmask); + return i11; + } + //private static uint volume_calc_old(int i1, uint AM) + //{ + // uint i11; + // i11 = PSG.oper[i1].tl + ((uint)PSG.oper[i1].volume) + (AM & PSG.oper[i1].AMmask); + // return i11; + //} + + //chan_calc高频调用 单次Update 5467次 左右,下级堆栈volume_calc 20000+次 op_calc 10000+次 + + unsafe static void chan_calc(YM2151Operator* PSGoper, int* chanout, int* imem, int chan) + { + + //fixed (YM2151Operator* PSGoperPtr = &PSG.oper[0]) + { + //YM2151Operator* PSGoper = PSGoperPtr; + uint env; + uint AM = 0; + //m2 = c1 = c2 = mem = 0; + chanout[8] = chanout[9] = chanout[10] = chanout[11] = 0; + //op = PSGoper[chan * 4]; /* M1 */ + //op.mem_connect = op.mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ + set_mem(PSGoper, chanout, imem, chan * 4); + if (PSGoper[chan * 4].ams != 0) + { + AM = PSG.lfa << (int)(PSGoper[chan * 4].ams - 1); + } + + env = volume_calc(PSGoper, (chan * 4), AM); + //env = volume_calc_planB(PSGoper[chan * 4], AM); + { + int iout = PSGoper[chan * 4].fb_out_prev + PSGoper[chan * 4].fb_out_curr; + PSGoper[chan * 4].fb_out_prev = PSGoper[chan * 4].fb_out_curr; + + set_value1(chanout, PSGoper, chan * 4); + + PSGoper[chan * 4].fb_out_curr = 0; + if (env < 13 * 64) + { + if (PSGoper[chan * 4].fb_shift == 0) + { + iout = 0; + } + PSGoper[chan * 4].fb_out_curr = op_calc1(PSGoper, (chan * 4), env, (iout << (int)PSGoper[chan * 4].fb_shift)); + } + } + env = volume_calc(PSGoper, (chan * 4 + 1), AM); /* M2 */ + //env = volume_calc_planB(PSGoper[chan * 4 + 1], AM);/* M2 */ + if (env < 13 * 64) + { + //PSGoper[chan * 4 + 1].connect += op_calc((int)(chan * 4 + 1), env, m2); + set_value2(chanout, chan * 4 + 1, op_calc(PSGoper, (chan * 4 + 1), env, chanout[8]));// m2)); + } + env = volume_calc(PSGoper, (chan * 4 + 2), AM); /* C1 */ + //env = volume_calc_planB(PSGoper[chan * 4 + 2], AM); /* C1 */ + if (env < 13 * 64) + { + //PSGoper[chan * 4 + 2].connect += op_calc((int)(chan * 4 + 2), env, c1); + set_value2(chanout, chan * 4 + 2, op_calc(PSGoper, (chan * 4 + 2), env, chanout[9]));// c1)); + } + env = volume_calc(PSGoper, (chan * 4 + 3), AM); /* C2 */ + //env = volume_calc_planB(PSGoper[chan * 4 + 3], AM); /* C2 */ + if (env < 13 * 64) + { + chanout[chan] += op_calc(PSGoper, (chan * 4 + 3), env, chanout[10]);// c2); + } + /* M1 */ + PSGoper[chan * 4].mem_value = chanout[11];//mem; + } + + } + + //private static void chan_calc_src(int chan) + //{ + // uint env; + // uint AM = 0; + // //m2 = c1 = c2 = mem = 0; + // chanout[8] = chanout[9] = chanout[10] = chanout[11] = 0; + // //op = PSG.oper[chan * 4]; /* M1 */ + // //op.mem_connect = op.mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ + // set_mem(chan * 4); + // if (PSG.oper[chan * 4].ams != 0) + // { + // AM = PSG.lfa << (int)(PSG.oper[chan * 4].ams - 1); + // } + + + // env = volume_calc((int)(chan * 4), AM); + // //env = volume_calc_planB(PSG.oper[chan * 4], AM); + // { + // int iout = PSG.oper[chan * 4].fb_out_prev + PSG.oper[chan * 4].fb_out_curr; + // PSG.oper[chan * 4].fb_out_prev = PSG.oper[chan * 4].fb_out_curr; + + // set_value1(chan * 4); + + // PSG.oper[chan * 4].fb_out_curr = 0; + // if (env < 13 * 64) + // { + // if (PSG.oper[chan * 4].fb_shift == 0) + // { + // iout = 0; + // } + // PSG.oper[chan * 4].fb_out_curr = op_calc1((int)(chan * 4), env, (int)(iout << (int)PSG.oper[chan * 4].fb_shift)); + // } + // } + // env = volume_calc((int)(chan * 4 + 1), AM); /* M2 */ + // //env = volume_calc_planB(PSG.oper[chan * 4 + 1], AM);/* M2 */ + // if (env < 13 * 64) + // { + // //PSG.oper[chan * 4 + 1].connect += op_calc((int)(chan * 4 + 1), env, m2); + // set_value2(chan * 4 + 1, op_calc((int)(chan * 4 + 1), env, chanout[8]));// m2)); + // } + // env = volume_calc((int)(chan * 4 + 2), AM); /* C1 */ + // //env = volume_calc_planB(PSG.oper[chan * 4 + 2], AM); /* C1 */ + // if (env < 13 * 64) + // { + // //PSG.oper[chan * 4 + 2].connect += op_calc((int)(chan * 4 + 2), env, c1); + // set_value2(chan * 4 + 2, op_calc((int)(chan * 4 + 2), env, chanout[9]));// c1)); + // } + // env = volume_calc((int)(chan * 4 + 3), AM); /* C2 */ + // //env = volume_calc_planB(PSG.oper[chan * 4 + 3], AM); /* C2 */ + // if (env < 13 * 64) + // { + // chanout[chan] += op_calc((int)(chan * 4 + 3), env, chanout[10]);// c2); + // } + // /* M1 */ + // PSG.oper[chan * 4].mem_value = chanout[11];//mem; + //} + + unsafe static void chan7_calc(YM2151Operator* PSGoper, int* chanout, int* imem) + { + uint env; + uint AM = 0; + //m2 = c1 = c2 = mem = 0; + chanout[8] = chanout[9] = chanout[10] = chanout[11] = 0; + //op = PSG.oper[7 * 4]; /* M1 */ + //op.mem_connect = op.mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ + set_mem(PSGoper, chanout, imem, 7 * 4); + if (PSGoper[7 * 4].ams != 0) + { + AM = PSG.lfa << (int)(PSGoper[7 * 4].ams - 1); + } + env = volume_calc(PSGoper, 7 * 4, AM); + //env = volume_calc_planB(PSGoper[7*4], AM); + int iout = PSGoper[7 * 4].fb_out_prev + PSGoper[7 * 4].fb_out_curr; + PSGoper[7 * 4].fb_out_prev = PSGoper[7 * 4].fb_out_curr; + set_value1(chanout, PSGoper, 7 * 4); + PSGoper[7 * 4].fb_out_curr = 0; + if (env < 13 * 64) + { + if (PSGoper[7 * 4].fb_shift == 0) + { + iout = 0; + } + PSGoper[7 * 4].fb_out_curr = op_calc1(PSGoper, 7 * 4, env, (iout << (int)PSGoper[7 * 4].fb_shift)); + } + env = volume_calc(PSGoper, 7 * 4 + 1, AM); /* M2 */ + //env = volume_calc_planB(PSGoper[7 * 4 + 1], AM);/* M2 */ + if (env < 13 * 64) + { + //PSGoper[7 * 4 + 1].connect += op_calc(7 * 4 + 1, env, m2); + set_value2(chanout, 7 * 4 + 1, op_calc(PSGoper, 7 * 4 + 1, env, chanout[8]));// m2)); + } + env = volume_calc(PSGoper, 7 * 4 + 2, AM); /* C1 */ + //env = volume_calc_planB(PSGoper[7 * 4 + 2], AM);/* C1 */ + if (env < 13 * 64) + { + //PSGoper[7 * 4 + 2].connect += op_calc(7 * 4 + 2, env, c1); + set_value2(chanout, 7 * 4 + 2, op_calc(PSGoper, 7 * 4 + 2, env, chanout[9]));// c1)); + } + env = volume_calc(PSGoper, 7 * 4 + 3, AM); /* C2 */ + //env = volume_calc_planB(PSGoper[7 * 4 + 3], AM);/* C2 */ + if ((PSG.noise & 0x80) != 0) + { + uint noiseout; + + noiseout = 0; + if (env < 0x3ff) + noiseout = (env ^ 0x3ff) * 2; /* range of the YM2151 noise output is -2044 to 2040 */ + chanout[7] += (int)(((PSG.noise_rng & 0x10000) != 0) ? noiseout : -noiseout); /* bit 16 -> output */ + } + else + { + if (env < 13 * 64) + chanout[7] += op_calc(PSGoper, 7 * 4 + 3, env, chanout[10]);// c2); + } + /* M1 */ + PSGoper[7 * 4].mem_value = chanout[11];//mem; + } + + //private static void chan7_calc_src() + //{ + // uint env; + // uint AM = 0; + // //m2 = c1 = c2 = mem = 0; + // chanout[8] = chanout[9] = chanout[10] = chanout[11] = 0; + // //op = PSG.oper[7 * 4]; /* M1 */ + // //op.mem_connect = op.mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ + // set_mem(7 * 4); + // if (PSG.oper[7 * 4].ams != 0) + // { + // AM = PSG.lfa << (int)(PSG.oper[7 * 4].ams - 1); + // } + // env = volume_calc(7 * 4, AM); + // //env = volume_calc_planB(PSG.oper[7*4], AM); + // int iout = PSG.oper[7 * 4].fb_out_prev + PSG.oper[7 * 4].fb_out_curr; + // PSG.oper[7 * 4].fb_out_prev = PSG.oper[7 * 4].fb_out_curr; + // set_value1(7 * 4); + // PSG.oper[7 * 4].fb_out_curr = 0; + // if (env < 13 * 64) + // { + // if (PSG.oper[7 * 4].fb_shift == 0) + // { + // iout = 0; + // } + // PSG.oper[7 * 4].fb_out_curr = op_calc1(7 * 4, env, (iout << (int)PSG.oper[7 * 4].fb_shift)); + // } + // env = volume_calc(7 * 4 + 1, AM); /* M2 */ + // //env = volume_calc_planB(PSG.oper[7 * 4 + 1], AM);/* M2 */ + // if (env < 13 * 64) + // { + // //PSG.oper[7 * 4 + 1].connect += op_calc(7 * 4 + 1, env, m2); + // set_value2(7 * 4 + 1, op_calc(7 * 4 + 1, env, chanout[8]));// m2)); + // } + // env = volume_calc(7 * 4 + 2, AM); /* C1 */ + // //env = volume_calc_planB(PSG.oper[7 * 4 + 2], AM);/* C1 */ + // if (env < 13 * 64) + // { + // //PSG.oper[7 * 4 + 2].connect += op_calc(7 * 4 + 2, env, c1); + // set_value2(7 * 4 + 2, op_calc(7 * 4 + 2, env, chanout[9]));// c1)); + // } + // env = volume_calc(7 * 4 + 3, AM); /* C2 */ + // //env = volume_calc_planB(PSG.oper[7 * 4 + 3], AM);/* C2 */ + // if ((PSG.noise & 0x80) != 0) + // { + // uint noiseout; + + // noiseout = 0; + // if (env < 0x3ff) + // noiseout = (env ^ 0x3ff) * 2; /* range of the YM2151 noise output is -2044 to 2040 */ + // chanout[7] += (int)(((PSG.noise_rng & 0x10000) != 0) ? noiseout : -noiseout); /* bit 16 -> output */ + // } + // else + // { + // if (env < 13 * 64) + // chanout[7] += op_calc(7 * 4 + 3, env, chanout[10]);// c2); + // } + // /* M1 */ + // PSG.oper[7 * 4].mem_value = chanout[11];//mem; + //} + + unsafe static void advance_eg(YM2151Operator* PSGoper) + { + uint i; + int i1 = 0; + PSG.eg_timer += PSG.eg_timer_add; + while (PSG.eg_timer >= PSG.eg_timer_overflow) + { + PSG.eg_timer -= PSG.eg_timer_overflow; + PSG.eg_cnt++; + /* envelope generator */ + //op = PSGoper[i1]; /* CH 0 M1 */ + i = 32; + do + { + switch (PSGoper[i1].state) + { + case 4: /* attack phase */ + if ((PSG.eg_cnt & ((1 << PSGoper[i1].eg_sh_ar) - 1)) == 0) + { + PSGoper[i1].volume += (~PSGoper[i1].volume * + (eg_inc[PSGoper[i1].eg_sel_ar + ((PSG.eg_cnt >> PSGoper[i1].eg_sh_ar) & 7)]) + ) >> 4; + + if (PSGoper[i1].volume <= 0) + { + PSGoper[i1].volume = 0; + PSGoper[i1].state = 3; + } + } + break; + case 3: /* decay phase */ + if ((PSG.eg_cnt & ((1 << PSGoper[i1].eg_sh_d1r) - 1)) == 0) + { + PSGoper[i1].volume += eg_inc[PSGoper[i1].eg_sel_d1r + ((PSG.eg_cnt >> PSGoper[i1].eg_sh_d1r) & 7)]; + if (PSGoper[i1].volume >= PSGoper[i1].d1l) + PSGoper[i1].state = 2; + } + break; + case 2: /* sustain phase */ + if ((PSG.eg_cnt & ((1 << PSGoper[i1].eg_sh_d2r) - 1)) == 0) + { + PSGoper[i1].volume += eg_inc[PSGoper[i1].eg_sel_d2r + ((PSG.eg_cnt >> PSGoper[i1].eg_sh_d2r) & 7)]; + if (PSGoper[i1].volume >= 0x3ff) + { + PSGoper[i1].volume = 0x3ff; + PSGoper[i1].state = 0; + } + } + break; + case 1: /* release phase */ + if ((PSG.eg_cnt & ((1 << PSGoper[i1].eg_sh_rr) - 1)) == 0) + { + PSGoper[i1].volume += eg_inc[PSGoper[i1].eg_sel_rr + ((PSG.eg_cnt >> PSGoper[i1].eg_sh_rr) & 7)]; + if (PSGoper[i1].volume >= 0x3ff) + { + PSGoper[i1].volume = 0x3ff; + PSGoper[i1].state = 0; + } + } + break; + } + i1++; + i--; + } while (i != 0); + } + } + + //private static void advance_eg() + //{ + // uint i; + // int i1 = 0; + // PSG.eg_timer += PSG.eg_timer_add; + // while (PSG.eg_timer >= PSG.eg_timer_overflow) + // { + // PSG.eg_timer -= PSG.eg_timer_overflow; + // PSG.eg_cnt++; + // /* envelope generator */ + // //op = PSG.oper[i1]; /* CH 0 M1 */ + // i = 32; + // do + // { + // switch (PSG.oper[i1].state) + // { + // case 4: /* attack phase */ + // if ((PSG.eg_cnt & ((1 << PSG.oper[i1].eg_sh_ar) - 1)) == 0) + // { + // PSG.oper[i1].volume += (~PSG.oper[i1].volume * + // (eg_inc[PSG.oper[i1].eg_sel_ar + ((PSG.eg_cnt >> PSG.oper[i1].eg_sh_ar) & 7)]) + // ) >> 4; + + // if (PSG.oper[i1].volume <= 0) + // { + // PSG.oper[i1].volume = 0; + // PSG.oper[i1].state = 3; + // } + // } + // break; + // case 3: /* decay phase */ + // if ((PSG.eg_cnt & ((1 << PSG.oper[i1].eg_sh_d1r) - 1)) == 0) + // { + // PSG.oper[i1].volume += eg_inc[PSG.oper[i1].eg_sel_d1r + ((PSG.eg_cnt >> PSG.oper[i1].eg_sh_d1r) & 7)]; + // if (PSG.oper[i1].volume >= PSG.oper[i1].d1l) + // PSG.oper[i1].state = 2; + // } + // break; + // case 2: /* sustain phase */ + // if ((PSG.eg_cnt & ((1 << PSG.oper[i1].eg_sh_d2r) - 1)) == 0) + // { + // PSG.oper[i1].volume += eg_inc[PSG.oper[i1].eg_sel_d2r + ((PSG.eg_cnt >> PSG.oper[i1].eg_sh_d2r) & 7)]; + // if (PSG.oper[i1].volume >= 0x3ff) + // { + // PSG.oper[i1].volume = 0x3ff; + // PSG.oper[i1].state = 0; + // } + // } + // break; + // case 1: /* release phase */ + // if ((PSG.eg_cnt & ((1 << PSG.oper[i1].eg_sh_rr) - 1)) == 0) + // { + // PSG.oper[i1].volume += eg_inc[PSG.oper[i1].eg_sel_rr + ((PSG.eg_cnt >> PSG.oper[i1].eg_sh_rr) & 7)]; + // if (PSG.oper[i1].volume >= 0x3ff) + // { + // PSG.oper[i1].volume = 0x3ff; + // PSG.oper[i1].state = 0; + // } + // } + // break; + // } + // i1++; + // i--; + // } while (i != 0); + // } + //} + unsafe static void advance(YM2151Operator* PSGoper, uint* PSGfreq) + { + uint i; + int a, p; + /* LFO */ + if ((PSG.test & 2) != 0) + { + PSG.lfo_phase = 0; + } + else + { + PSG.lfo_timer += PSG.lfo_timer_add; + if (PSG.lfo_timer >= PSG.lfo_overflow) + { + PSG.lfo_timer -= PSG.lfo_overflow; + PSG.lfo_counter += PSG.lfo_counter_add; + PSG.lfo_phase += (PSG.lfo_counter >> 4); + PSG.lfo_phase &= 255; + PSG.lfo_counter &= 15; + } + } + i = PSG.lfo_phase; + /* calculate LFO AM and PM waveform value (all verified on real chip, except for noise algorithm which is impossible to analyse)*/ + switch (PSG.lfo_wsel) + { + case 0: + /* saw */ + /* AM: 255 down to 0 */ + /* PM: 0 to 127, -127 to 0 (at PMD=127: LFP = 0 to 126, -126 to 0) */ + a = (int)(255 - i); + if (i < 128) + p = (int)i; + else + p = (int)(i - 255); + break; + case 1: + /* square */ + /* AM: 255, 0 */ + /* PM: 128,-128 (LFP = exactly +PMD, -PMD) */ + if (i < 128) + { + a = 255; + p = 128; + } + else + { + a = 0; + p = -128; + } + break; + case 2: + /* triangle */ + /* AM: 255 down to 1 step -2; 0 up to 254 step +2 */ + /* PM: 0 to 126 step +2, 127 to 1 step -2, 0 to -126 step -2, -127 to -1 step +2*/ + if (i < 128) + a = (int)(255 - (i * 2)); + else + a = (int)((i * 2) - 256); + if (i < 64) /* i = 0..63 */ + p = (int)(i * 2); /* 0 to 126 step +2 */ + else if (i < 128) /* i = 64..127 */ + p = (int)(255 - i * 2); /* 127 to 1 step -2 */ + else if (i < 192) /* i = 128..191 */ + p = (int)(256 - i * 2); /* 0 to -126 step -2*/ + else /* i = 192..255 */ + p = (int)(i * 2 - 511); /*-127 to -1 step +2*/ + break; + case 3: + default: /*keep the compiler happy*/ + a = lfo_noise_waveform[i]; + p = a - 128; + break; + } + PSG.lfa = (uint)(a * PSG.amd / 128); + PSG.lfp = p * PSG.pmd / 128; + PSG.noise_p += PSG.noise_f; + i = (PSG.noise_p >> 16); /* number of events (shifts of the shift register) */ + PSG.noise_p &= 0xffff; + while (i != 0) + { + uint j; + j = ((PSG.noise_rng ^ (PSG.noise_rng >> 3)) & 1) ^ 1; + PSG.noise_rng = (j << 16) | (PSG.noise_rng >> 1); + i--; + } + /* phase generator */ + uint i1 = 0; + //op = PSGoper[i1]; /* CH 0 M1 */ + i = 8; + do + { + if (PSGoper[i1].pms != 0) /* only when phase modulation from LFO is enabled for this channel */ + { + int mod_ind = PSG.lfp; /* -128..+127 (8bits signed) */ + if (PSGoper[i1].pms < 6) + mod_ind >>= (int)(6 - PSGoper[i1].pms); + else + mod_ind <<= (int)(PSGoper[i1].pms - 5); + if (mod_ind != 0) + { + uint kc_channel = (uint)(PSGoper[i1].kc_i + mod_ind); + PSGoper[i1].phase += (uint)(((PSGfreq[kc_channel + PSGoper[i1].dt2] + PSGoper[i1].dt1) * PSGoper[i1].mul) >> 1); + PSGoper[i1 + 1].phase += (uint)(((PSGfreq[kc_channel + PSGoper[i1 + 1].dt2] + PSGoper[i1 + 1].dt1) * PSGoper[i1 + 1].mul) >> 1); + PSGoper[i1 + 2].phase += (uint)(((PSGfreq[kc_channel + PSGoper[i1 + 2].dt2] + PSGoper[i1 + 2].dt1) * PSGoper[i1 + 2].mul) >> 1); + PSGoper[i1 + 3].phase += (uint)(((PSGfreq[kc_channel + PSGoper[i1 + 3].dt2] + PSGoper[i1 + 3].dt1) * PSGoper[i1 + 3].mul) >> 1); + } + else /* phase modulation from LFO is equal to zero */ + { + PSGoper[i1].phase += PSGoper[i1].freq; + PSGoper[i1 + 1].phase += PSGoper[i1 + 1].freq; + PSGoper[i1 + 2].phase += PSGoper[i1 + 2].freq; + PSGoper[i1 + 3].phase += PSGoper[i1 + 3].freq; + } + } + else /* phase modulation from LFO is disabled */ + { + PSGoper[i1].phase += PSGoper[i1].freq; + PSGoper[i1 + 1].phase += PSGoper[i1 + 1].freq; + PSGoper[i1 + 2].phase += PSGoper[i1 + 2].freq; + PSGoper[i1 + 3].phase += PSGoper[i1 + 3].freq; + } + i1 += 4; + i--; + } while (i != 0); + if (PSG.csm_req != 0) /* CSM KEYON/KEYOFF seqeunce request */ + { + if (PSG.csm_req == 2) /* KEY ON */ + { + i1 = 0; + PSGoper[i1] = PSGoper[i1]; /* CH 0 M1 */ + i = 32; + do + { + KEY_ON(i1, 2); + i1++; + i--; + } while (i != 0); + PSG.csm_req = 1; + } + else /* KEY OFF */ + { + i1 = 0; + PSGoper[i1] = PSGoper[i1]; /* CH 0 M1 */ + i = 32; + do + { + KEY_OFF(i1, 0xfffffffe); + i1++; + i--; + } while (i != 0); + PSG.csm_req = 0; + } + } + } + //private static void advance() + //{ + // uint i; + // int a, p; + // /* LFO */ + // if ((PSG.test & 2) != 0) + // { + // PSG.lfo_phase = 0; + // } + // else + // { + // PSG.lfo_timer += PSG.lfo_timer_add; + // if (PSG.lfo_timer >= PSG.lfo_overflow) + // { + // PSG.lfo_timer -= PSG.lfo_overflow; + // PSG.lfo_counter += PSG.lfo_counter_add; + // PSG.lfo_phase += (PSG.lfo_counter >> 4); + // PSG.lfo_phase &= 255; + // PSG.lfo_counter &= 15; + // } + // } + // i = PSG.lfo_phase; + // /* calculate LFO AM and PM waveform value (all verified on real chip, except for noise algorithm which is impossible to analyse)*/ + // switch (PSG.lfo_wsel) + // { + // case 0: + // /* saw */ + // /* AM: 255 down to 0 */ + // /* PM: 0 to 127, -127 to 0 (at PMD=127: LFP = 0 to 126, -126 to 0) */ + // a = (int)(255 - i); + // if (i < 128) + // p = (int)i; + // else + // p = (int)(i - 255); + // break; + // case 1: + // /* square */ + // /* AM: 255, 0 */ + // /* PM: 128,-128 (LFP = exactly +PMD, -PMD) */ + // if (i < 128) + // { + // a = 255; + // p = 128; + // } + // else + // { + // a = 0; + // p = -128; + // } + // break; + // case 2: + // /* triangle */ + // /* AM: 255 down to 1 step -2; 0 up to 254 step +2 */ + // /* PM: 0 to 126 step +2, 127 to 1 step -2, 0 to -126 step -2, -127 to -1 step +2*/ + // if (i < 128) + // a = (int)(255 - (i * 2)); + // else + // a = (int)((i * 2) - 256); + // if (i < 64) /* i = 0..63 */ + // p = (int)(i * 2); /* 0 to 126 step +2 */ + // else if (i < 128) /* i = 64..127 */ + // p = (int)(255 - i * 2); /* 127 to 1 step -2 */ + // else if (i < 192) /* i = 128..191 */ + // p = (int)(256 - i * 2); /* 0 to -126 step -2*/ + // else /* i = 192..255 */ + // p = (int)(i * 2 - 511); /*-127 to -1 step +2*/ + // break; + // case 3: + // default: /*keep the compiler happy*/ + // a = lfo_noise_waveform[i]; + // p = a - 128; + // break; + // } + // PSG.lfa = (uint)(a * PSG.amd / 128); + // PSG.lfp = p * PSG.pmd / 128; + // PSG.noise_p += PSG.noise_f; + // i = (PSG.noise_p >> 16); /* number of events (shifts of the shift register) */ + // PSG.noise_p &= 0xffff; + // while (i != 0) + // { + // uint j; + // j = ((PSG.noise_rng ^ (PSG.noise_rng >> 3)) & 1) ^ 1; + // PSG.noise_rng = (j << 16) | (PSG.noise_rng >> 1); + // i--; + // } + // /* phase generator */ + // uint i1 = 0; + // //op = PSG.oper[i1]; /* CH 0 M1 */ + // i = 8; + // do + // { + // if (PSG.oper[i1].pms != 0) /* only when phase modulation from LFO is enabled for this channel */ + // { + // int mod_ind = PSG.lfp; /* -128..+127 (8bits signed) */ + // if (PSG.oper[i1].pms < 6) + // mod_ind >>= (int)(6 - PSG.oper[i1].pms); + // else + // mod_ind <<= (int)(PSG.oper[i1].pms - 5); + // if (mod_ind != 0) + // { + // uint kc_channel = (uint)(PSG.oper[i1].kc_i + mod_ind); + // PSG.oper[i1].phase += (uint)(((PSG.freq[kc_channel + PSG.oper[i1].dt2] + PSG.oper[i1].dt1) * PSG.oper[i1].mul) >> 1); + // PSG.oper[i1 + 1].phase += (uint)(((PSG.freq[kc_channel + PSG.oper[i1 + 1].dt2] + PSG.oper[i1 + 1].dt1) * PSG.oper[i1 + 1].mul) >> 1); + // PSG.oper[i1 + 2].phase += (uint)(((PSG.freq[kc_channel + PSG.oper[i1 + 2].dt2] + PSG.oper[i1 + 2].dt1) * PSG.oper[i1 + 2].mul) >> 1); + // PSG.oper[i1 + 3].phase += (uint)(((PSG.freq[kc_channel + PSG.oper[i1 + 3].dt2] + PSG.oper[i1 + 3].dt1) * PSG.oper[i1 + 3].mul) >> 1); + // } + // else /* phase modulation from LFO is equal to zero */ + // { + // PSG.oper[i1].phase += PSG.oper[i1].freq; + // PSG.oper[i1 + 1].phase += PSG.oper[i1 + 1].freq; + // PSG.oper[i1 + 2].phase += PSG.oper[i1 + 2].freq; + // PSG.oper[i1 + 3].phase += PSG.oper[i1 + 3].freq; + // } + // } + // else /* phase modulation from LFO is disabled */ + // { + // PSG.oper[i1].phase += PSG.oper[i1].freq; + // PSG.oper[i1 + 1].phase += PSG.oper[i1 + 1].freq; + // PSG.oper[i1 + 2].phase += PSG.oper[i1 + 2].freq; + // PSG.oper[i1 + 3].phase += PSG.oper[i1 + 3].freq; + // } + // i1 += 4; + // i--; + // } while (i != 0); + // if (PSG.csm_req != 0) /* CSM KEYON/KEYOFF seqeunce request */ + // { + // if (PSG.csm_req == 2) /* KEY ON */ + // { + // i1 = 0; + // PSG.oper[i1] = PSG.oper[i1]; /* CH 0 M1 */ + // i = 32; + // do + // { + // KEY_ON(i1, 2); + // i1++; + // i--; + // } while (i != 0); + // PSG.csm_req = 1; + // } + // else /* KEY OFF */ + // { + // i1 = 0; + // PSG.oper[i1] = PSG.oper[i1]; /* CH 0 M1 */ + // i = 32; + // do + // { + // KEY_OFF(i1, 0xfffffffe); + // i1++; + // i--; + // } while (i != 0); + // PSG.csm_req = 0; + // } + // } + //} + + static bool skiprun_update_one; + static int run_update_one_Index; + public unsafe static void ym2151_update_one(int offset, int length) + { + fixed (uint* PSGpanPtr = &PSG.pan[0]) + fixed (uint* PSGfreqPtr = &PSG.freq[0]) + fixed (YM2151Operator* PSGoperPtr = &PSG.oper[0]) + fixed (int* chanoutPtr = &chanout[0]) + //fixed (int* streamoutput0Ptr = &Sound.ym2151stream.streamoutput_Ptrs[0][0]) + //fixed (int* streamoutput1Ptr = &Sound.ym2151stream.streamoutput_Ptrs[0][1]) + fixed (int* imemPtr = &imem[0]) + { + YM2151Operator* PSGoper = PSGoperPtr; + uint* PSGpan = PSGpanPtr; + uint* PSGfreq = PSGfreqPtr; + int* chanout = chanoutPtr; + //int* streamoutput0 = streamoutput0Ptr; + //int* streamoutput1 = streamoutput1Ptr; + int* streamoutput0 = &Sound.ym2151stream.streamoutput_Ptrs[0][0]; + int* streamoutput1 = &Sound.ym2151stream.streamoutput_Ptrs[0][1]; + int* imem = imemPtr; + + int i; + int outl, outr; + for (i = 0; i < length; i++) + { + advance_eg(PSGoper); + chanout[0] = 0; + chanout[1] = 0; + chanout[2] = 0; + chanout[3] = 0; + chanout[4] = 0; + chanout[5] = 0; + chanout[6] = 0; + chanout[7] = 0; + + //二分交替混音 + //skiprun_update_one = !skiprun_update_one; + //if (!skiprun_update_one) + //{ + // chan_calc(PSGoper, chanout, imem, 0); + // chan_calc(PSGoper, chanout, imem, 2); + // chan_calc(PSGoper, chanout, imem, 4); + // chan_calc(PSGoper, chanout, imem, 6); + //} + //else + //{ + // chan_calc(PSGoper, chanout, imem, 1); + // chan_calc(PSGoper, chanout, imem, 3); + // chan_calc(PSGoper, chanout, imem, 5); + // chan7_calc(PSGoper, chanout, imem); + //} + + //三分交替混音 + //run_update_one_Index++; + //if (run_update_one_Index > 2) + // run_update_one_Index = 0; + //switch (run_update_one_Index) + //{ + // case 0: + // chan_calc(PSGoper, chanout, imem, 0); + // chan_calc(PSGoper, chanout, imem, 2); + // chan_calc(PSGoper, chanout, imem, 4); + // break; + // case 1: + // chan_calc(PSGoper, chanout, imem, 1); + // chan_calc(PSGoper, chanout, imem, 3); + // chan7_calc(PSGoper, chanout, imem); + // break; + // case 2: + // chan_calc(PSGoper, chanout, imem, 0); + // chan_calc(PSGoper, chanout, imem, 5); + // chan_calc(PSGoper, chanout, imem, 6); + // break; + //} + + //完全渲染混音 + chan_calc(PSGoper, chanout, imem, 0); + chan_calc(PSGoper, chanout, imem, 1); + chan_calc(PSGoper, chanout, imem, 2); + chan_calc(PSGoper, chanout, imem, 3); + chan_calc(PSGoper, chanout, imem, 4); + chan_calc(PSGoper, chanout, imem, 5); + chan_calc(PSGoper, chanout, imem, 6); + chan7_calc(PSGoper, chanout, imem); + + outl = (int)(chanout[0] & PSGpan[0]); + outr = (int)(chanout[0] & PSGpan[1]); + outl += (int)(chanout[1] & PSGpan[2]); + outr += (int)(chanout[1] & PSGpan[3]); + outl += (int)(chanout[2] & PSGpan[4]); + outr += (int)(chanout[2] & PSGpan[5]); + outl += (int)(chanout[3] & PSGpan[6]); + outr += (int)(chanout[3] & PSGpan[7]); + outl += (int)(chanout[4] & PSGpan[8]); + outr += (int)(chanout[4] & PSGpan[9]); + outl += (int)(chanout[5] & PSGpan[10]); + outr += (int)(chanout[5] & PSGpan[11]); + outl += (int)(chanout[6] & PSGpan[12]); + outr += (int)(chanout[6] & PSGpan[13]); + outl += (int)(chanout[7] & PSGpan[14]); + outr += (int)(chanout[7] & PSGpan[15]); + if (outl > 32767) + { + outl = 32767; + } + else if (outl < -32768) + { + outl = -32768; + } + if (outr > 32767) + { + outr = 32767; + } + else if (outr < -32768) + { + outr = -32768; + } + streamoutput0[offset + i] = outl; + streamoutput1[offset + i] = outr; + advance(PSGoper, PSGfreq); + } + } + } + //public static void ym2151_update_one(int offset, int length) + //{ + // int i; + // int outl, outr; + // for (i = 0; i < length; i++) + // { + // advance_eg(); + // chanout[0] = 0; + // chanout[1] = 0; + // chanout[2] = 0; + // chanout[3] = 0; + // chanout[4] = 0; + // chanout[5] = 0; + // chanout[6] = 0; + // chanout[7] = 0; + // chan_calc(0); + // chan_calc(1); + // chan_calc(2); + // chan_calc(3); + // chan_calc(4); + // chan_calc(5); + // chan_calc(6); + // chan7_calc(); + // outl = (int)(chanout[0] & PSG.pan[0]); + // outr = (int)(chanout[0] & PSG.pan[1]); + // outl += (int)(chanout[1] & PSG.pan[2]); + // outr += (int)(chanout[1] & PSG.pan[3]); + // outl += (int)(chanout[2] & PSG.pan[4]); + // outr += (int)(chanout[2] & PSG.pan[5]); + // outl += (int)(chanout[3] & PSG.pan[6]); + // outr += (int)(chanout[3] & PSG.pan[7]); + // outl += (int)(chanout[4] & PSG.pan[8]); + // outr += (int)(chanout[4] & PSG.pan[9]); + // outl += (int)(chanout[5] & PSG.pan[10]); + // outr += (int)(chanout[5] & PSG.pan[11]); + // outl += (int)(chanout[6] & PSG.pan[12]); + // outr += (int)(chanout[6] & PSG.pan[13]); + // outl += (int)(chanout[7] & PSG.pan[14]); + // outr += (int)(chanout[7] & PSG.pan[15]); + // if (outl > 32767) + // { + // outl = 32767; + // } + // else if (outl < -32768) + // { + // outl = -32768; + // } + // if (outr > 32767) + // { + // outr = 32767; + // } + // else if (outr < -32768) + // { + // outr = -32768; + // } + // Sound.ym2151stream.streamoutput_Ptrs[0][offset + i] = outl; + // Sound.ym2151stream.streamoutput_Ptrs[1][offset + i] = outr; + // advance(); + // } + //} + public static byte ym2151_status_port_0_r() + { + Sound.ym2151stream.stream_update(); + return (byte)PSG.status; + } + public static void ym2151_register_port_0_w(byte data) + { + PSG.lastreg0 = data; + } + public static void ym2151_data_port_0_w(byte data) + { + Sound.ym2151stream.stream_update(); + ym2151_write_reg(PSG.lastreg0, data); + } + + unsafe static void set_value1(int* chanout, YM2151Operator* PSGoper, int op1) + { + if (iconnect[op1] == 12) + { + chanout[9] = chanout[10] = chanout[11] = PSGoper[op1].fb_out_prev; + } + else + { + chanout[iconnect[op1]] = PSGoper[op1].fb_out_prev; + } + } + //private static void set_value1(int op1) + //{ + // if (iconnect[op1] == 12) + // { + // chanout[9] = chanout[10] = chanout[11] = PSG.oper[op1].fb_out_prev; + // } + // else + // { + // chanout[iconnect[op1]] = PSG.oper[op1].fb_out_prev; + // } + //} + unsafe static void set_value2(int* chanout, int op1, int i) + { + if (iconnect[op1] == 12) + { + return; + } + else + { + chanout[iconnect[op1]] += i; + } + } + + //private static void set_value2(int op1, int i) + //{ + // if (iconnect[op1] == 12) + // { + // return; + // } + // else + // { + // chanout[iconnect[op1]] += i; + // } + //} + unsafe static void set_mem(YM2151Operator* PSGoper, int* chanout, int* imem, int op1) + { + if (imem[op1] == 8 || imem[op1] == 10 || imem[op1] == 11) + { + chanout[imem[op1]] = PSGoper[op1].mem_value; + } + } + //private static void set_mem(int op1) + //{ + // if (imem[op1] == 8 || imem[op1] == 10 || imem[op1] == 11) + // { + // chanout[imem[op1]] = PSG.oper[op1].mem_value; + // } + //} + public static void SaveStateBinary(BinaryWriter writer) + { + int i; + for (i = 0; i < 32; i++) + { + writer.Write(PSG.oper[i].phase); + writer.Write(PSG.oper[i].freq); + writer.Write(PSG.oper[i].dt1); + writer.Write(PSG.oper[i].mul); + writer.Write(PSG.oper[i].dt1_i); + writer.Write(PSG.oper[i].dt2); + writer.Write(PSG.oper[i].mem_value); + writer.Write(PSG.oper[i].fb_shift); + writer.Write(PSG.oper[i].fb_out_curr); + writer.Write(PSG.oper[i].fb_out_prev); + writer.Write(PSG.oper[i].kc); + writer.Write(PSG.oper[i].kc_i); + writer.Write(PSG.oper[i].pms); + writer.Write(PSG.oper[i].ams); + writer.Write(PSG.oper[i].AMmask); + writer.Write(PSG.oper[i].state); + writer.Write(PSG.oper[i].eg_sh_ar); + writer.Write(PSG.oper[i].eg_sel_ar); + writer.Write(PSG.oper[i].tl); + writer.Write(PSG.oper[i].volume); + writer.Write(PSG.oper[i].eg_sh_d1r); + writer.Write(PSG.oper[i].eg_sel_d1r); + writer.Write(PSG.oper[i].d1l); + writer.Write(PSG.oper[i].eg_sh_d2r); + writer.Write(PSG.oper[i].eg_sel_d2r); + writer.Write(PSG.oper[i].eg_sh_rr); + writer.Write(PSG.oper[i].eg_sel_rr); + writer.Write(PSG.oper[i].key); + writer.Write(PSG.oper[i].ks); + writer.Write(PSG.oper[i].ar); + writer.Write(PSG.oper[i].d1r); + writer.Write(PSG.oper[i].d2r); + writer.Write(PSG.oper[i].rr); + writer.Write(PSG.oper[i].reserved0); + writer.Write(PSG.oper[i].reserved1); + } + for (i = 0; i < 16; i++) + { + writer.Write(PSG.pan[i]); + } + writer.Write(PSG.lastreg0); + writer.Write(PSG.eg_cnt); + writer.Write(PSG.eg_timer); + writer.Write(PSG.eg_timer_add); + writer.Write(PSG.eg_timer_overflow); + writer.Write(PSG.lfo_phase); + writer.Write(PSG.lfo_timer); + writer.Write(PSG.lfo_timer_add); + writer.Write(PSG.lfo_overflow); + writer.Write(PSG.lfo_counter); + writer.Write(PSG.lfo_counter_add); + writer.Write(PSG.lfo_wsel); + writer.Write(PSG.amd); + writer.Write(PSG.pmd); + writer.Write(PSG.lfa); + writer.Write(PSG.lfp); + writer.Write(PSG.test); + writer.Write(PSG.ct); + writer.Write(PSG.noise); + writer.Write(PSG.noise_rng); + writer.Write(PSG.noise_p); + writer.Write(PSG.noise_f); + writer.Write(PSG.csm_req); + writer.Write(PSG.irq_enable); + writer.Write(PSG.status); + writer.Write(PSG.timer_A_index); + writer.Write(PSG.timer_B_index); + writer.Write(PSG.timer_A_index_old); + writer.Write(PSG.timer_B_index_old); + writer.Write(PSG.irqlinestate); + writer.Write(PSG.connect); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i; + for (i = 0; i < 32; i++) + { + PSG.oper[i].phase = reader.ReadUInt32(); + PSG.oper[i].freq = reader.ReadUInt32(); + PSG.oper[i].dt1 = reader.ReadInt32(); + PSG.oper[i].mul = reader.ReadUInt32(); + PSG.oper[i].dt1_i = reader.ReadUInt32(); + PSG.oper[i].dt2 = reader.ReadUInt32(); + PSG.oper[i].mem_value = reader.ReadInt32(); + PSG.oper[i].fb_shift = reader.ReadUInt32(); + PSG.oper[i].fb_out_curr = reader.ReadInt32(); + PSG.oper[i].fb_out_prev = reader.ReadInt32(); + PSG.oper[i].kc = reader.ReadUInt32(); + PSG.oper[i].kc_i = reader.ReadUInt32(); + PSG.oper[i].pms = reader.ReadUInt32(); + PSG.oper[i].ams = reader.ReadUInt32(); + PSG.oper[i].AMmask = reader.ReadUInt32(); + PSG.oper[i].state = reader.ReadUInt32(); + PSG.oper[i].eg_sh_ar = reader.ReadByte(); + PSG.oper[i].eg_sel_ar = reader.ReadByte(); + PSG.oper[i].tl = reader.ReadUInt32(); + PSG.oper[i].volume = reader.ReadInt32(); + PSG.oper[i].eg_sh_d1r = reader.ReadByte(); + PSG.oper[i].eg_sel_d1r = reader.ReadByte(); + PSG.oper[i].d1l = reader.ReadUInt32(); + PSG.oper[i].eg_sh_d2r = reader.ReadByte(); + PSG.oper[i].eg_sel_d2r = reader.ReadByte(); + PSG.oper[i].eg_sh_rr = reader.ReadByte(); + PSG.oper[i].eg_sel_rr = reader.ReadByte(); + PSG.oper[i].key = reader.ReadUInt32(); + PSG.oper[i].ks = reader.ReadUInt32(); + PSG.oper[i].ar = reader.ReadUInt32(); + PSG.oper[i].d1r = reader.ReadUInt32(); + PSG.oper[i].d2r = reader.ReadUInt32(); + PSG.oper[i].rr = reader.ReadUInt32(); + PSG.oper[i].reserved0 = reader.ReadUInt32(); + PSG.oper[i].reserved1 = reader.ReadUInt32(); + } + for (i = 0; i < 16; i++) + { + PSG.pan[i] = reader.ReadUInt32(); + } + PSG.lastreg0 = reader.ReadInt32(); + PSG.eg_cnt = reader.ReadUInt32(); + PSG.eg_timer = reader.ReadUInt32(); + PSG.eg_timer_add = reader.ReadUInt32(); + PSG.eg_timer_overflow = reader.ReadUInt32(); + PSG.lfo_phase = reader.ReadUInt32(); + PSG.lfo_timer = reader.ReadUInt32(); + PSG.lfo_timer_add = reader.ReadUInt32(); + PSG.lfo_overflow = reader.ReadUInt32(); + PSG.lfo_counter = reader.ReadUInt32(); + PSG.lfo_counter_add = reader.ReadUInt32(); + PSG.lfo_wsel = reader.ReadByte(); + PSG.amd = reader.ReadByte(); + PSG.pmd = reader.ReadSByte(); + PSG.lfa = reader.ReadUInt32(); + PSG.lfp = reader.ReadInt32(); + PSG.test = reader.ReadByte(); + PSG.ct = reader.ReadByte(); + PSG.noise = reader.ReadUInt32(); + PSG.noise_rng = reader.ReadUInt32(); + PSG.noise_p = reader.ReadUInt32(); + PSG.noise_f = reader.ReadUInt32(); + PSG.csm_req = reader.ReadUInt32(); + PSG.irq_enable = reader.ReadUInt32(); + PSG.status = reader.ReadUInt32(); + PSG.timer_A_index = reader.ReadUInt32(); + PSG.timer_B_index = reader.ReadUInt32(); + PSG.timer_A_index_old = reader.ReadUInt32(); + PSG.timer_B_index_old = reader.ReadUInt32(); + PSG.irqlinestate = reader.ReadInt32(); + PSG.connect = reader.ReadBytes(8); + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2151.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2151.cs.meta new file mode 100644 index 00000000..a8655dde --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2151.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05cbabac2b71ffd4593755c654772ee0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2203.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2203.cs new file mode 100644 index 00000000..7b1478b2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2203.cs @@ -0,0 +1,535 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class YM2203 + { + public byte[] REGS; + public FM.FM_OPN OPN; + public sound_stream stream; + public static YM2203[] FF2203 = new YM2203[2]; + public EmuTimer.emu_timer[] timer; + public static void timer_callback_2203_0_0() + { + FF2203[0].ym2203_timer_over(0); + } + public static void timer_callback_2203_0_1() + { + FF2203[0].ym2203_timer_over(1); + } + public static void timer_callback_2203_1_0() + { + FF2203[1].ym2203_timer_over(0); + } + public static void timer_callback_2203_1_1() + { + FF2203[1].ym2203_timer_over(1); + } + public void timer_handler(int c, int count, int clock) + { + if (count == 0) + { + EmuTimer.timer_enable(timer[c], false); + } + else + { + Atime period = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / clock), (uint)count); + if (!EmuTimer.timer_enable(timer[c], true)) + { + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + } + } + } + public static void ym2203_init(int sndindex, int clock, int rate) + { + FM.FM_init(); + FF2203[sndindex].OPN = new FM.FM_OPN(); + FF2203[sndindex].REGS = new byte[256]; + FF2203[sndindex].OPN.type = FM.TYPE_YM2203; + FF2203[sndindex].OPN.ST.clock = clock; + FF2203[sndindex].OPN.ST.rate = rate; + FF2203[sndindex].OPN.ST.timer_handler = FF2203[sndindex].timer_handler; + switch (Machine.sBoard) + { + case "Data East": + switch (Machine.sName) + { + case "pcktgal": + case "pcktgalb": + case "pcktgal2": + case "pcktgal2j": + case "spool3": + case "spool3i": + FF2203[sndindex].OPN.ST.IRQ_Handler = Dataeast.irqhandler; + FF2203[sndindex].OPN.ST.SSG.set_clock = AY8910.AA8910[sndindex].ay8910_set_clock_ym; + FF2203[sndindex].OPN.ST.SSG.write = AY8910.AA8910[sndindex].ay8910_write_ym; + FF2203[sndindex].OPN.ST.SSG.read = AY8910.AA8910[sndindex].ay8910_read_ym; + FF2203[sndindex].OPN.ST.SSG.reset = AY8910.AA8910[sndindex].ay8910_reset_ym; + break; + } + break; + case "Taito": + switch (Machine.sName) + { + case "tokio": + case "tokioo": + case "tokiou": + case "tokiob": + case "bublbobl": + case "bublbobl1": + case "bublboblr": + case "bublboblr1": + case "boblbobl": + case "sboblbobl": + case "sboblbobla": + case "sboblboblb": + case "sboblbobld": + case "sboblboblc": + case "bub68705": + case "dland": + case "bbredux": + case "bublboblb": + case "bublcave": + case "boblcave": + case "bublcave11": + case "bublcave10": + FF2203[sndindex].OPN.ST.IRQ_Handler = Taito.irqhandler; + FF2203[sndindex].OPN.ST.SSG.set_clock = AY8910.AA8910[sndindex].ay8910_set_clock_ym; + FF2203[sndindex].OPN.ST.SSG.write = AY8910.AA8910[sndindex].ay8910_write_ym; + FF2203[sndindex].OPN.ST.SSG.read = AY8910.AA8910[sndindex].ay8910_read_ym; + FF2203[sndindex].OPN.ST.SSG.reset = AY8910.AA8910[sndindex].ay8910_reset_ym; + break; + } + break; + case "Capcom": + switch (Machine.sName) + { + case "gng": + case "gnga": + case "gngbl": + case "gngprot": + case "gngblita": + case "gngc": + case "gngt": + case "makaimur": + case "makaimurc": + case "makaimurg": + case "diamond": + FF2203[sndindex].OPN.ST.IRQ_Handler = null; + FF2203[sndindex].OPN.ST.SSG.set_clock = AY8910.AA8910[sndindex].ay8910_set_clock_ym; + FF2203[sndindex].OPN.ST.SSG.write = AY8910.AA8910[sndindex].ay8910_write_ym; + FF2203[sndindex].OPN.ST.SSG.read = AY8910.AA8910[sndindex].ay8910_read_ym; + FF2203[sndindex].OPN.ST.SSG.reset = AY8910.AA8910[sndindex].ay8910_reset_ym; + break; + } + break; + } + YM2203.FF2203[sndindex].ym2203_reset_chip(); + } + public static void ym2203_start(int sndindex, int clock) + { + FF2203[sndindex] = new YM2203(); + AY8910.ay8910_interface generic_2203 = new AY8910.ay8910_interface(); + generic_2203.flags = 1; + generic_2203.res_load = new int[3] { 1000, 1000, 1000 }; + generic_2203.portAread = null; + generic_2203.portBread = null; + generic_2203.portAwrite = null; + generic_2203.portBwrite = null; + FMOpl.tl_tab = new int[0x1800]; + FMOpl.sin_tab = new uint[0x1000]; + int rate = clock / 72; + AY8910.ay8910_start_ym(14, sndindex, clock, generic_2203); + FF2203[sndindex].timer = new EmuTimer.emu_timer[2]; + if (sndindex == 0) + { + FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_0_0, false); + FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_0_1, false); + } + else if (sndindex == 1) + { + FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_1_0, false); + FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_1_1, false); + } + FF2203[sndindex].stream = new sound_stream(rate, 0, 1, FF2203[sndindex].ym2203_update_one); + ym2203_init(sndindex, clock, rate); + } + public static byte ym2203_status_port_0_r() + { + return FF2203[0].ym2203_read(0, 0); + } + public static byte ym2203_read_port_0_r() + { + return FF2203[0].ym2203_read(0, 1); + } + public static void ym2203_control_port_0_w(byte data) + { + FF2203[0].ym2203_write(0, data); + } + public static void ym2203_control_port_1_w(byte data) + { + FF2203[1].ym2203_write(0, data); + } + public static void ym2203_write_port_0_w(byte data) + { + FF2203[0].ym2203_write(1, data); + } + public static void ym2203_write_port_1_w(byte data) + { + FF2203[1].ym2203_write(1, data); + } + public void ym2203_write(int a, byte v) + { + if ((a & 1) == 0) + { + OPN.ST.address = (v &= 0xff); + if (v < 16) + { + OPN.ST.SSG.write(0, v); + } + if (v >= 0x2d && v <= 0x2f) + { + OPN.OPNPrescaler_w(v, 1); + } + } + else + { + int addr = OPN.ST.address; + REGS[addr] = v; + switch (addr & 0xf0) + { + case 0x00: + OPN.ST.SSG.write(a, v); + break; + case 0x20: + stream.stream_update(); + OPN.OPNWriteMode(addr, v); + break; + default: + stream.stream_update(); + OPN.OPNWriteReg(addr, v); + break; + } + OPN.FM_BUSY_SET(1); + } + } + public byte ym2203_read(int chip, int a) + { + int addr = OPN.ST.address; + byte ret = 0; + if ((a & 1) == 0) + { + ret = OPN.FM_STATUS_FLAG(); + } + else + { + if (addr < 16) + { + ret = OPN.ST.SSG.read(); + } + } + return ret; + } + public void ym2203_update_one(int offset, int length) + { + int i; + OPN.refresh_fc_eg_chan(OPN.type, 0); + OPN.refresh_fc_eg_chan(OPN.type, 1); + if ((OPN.ST.mode & 0xc0) != 0) + { + if (OPN.CH[2].SLOT[0].Incr == -1) + { + OPN.refresh_fc_eg_slot(OPN.type, 2, 0, (int)OPN.SL3.fc[1], OPN.SL3.kcode[1]); + OPN.refresh_fc_eg_slot(OPN.type, 2, 2, (int)OPN.SL3.fc[2], OPN.SL3.kcode[2]); + OPN.refresh_fc_eg_slot(OPN.type, 2, 1, (int)OPN.SL3.fc[0], OPN.SL3.kcode[0]); + OPN.refresh_fc_eg_slot(OPN.type, 2, 3, (int)OPN.CH[2].fc, OPN.CH[2].kcode); + } + } + else + { + OPN.refresh_fc_eg_chan(OPN.type, 2); + } + FM.LFO_AM = 0; + FM.LFO_PM = 0; + for (i = 0; i < length; i++) + { + FM.out_fm[0] = 0; + FM.out_fm[1] = 0; + FM.out_fm[2] = 0; + OPN.eg_timer += OPN.eg_timer_add; + while (OPN.eg_timer >= OPN.eg_timer_overflow) + { + OPN.eg_timer -= OPN.eg_timer_overflow; + OPN.eg_cnt++; + OPN.advance_eg_channel(0); + OPN.advance_eg_channel(1); + OPN.advance_eg_channel(2); + } + OPN.chan_calc(0, 0); + OPN.chan_calc(1, 1); + OPN.chan_calc(2, 2); + { + int lt; + lt = FM.out_fm[0] + FM.out_fm[1] + FM.out_fm[2]; + lt >>= 0; + lt = FM.Limit(lt, 32767, -32768); + stream.streamoutput_Ptrs[0][offset + i] = lt; + } + } + } + public int ym2203_timer_over(int c) + { + if (c != 0) + { + OPN.TimerBOver(); + } + else + { + stream.stream_update(); + OPN.TimerAOver(); + if ((OPN.ST.mode & 0x80) != 0) + { + OPN.CSMKeyControll(); + } + } + return OPN.ST.irq; + } + public void ym2203_reset_chip() + { + int i; + OPN.OPNPrescaler_w(0, 1); + OPN.ST.SSG.reset(); + OPN.FM_IRQMASK_SET(0x03); + OPN.FM_BUSY_CLEAR(); + OPN.OPNWriteMode(0x27, 0x30); + OPN.eg_timer = 0; + OPN.eg_cnt = 0; + OPN.FM_STATUS_RESET(0xff); + OPN.reset_channels(3); + for (i = 0xb2; i >= 0x30; i--) + { + OPN.OPNWriteReg(i, 0); + } + for (i = 0x26; i >= 0x20; i--) + { + OPN.OPNWriteReg(i, 0); + } + } + public void ym2203_postload() + { + int r; + OPN.OPNPrescaler_w(1, 1); + for (r = 0; r < 16; r++) + { + OPN.ST.SSG.write(0, (byte)r); + OPN.ST.SSG.write(1, REGS[r]); + } + for (r = 0x30; r < 0x9e; r++) + { + if ((r & 3) != 3) + { + OPN.OPNWriteReg(r, REGS[r]); + } + } + for (r = 0xb0; r < 0xb6; r++) + { + if ((r & 3) != 3) + { + OPN.OPNWriteReg(r, REGS[r]); + } + } + } + public void SaveStateBinary(BinaryWriter writer) + { + int i, j; + writer.Write(REGS, 0, 256); + writer.Write(OPN.ST.freqbase); + writer.Write(OPN.ST.timer_prescaler); + writer.Write(OPN.ST.busy_expiry_time.seconds); + writer.Write(OPN.ST.busy_expiry_time.attoseconds); + writer.Write(OPN.ST.address); + writer.Write(OPN.ST.irq); + writer.Write(OPN.ST.irqmask); + writer.Write(OPN.ST.status); + writer.Write(OPN.ST.mode); + writer.Write(OPN.ST.prescaler_sel); + writer.Write(OPN.ST.fn_h); + writer.Write(OPN.ST.TA); + writer.Write(OPN.ST.TAC); + writer.Write(OPN.ST.TB); + writer.Write(OPN.ST.TBC); + for (i = 0; i < 12; i++) + { + writer.Write(OPN.pan[i]); + } + writer.Write(OPN.eg_cnt); + writer.Write(OPN.eg_timer); + writer.Write(OPN.eg_timer_add); + writer.Write(OPN.eg_timer_overflow); + writer.Write(OPN.lfo_cnt); + writer.Write(OPN.lfo_inc); + for (i = 0; i < 8; i++) + { + writer.Write(OPN.lfo_freq[i]); + } + for (i = 0; i < 6; i++) + { + for (j = 0; j < 4; j++) + { + writer.Write(OPN.CH[i].SLOT[j].KSR); + writer.Write(OPN.CH[i].SLOT[j].ar); + writer.Write(OPN.CH[i].SLOT[j].d1r); + writer.Write(OPN.CH[i].SLOT[j].d2r); + writer.Write(OPN.CH[i].SLOT[j].rr); + writer.Write(OPN.CH[i].SLOT[j].ksr); + writer.Write(OPN.CH[i].SLOT[j].mul); + writer.Write(OPN.CH[i].SLOT[j].phase); + writer.Write(OPN.CH[i].SLOT[j].Incr); + writer.Write(OPN.CH[i].SLOT[j].state); + writer.Write(OPN.CH[i].SLOT[j].tl); + writer.Write(OPN.CH[i].SLOT[j].volume); + writer.Write(OPN.CH[i].SLOT[j].sl); + writer.Write(OPN.CH[i].SLOT[j].vol_out); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_ar); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_ar); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_d1r); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_d1r); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_d2r); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_d2r); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_rr); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_rr); + writer.Write(OPN.CH[i].SLOT[j].ssg); + writer.Write(OPN.CH[i].SLOT[j].ssgn); + writer.Write(OPN.CH[i].SLOT[j].key); + writer.Write(OPN.CH[i].SLOT[j].AMmask); + } + } + for (i = 0; i < 3; i++) + { + writer.Write(OPN.CH[i].ALGO); + writer.Write(OPN.CH[i].FB); + writer.Write(OPN.CH[i].op1_out0); + writer.Write(OPN.CH[i].op1_out1); + writer.Write(OPN.CH[i].mem_value); + writer.Write(OPN.CH[i].pms); + writer.Write(OPN.CH[i].ams); + writer.Write(OPN.CH[i].fc); + writer.Write(OPN.CH[i].kcode); + writer.Write(OPN.CH[i].block_fnum); + } + for (i = 0; i < 3; i++) + { + writer.Write(OPN.SL3.fc[i]); + } + writer.Write(OPN.SL3.fn_h); + writer.Write(OPN.SL3.kcode, 0, 3); + for (i = 0; i < 3; i++) + { + writer.Write(OPN.SL3.block_fnum[i]); + } + writer.Write(YMDeltat.DELTAT.portstate); + writer.Write(YMDeltat.DELTAT.now_addr); + writer.Write(YMDeltat.DELTAT.now_step); + writer.Write(YMDeltat.DELTAT.acc); + writer.Write(YMDeltat.DELTAT.prev_acc); + writer.Write(YMDeltat.DELTAT.adpcmd); + writer.Write(YMDeltat.DELTAT.adpcml); + } + public void LoadStateBinary(BinaryReader reader) + { + int i, j; + REGS = reader.ReadBytes(256); + OPN.ST.freqbase = reader.ReadDouble(); + OPN.ST.timer_prescaler = reader.ReadInt32(); + OPN.ST.busy_expiry_time.seconds = reader.ReadInt32(); + OPN.ST.busy_expiry_time.attoseconds = reader.ReadInt64(); + OPN.ST.address = reader.ReadByte(); + OPN.ST.irq = reader.ReadByte(); + OPN.ST.irqmask = reader.ReadByte(); + OPN.ST.status = reader.ReadByte(); + OPN.ST.mode = reader.ReadByte(); + OPN.ST.prescaler_sel = reader.ReadByte(); + OPN.ST.fn_h = reader.ReadByte(); + OPN.ST.TA = reader.ReadInt32(); + OPN.ST.TAC = reader.ReadInt32(); + OPN.ST.TB = reader.ReadByte(); + OPN.ST.TBC = reader.ReadInt32(); + for (i = 0; i < 12; i++) + { + OPN.pan[i] = reader.ReadUInt32(); + } + OPN.eg_cnt = reader.ReadUInt32(); + OPN.eg_timer = reader.ReadUInt32(); + OPN.eg_timer_add = reader.ReadUInt32(); + OPN.eg_timer_overflow = reader.ReadUInt32(); + OPN.lfo_cnt = reader.ReadInt32(); + OPN.lfo_inc = reader.ReadInt32(); + for (i = 0; i < 8; i++) + { + OPN.lfo_freq[i] = reader.ReadInt32(); + } + for (i = 0; i < 6; i++) + { + for (j = 0; j < 4; j++) + { + OPN.CH[i].SLOT[j].KSR = reader.ReadByte(); + OPN.CH[i].SLOT[j].ar = reader.ReadInt32(); + OPN.CH[i].SLOT[j].d1r = reader.ReadInt32(); + OPN.CH[i].SLOT[j].d2r = reader.ReadInt32(); + OPN.CH[i].SLOT[j].rr = reader.ReadInt32(); + OPN.CH[i].SLOT[j].ksr = reader.ReadByte(); + OPN.CH[i].SLOT[j].mul = reader.ReadInt32(); + OPN.CH[i].SLOT[j].phase = reader.ReadUInt32(); + OPN.CH[i].SLOT[j].Incr = reader.ReadInt32(); + OPN.CH[i].SLOT[j].state = reader.ReadByte(); + OPN.CH[i].SLOT[j].tl = reader.ReadInt32(); + OPN.CH[i].SLOT[j].volume = reader.ReadInt32(); + OPN.CH[i].SLOT[j].sl = reader.ReadInt32(); + OPN.CH[i].SLOT[j].vol_out = reader.ReadUInt32(); + OPN.CH[i].SLOT[j].eg_sh_ar = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_ar = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sh_d1r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_d1r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sh_d2r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_d2r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sh_rr = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_rr = reader.ReadByte(); + OPN.CH[i].SLOT[j].ssg = reader.ReadByte(); + OPN.CH[i].SLOT[j].ssgn = reader.ReadByte(); + OPN.CH[i].SLOT[j].key = reader.ReadUInt32(); + OPN.CH[i].SLOT[j].AMmask = reader.ReadUInt32(); + } + } + for (i = 0; i < 3; i++) + { + OPN.CH[i].ALGO = reader.ReadByte(); + OPN.CH[i].FB = reader.ReadByte(); + OPN.CH[i].op1_out0 = reader.ReadInt32(); + OPN.CH[i].op1_out1 = reader.ReadInt32(); + OPN.CH[i].mem_value = reader.ReadInt32(); + OPN.CH[i].pms = reader.ReadInt32(); + OPN.CH[i].ams = reader.ReadByte(); + OPN.CH[i].fc = reader.ReadUInt32(); + OPN.CH[i].kcode = reader.ReadByte(); + OPN.CH[i].block_fnum = reader.ReadUInt32(); + } + for (i = 0; i < 3; i++) + { + OPN.SL3.fc[i] = reader.ReadUInt32(); + } + OPN.SL3.fn_h = reader.ReadByte(); + OPN.SL3.kcode = reader.ReadBytes(3); + for (i = 0; i < 3; i++) + { + OPN.SL3.block_fnum[i] = reader.ReadUInt32(); + } + YMDeltat.DELTAT.portstate = reader.ReadByte(); + YMDeltat.DELTAT.now_addr = reader.ReadInt32(); + YMDeltat.DELTAT.now_step = reader.ReadInt32(); + YMDeltat.DELTAT.acc = reader.ReadInt32(); + YMDeltat.DELTAT.prev_acc = reader.ReadInt32(); + YMDeltat.DELTAT.adpcmd = reader.ReadInt32(); + YMDeltat.DELTAT.adpcml = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2203.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2203.cs.meta new file mode 100644 index 00000000..d4ea6c54 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2203.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a125a3bb67ea01246b867600815ee0b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2413.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2413.cs new file mode 100644 index 00000000..ac69dfbc --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2413.cs @@ -0,0 +1,1197 @@ +using System; + +namespace MAME.Core +{ + public class YM2413 + { + public struct OPLL_SLOT + { + public uint ar; + public uint dr; + public uint rr; + public byte KSR; + public byte ksl; + public byte ksr; + public byte mul; + + public uint phase; + public uint freq; + public byte fb_shift; + public int[] op1_out; + + public byte eg_type; + public byte state; + public uint TL; + public int TLL; + public int volume; + public uint sl; + + public byte eg_sh_dp; + public byte eg_sel_dp; + public byte eg_sh_ar; + public byte eg_sel_ar; + public byte eg_sh_dr; + public byte eg_sel_dr; + public byte eg_sh_rr; + public byte eg_sel_rr; + public byte eg_sh_rs; + public byte eg_sel_rs; + + public uint key; + + public uint AMmask; + public byte vib; + + public uint wavetable; + } + public struct OPLL_CH + { + public OPLL_SLOT[] SLOT; + public uint block_fnum; + public uint fc; + public uint ksl_base; + public byte kcode; + public byte sus; + } + public struct YM2413Struct + { + public OPLL_CH[] P_CH; + public byte[] instvol_r; + + public uint eg_cnt; + public uint eg_timer; + public uint eg_timer_add; + public uint eg_timer_overflow; + + public byte rhythm; + + public uint lfo_am_cnt; + public uint lfo_am_inc; + public uint lfo_pm_cnt; + public uint lfo_pm_inc; + + public uint noise_rng; + public uint noise_p; + public uint noise_f; + + public byte[][] inst_tab; + + public OPLL_UPDATEHANDLER UpdateHandler; + //void * UpdateParam; + + public uint[] fn_tab; + + public byte address; + public byte status; + + public int index; + public int clock; + public int rate; + public double freqbase; + } + private static uint[] ksl_tab = new uint[8 * 16] + { + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + + 0,0,0,0, + 0,0,0,0, + 0,4,6,8, + 10,12,14,16, + + 0,0,0,0, + 0,6,10,14, + 16,20,22,24, + 26,28,30,32, + + 0,0,0,10, + 16,22,26,30, + 32,36,38,40, + 42,44,46,48, + + 0,0,16,26, + 32,38,42,46, + 48,52,54,56, + 58,60,62,64, + + 0,16,32,42, + 48,54,58,62, + 64,68,70,72, + 74,76,78,80, + + 0,32,48,58, + 64,70,74,78, + 80,84,86,88, + 90,92,94,96, + + 0,48,64,74, + 80,86,90,94, + 96,100,102,104, + 106,108,110,112 + }; + private static uint[] sl_tab = new uint[16] + { + 0*8, 1*8, 2*8,3 *8,4 *8,5 *8,6 *8, 7*8, + 8*8, 9*8,10*8,11*8,12*8,13*8,14*8,15*8 + }; + private static byte[] eg_inc = new byte[15 * 8] + { + 0,1, 0,1, 0,1, 0,1, + 0,1, 0,1, 1,1, 0,1, + 0,1, 1,1, 0,1, 1,1, + 0,1, 1,1, 1,1, 1,1, + + 1,1, 1,1, 1,1, 1,1, + 1,1, 1,2, 1,1, 1,2, + 1,2, 1,2, 1,2, 1,2, + 1,2, 2,2, 1,2, 2,2, + + 2,2, 2,2, 2,2, 2,2, + 2,2, 2,4, 2,2, 2,4, + 2,4, 2,4, 2,4, 2,4, + 2,4, 4,4, 2,4, 4,4, + + 4,4, 4,4, 4,4, 4,4, + 8,8, 8,8, 8,8, 8,8, + 0,0, 0,0, 0,0, 0,0, + }; + private static byte[] eg_rate_select = new byte[96] + { + 14*8,14*8,14*8,14*8,14*8,14*8,14*8,14*8, + 14*8,14*8,14*8,14*8,14*8,14*8,14*8,14*8, + + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + 0*8,1*8,2*8,3*8, + + 4*8,5*8,6*8,7*8, + + 8*8,9*8,10*8,11*8, + + 12*8,12*8,12*8,12*8, + + 12*8,12*8,12*8,12*8,12*8,12*8,12*8,12*8, + 12*8,12*8,12*8,12*8,12*8,12*8,12*8,12*8, + }; + private static byte[] eg_rate_shift = new byte[96] + { + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + + 13,13,13,13, + 12,12,12,12, + 11,11,11,11, + 10,10,10,10, + 9, 9, 9, 9, + 8, 8, 8, 8, + 7, 7, 7, 7, + 6, 6, 6, 6, + 5, 5, 5, 5, + 4, 4, 4, 4, + 3, 3, 3, 3, + 2, 2, 2, 2, + 1, 1, 1, 1, + + 0, 0, 0, 0, + + 0, 0, 0, 0, + + 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + private static byte[] mul_tab = new byte[16] + { + 1, 1*2, 2*2, 3*2, 4*2, 5*2, 6*2, 7*2, + 8*2, 9*2,10*2,10*2,12*2,12*2,15*2,15*2 + }; + public delegate void OPLL_UPDATEHANDLER(int min_interval_us); + private static int[] tl_tab; + private static uint[] sin_tab; + private static byte[] lfo_am_table = new byte[210] + { + 0,0,0,0,0,0,0, + 1,1,1,1, + 2,2,2,2, + 3,3,3,3, + 4,4,4,4, + 5,5,5,5, + 6,6,6,6, + 7,7,7,7, + 8,8,8,8, + 9,9,9,9, + 10,10,10,10, + 11,11,11,11, + 12,12,12,12, + 13,13,13,13, + 14,14,14,14, + 15,15,15,15, + 16,16,16,16, + 17,17,17,17, + 18,18,18,18, + 19,19,19,19, + 20,20,20,20, + 21,21,21,21, + 22,22,22,22, + 23,23,23,23, + 24,24,24,24, + 25,25,25,25, + 26,26,26, + 25,25,25,25, + 24,24,24,24, + 23,23,23,23, + 22,22,22,22, + 21,21,21,21, + 20,20,20,20, + 19,19,19,19, + 18,18,18,18, + 17,17,17,17, + 16,16,16,16, + 15,15,15,15, + 14,14,14,14, + 13,13,13,13, + 12,12,12,12, + 11,11,11,11, + 10,10,10,10, + 9,9,9,9, + 8,8,8,8, + 7,7,7,7, + 6,6,6,6, + 5,5,5,5, + 4,4,4,4, + 3,3,3,3, + 2,2,2,2, + 1,1,1,1 + }; + private static sbyte[] lfo_pm_table = new sbyte[64] + { + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0,-1, 0, 0, 0, + 2, 1, 0,-1,-2,-1, 0, 1, + 3, 1, 0,-1,-3,-1, 0, 1, + 4, 2, 0,-2,-4,-2, 0, 2, + 5, 2, 0,-2,-5,-2, 0, 2, + 6, 3, 0,-3,-6,-3, 0, 3, + 7, 3, 0,-3,-7,-3, 0, 3, + }; + private static byte[][] table = new byte[19][] + { + new byte[]{0x49, 0x4c, 0x4c, 0x12, 0x00, 0x00, 0x00, 0x00 }, + + new byte[]{0x61, 0x61, 0x1e, 0x17, 0xf0, 0x78, 0x00, 0x17 }, + new byte[]{0x13, 0x41, 0x1e, 0x0d, 0xd7, 0xf7, 0x13, 0x13 }, + new byte[]{0x13, 0x01, 0x99, 0x04, 0xf2, 0xf4, 0x11, 0x23 }, + new byte[]{0x21, 0x61, 0x1b, 0x07, 0xaf, 0x64, 0x40, 0x27 }, + + new byte[]{0x22, 0x21, 0x1e, 0x06, 0xf0, 0x75, 0x08, 0x18 }, + + new byte[]{0x31, 0x22, 0x16, 0x05, 0x90, 0x71, 0x00, 0x13 }, + + new byte[]{0x21, 0x61, 0x1d, 0x07, 0x82, 0x80, 0x10, 0x17 }, + new byte[]{0x23, 0x21, 0x2d, 0x16, 0xc0, 0x70, 0x07, 0x07 }, + new byte[]{0x61, 0x61, 0x1b, 0x06, 0x64, 0x65, 0x10, 0x17 }, + + new byte[]{0x61, 0x61, 0x0c, 0x18, 0x85, 0xf0, 0x70, 0x07 }, + + new byte[]{0x23, 0x01, 0x07, 0x11, 0xf0, 0xa4, 0x00, 0x22 }, + new byte[]{0x97, 0xc1, 0x24, 0x07, 0xff, 0xf8, 0x22, 0x12 }, + + new byte[]{0x61, 0x10, 0x0c, 0x05, 0xf2, 0xf4, 0x40, 0x44 }, + + new byte[]{0x01, 0x01, 0x55, 0x03, 0xf3, 0x92, 0xf3, 0xf3 }, + new byte[]{0x61, 0x41, 0x89, 0x03, 0xf1, 0xf4, 0xf0, 0x13 }, + + new byte[]{0x01, 0x01, 0x16, 0x00, 0xfd, 0xf8, 0x2f, 0x6d }, + new byte[]{0x01, 0x01, 0x00, 0x00, 0xd8, 0xd8, 0xf9, 0xf8 }, + new byte[]{0x05, 0x01, 0x00, 0x00, 0xf8, 0xba, 0x49, 0x55 } + }; + public static YM2413Struct OPLL; + private static int num_lock = 0; + private static int[] output; + private static int outchan; + private static uint LFO_AM; + private static int LFO_PM; + private static int limit(int val, int max, int min) + { + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + else + { + return val; + } + } + private static void advance_lfo() + { + OPLL.lfo_am_cnt += OPLL.lfo_am_inc; + if (OPLL.lfo_am_cnt >= ((uint)210 << 24)) + OPLL.lfo_am_cnt -= ((uint)210 << 24); + LFO_AM = (uint)(lfo_am_table[OPLL.lfo_am_cnt >> 24] >> 1); + OPLL.lfo_pm_cnt += OPLL.lfo_pm_inc; + LFO_PM = (int)((OPLL.lfo_pm_cnt >> 24) & 7); + } + private static void advance() + { + uint i; + OPLL.eg_timer += OPLL.eg_timer_add; + while (OPLL.eg_timer >= OPLL.eg_timer_overflow) + { + OPLL.eg_timer -= OPLL.eg_timer_overflow; + OPLL.eg_cnt++; + for (i = 0; i < 9 * 2; i++) + { + switch (OPLL.P_CH[i / 2].SLOT[i & 1].state) + { + case 5: + if ((OPLL.eg_cnt & ((1 << OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_dp) - 1)) == 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume += eg_inc[OPLL.P_CH[i / 2].SLOT[i & 1].eg_sel_dp + ((OPLL.eg_cnt >> OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_dp) & 7)]; + if (OPLL.P_CH[i / 2].SLOT[i & 1].volume >= 0xff) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume = 0xff; + OPLL.P_CH[i / 2].SLOT[i & 1].state = 4; + OPLL.P_CH[i / 2].SLOT[i & 1].phase = 0; + } + } + break; + case 4: + if ((OPLL.eg_cnt & ((1 << OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_ar) - 1)) == 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume += (~OPLL.P_CH[i / 2].SLOT[i & 1].volume * (eg_inc[OPLL.P_CH[i / 2].SLOT[i & 1].eg_sel_ar + ((OPLL.eg_cnt >> OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_ar) & 7)])) >> 2; + if (OPLL.P_CH[i / 2].SLOT[i & 1].volume <= 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume = 0; + OPLL.P_CH[i / 2].SLOT[i & 1].state = 3; + } + } + break; + case 3: + if ((OPLL.eg_cnt & ((1 << OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_dr) - 1)) == 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume += eg_inc[OPLL.P_CH[i / 2].SLOT[i & 1].eg_sel_dr + ((OPLL.eg_cnt >> OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_dr) & 7)]; + if (OPLL.P_CH[i / 2].SLOT[i & 1].volume >= OPLL.P_CH[i / 2].SLOT[i & 1].sl) + OPLL.P_CH[i / 2].SLOT[i & 1].state = 2; + } + break; + case 2: + if (OPLL.P_CH[i / 2].SLOT[i & 1].eg_type != 0) + { + + } + else + { + if ((OPLL.eg_cnt & ((1 << OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rr) - 1)) == 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume += eg_inc[OPLL.P_CH[i / 2].SLOT[i & 1].eg_sel_rr + ((OPLL.eg_cnt >> OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rr) & 7)]; + if (OPLL.P_CH[i / 2].SLOT[i & 1].volume >= 0xff) + OPLL.P_CH[i / 2].SLOT[i & 1].volume = 0xff; + } + } + break; + case 1: + if ((i & 1) != 0 || (((OPLL.rhythm & 0x20) != 0) && (i >= 12))) + { + if (OPLL.P_CH[i / 2].SLOT[i & 1].eg_type != 0) + { + if (OPLL.P_CH[i / 2].sus != 0) + { + if ((OPLL.eg_cnt & ((1 << OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rs) - 1)) == 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume += eg_inc[OPLL.P_CH[i / 2].SLOT[i & 1].eg_sel_rs + ((OPLL.eg_cnt >> OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rs) & 7)]; + if (OPLL.P_CH[i / 2].SLOT[i & 1].volume >= 0xff) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume = 0xff; + OPLL.P_CH[i / 2].SLOT[i & 1].state = 0; + } + } + } + else + { + if ((OPLL.eg_cnt & ((1 << OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rr) - 1)) == 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume += eg_inc[OPLL.P_CH[i / 2].SLOT[i & 1].eg_sel_rr + ((OPLL.eg_cnt >> OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rr) & 7)]; + if (OPLL.P_CH[i / 2].SLOT[i & 1].volume >= 0xff) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume = 0xff; + OPLL.P_CH[i / 2].SLOT[i & 1].state = 0; + } + } + } + } + else + { + if ((OPLL.eg_cnt & ((1 << OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rs) - 1)) == 0) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume += eg_inc[OPLL.P_CH[i / 2].SLOT[i & 1].eg_sel_rs + ((OPLL.eg_cnt >> OPLL.P_CH[i / 2].SLOT[i & 1].eg_sh_rs) & 7)]; + if (OPLL.P_CH[i / 2].SLOT[i & 1].volume >= 0xff) + { + OPLL.P_CH[i / 2].SLOT[i & 1].volume = 0xff; + OPLL.P_CH[i / 2].SLOT[i & 1].state = 0; + } + } + } + } + break; + default: + break; + } + } + } + for (i = 0; i < 9 * 2; i++) + { + if (OPLL.P_CH[i / 2].SLOT[i & 1].vib != 0) + { + byte block; + uint fnum_lfo = 8 * ((OPLL.P_CH[i / 2].block_fnum & 0x01c0) >> 6); + uint block_fnum = OPLL.P_CH[i / 2].block_fnum * 2; + int lfo_fn_table_index_offset = lfo_pm_table[LFO_PM + fnum_lfo]; + if (lfo_fn_table_index_offset != 0) + { + block_fnum += (uint)lfo_fn_table_index_offset; + block = (byte)((block_fnum & 0x1c00) >> 10); + OPLL.P_CH[i / 2].SLOT[i & 1].phase += (OPLL.fn_tab[block_fnum & 0x03ff] >> (7 - block)) * OPLL.P_CH[i / 2].SLOT[i & 1].mul; + } + else + { + OPLL.P_CH[i / 2].SLOT[i & 1].phase += OPLL.P_CH[i / 2].SLOT[i & 1].freq; + } + } + else + { + OPLL.P_CH[i / 2].SLOT[i & 1].phase += OPLL.P_CH[i / 2].SLOT[i & 1].freq; + } + } + OPLL.noise_p += OPLL.noise_f; + i = OPLL.noise_p >> 16; + OPLL.noise_p &= 0xffff; + while (i != 0) + { + if ((OPLL.noise_rng & 1) != 0) + OPLL.noise_rng ^= 0x800302; + OPLL.noise_rng >>= 1; + i--; + } + } + private static int op_calc(uint phase, uint env, int pm, uint wave_tab) + { + uint p; + p = (env << 5) + sin_tab[wave_tab + ((((int)((phase & ~0xffff) + (pm << 17))) >> 16) & 0x3ff)]; + if (p >= 0x1600) + return 0; + return tl_tab[p]; + } + private static int op_calc1(uint phase, uint env, int pm, uint wave_tab) + { + uint p; + int i; + i = (int)((phase & ~0xffff) + pm); + p = (env << 5) + sin_tab[wave_tab + ((i >> 16) & 0x3ff)]; + if (p >= 0x1600) + return 0; + return tl_tab[p]; + } + private static uint volume_calc(int chan, int slot) + { + uint i1; + i1 = (uint)(OPLL.P_CH[chan].SLOT[slot].TLL + (uint)OPLL.P_CH[chan].SLOT[slot].volume + (LFO_AM & OPLL.P_CH[chan].SLOT[slot].AMmask)); + return i1; + } + private static void chan_calc(int chan) + { + uint env; + int out1; + int phase_modulation; + env = volume_calc(chan, 0); + out1 = OPLL.P_CH[chan].SLOT[0].op1_out[0] + OPLL.P_CH[chan].SLOT[0].op1_out[1]; + OPLL.P_CH[chan].SLOT[0].op1_out[0] = OPLL.P_CH[chan].SLOT[0].op1_out[1]; + phase_modulation = OPLL.P_CH[chan].SLOT[0].op1_out[0]; + OPLL.P_CH[chan].SLOT[0].op1_out[1] = 0; + if (env < 0xb0) + { + if (OPLL.P_CH[chan].SLOT[0].fb_shift == 0) + out1 = 0; + OPLL.P_CH[chan].SLOT[0].op1_out[1] = op_calc1(OPLL.P_CH[chan].SLOT[0].phase, env, (out1 << OPLL.P_CH[chan].SLOT[0].fb_shift), OPLL.P_CH[chan].SLOT[0].wavetable); + } + outchan = 0; + env = volume_calc(chan, 1); + if (env < 0xb0) + { + int outp = op_calc(OPLL.P_CH[chan].SLOT[1].phase, env, phase_modulation, OPLL.P_CH[chan].SLOT[1].wavetable); + output[0] += outp; + outchan = outp; + } + } + private static void rhythm_calc(uint noise) + { + int out1; + uint env; + int phase_modulation; + env = volume_calc(6, 0); + out1 = OPLL.P_CH[6].SLOT[0].op1_out[0] + OPLL.P_CH[6].SLOT[0].op1_out[1]; + OPLL.P_CH[6].SLOT[0].op1_out[0] = OPLL.P_CH[6].SLOT[0].op1_out[1]; + phase_modulation = OPLL.P_CH[6].SLOT[0].op1_out[0]; + OPLL.P_CH[6].SLOT[0].op1_out[1] = 0; + if (env < 0xb0) + { + if (OPLL.P_CH[6].SLOT[0].fb_shift == 0) + out1 = 0; + OPLL.P_CH[6].SLOT[0].op1_out[1] = op_calc1(OPLL.P_CH[6].SLOT[0].phase, env, (out1 << OPLL.P_CH[6].SLOT[0].fb_shift), OPLL.P_CH[6].SLOT[0].wavetable); + } + env = volume_calc(6, 1); + if (env < 0xb0) + output[1] += op_calc(OPLL.P_CH[6].SLOT[1].phase, env, phase_modulation, OPLL.P_CH[6].SLOT[1].wavetable) * 2; + env = volume_calc(7, 0); + if (env < 0xb0) + { + byte bit7 = (byte)(((OPLL.P_CH[7].SLOT[0].phase >> 16) >> 7) & 1); + byte bit3 = (byte)(((OPLL.P_CH[7].SLOT[0].phase >> 16) >> 3) & 1); + byte bit2 = (byte)(((OPLL.P_CH[7].SLOT[0].phase >> 16) >> 2) & 1); + byte res1 = (byte)((bit2 ^ bit7) | bit3); + uint phase = (uint)(res1 != 0 ? (0x200 | (0xd0 >> 2)) : 0xd0); + byte bit5e = (byte)(((OPLL.P_CH[8].SLOT[1].phase >> 16) >> 5) & 1); + byte bit3e = (byte)(((OPLL.P_CH[8].SLOT[1].phase >> 16) >> 3) & 1); + byte res2 = (byte)(bit3e | bit5e); + if (res2 != 0) + phase = (0x200 | (0xd0 >> 2)); + if ((phase & 0x200) != 0) + { + if (noise != 0) + phase = 0x200 | 0xd0; + } + else + { + if (noise != 0) + phase = 0xd0 >> 2; + } + output[1] += op_calc(phase << 16, env, 0, OPLL.P_CH[7].SLOT[0].wavetable) * 2; + } + env = volume_calc(7, 1); + if (env < 0xb0) + { + byte bit8 = (byte)(((OPLL.P_CH[7].SLOT[0].phase >> 16) >> 8) & 1); + uint phase = (uint)(bit8 != 0 ? 0x200 : 0x100); + if (noise != 0) + phase ^= 0x100; + output[1] += op_calc(phase << 16, env, 0, OPLL.P_CH[7].SLOT[1].wavetable) * 2; + } + env = volume_calc(8, 0); + if (env < 0xb0) + output[1] += op_calc(OPLL.P_CH[8].SLOT[0].phase, env, 0, OPLL.P_CH[8].SLOT[0].wavetable) * 2; + env = volume_calc(8, 1); + if (env < 0xb0) + { + byte bit7 = (byte)(((OPLL.P_CH[7].SLOT[0].phase >> 16) >> 7) & 1); + byte bit3 = (byte)(((OPLL.P_CH[7].SLOT[0].phase >> 16) >> 3) & 1); + byte bit2 = (byte)(((OPLL.P_CH[7].SLOT[0].phase >> 16) >> 2) & 1); + byte res1 = (byte)((bit2 ^ bit7) | bit3); + uint phase = (uint)(res1 != 0 ? 0x300 : 0x100); + byte bit5e = (byte)(((OPLL.P_CH[8].SLOT[1].phase >> 16) >> 5) & 1); + byte bit3e = (byte)(((OPLL.P_CH[8].SLOT[1].phase >> 16) >> 3) & 1); + byte res2 = (byte)(bit3e | bit5e); + if (res2 != 0) + phase = 0x300; + output[1] += op_calc(phase << 16, env, 0, OPLL.P_CH[8].SLOT[1].wavetable) * 2; + } + } + private static int init_tables() + { + int i, x; + int n; + double o, m; + for (x = 0; x < 0x100; x++) + { + m = (1 << 16) / Math.Pow(2, (x + 1) * ((128.0 / 0x400) / 4.0) / 8.0); + m = Math.Floor(m); + n = (int)m; + n >>= 4; + if ((n & 1) != 0) + n = (n >> 1) + 1; + else + n = n >> 1; + tl_tab[x * 2 + 0] = n; + tl_tab[x * 2 + 1] = -tl_tab[x * 2 + 0]; + + for (i = 1; i < 11; i++) + { + tl_tab[x * 2 + 0 + i * 2 * 0x100] = tl_tab[x * 2 + 0] >> i; + tl_tab[x * 2 + 1 + i * 2 * 0x100] = -tl_tab[x * 2 + 0 + i * 2 * 0x100]; + } + } + for (i = 0; i < 0x400; i++) + { + m = Math.Sin(((i * 2) + 1) * Math.PI / 0x400); + if (m > 0.0) + o = 8 * Math.Log(1.0 / m) / Math.Log(2); + else + o = 8 * Math.Log(-1.0 / m) / Math.Log(2); + o = o / ((128.0 / 0x400) / 4); + n = (int)(2.0 * o); + if ((n & 1) != 0) + n = (n >> 1) + 1; + else + n = n >> 1; + sin_tab[i] = (uint)(n * 2 + (m >= 0.0 ? 0 : 1)); + if ((i & 0x200) != 0) + sin_tab[1 * 0x400 + i] = 0x1600; + else + sin_tab[1 * 0x400 + i] = sin_tab[i]; + } + return 1; + } + private static void OPLL_initalize() + { + int i; + //OPLL_init_save(); + OPLL.freqbase = (OPLL.rate != 0) ? ((double)OPLL.clock / 72.0) / OPLL.rate : 0; + for (i = 0; i < 1024; i++) + { + OPLL.fn_tab[i] = (uint)((double)i * 64 * OPLL.freqbase * (1 << (16 - 10))); + } + OPLL.lfo_am_inc = (uint)(0x40000 * OPLL.freqbase); + OPLL.lfo_pm_inc = (uint)(0x4000 * OPLL.freqbase); + OPLL.noise_f = (uint)(0x10000 * OPLL.freqbase); + OPLL.eg_timer_add = (uint)(0x10000 * OPLL.freqbase); + OPLL.eg_timer_overflow = (uint)0x10000; + } + private static void KEY_ON(int chan, int slot, uint key_set) + { + if (OPLL.P_CH[chan].SLOT[slot].key == 0) + { + OPLL.P_CH[chan].SLOT[slot].state = 5; + } + OPLL.P_CH[chan].SLOT[slot].key |= key_set; + } + private static void KEY_OFF(int chan, int slot, uint key_clr) + { + if (OPLL.P_CH[chan].SLOT[slot].key != 0) + { + OPLL.P_CH[chan].SLOT[slot].key &= key_clr; + if (OPLL.P_CH[chan].SLOT[slot].key == 0) + { + if (OPLL.P_CH[chan].SLOT[slot].state > 1) + OPLL.P_CH[chan].SLOT[slot].state = 1; + } + } + } + private static void CALC_FCSLOT(int chan, int slot) + { + int ksr; + uint SLOT_rs; + uint SLOT_dp; + OPLL.P_CH[chan].SLOT[slot].freq = OPLL.P_CH[chan].fc * OPLL.P_CH[chan].SLOT[slot].mul; + ksr = OPLL.P_CH[chan].kcode >> OPLL.P_CH[chan].SLOT[slot].KSR; + if (OPLL.P_CH[chan].SLOT[slot].ksr != ksr) + { + OPLL.P_CH[chan].SLOT[slot].ksr = (byte)ksr; + if ((OPLL.P_CH[chan].SLOT[slot].ar + OPLL.P_CH[chan].SLOT[slot].ksr) < 16 + 62) + { + OPLL.P_CH[chan].SLOT[slot].eg_sh_ar = eg_rate_shift[OPLL.P_CH[chan].SLOT[slot].ar + OPLL.P_CH[chan].SLOT[slot].ksr]; + OPLL.P_CH[chan].SLOT[slot].eg_sel_ar = eg_rate_select[OPLL.P_CH[chan].SLOT[slot].ar + OPLL.P_CH[chan].SLOT[slot].ksr]; + } + else + { + OPLL.P_CH[chan].SLOT[slot].eg_sh_ar = 0; + OPLL.P_CH[chan].SLOT[slot].eg_sel_ar = 13 * 8; + } + OPLL.P_CH[chan].SLOT[slot].eg_sh_dr = eg_rate_shift[OPLL.P_CH[chan].SLOT[slot].dr + OPLL.P_CH[chan].SLOT[slot].ksr]; + OPLL.P_CH[chan].SLOT[slot].eg_sel_dr = eg_rate_select[OPLL.P_CH[chan].SLOT[slot].dr + OPLL.P_CH[chan].SLOT[slot].ksr]; + OPLL.P_CH[chan].SLOT[slot].eg_sh_rr = eg_rate_shift[OPLL.P_CH[chan].SLOT[slot].rr + OPLL.P_CH[chan].SLOT[slot].ksr]; + OPLL.P_CH[chan].SLOT[slot].eg_sel_rr = eg_rate_select[OPLL.P_CH[chan].SLOT[slot].rr + OPLL.P_CH[chan].SLOT[slot].ksr]; + } + if (OPLL.P_CH[chan].sus != 0) + SLOT_rs = 16 + (5 << 2); + else + SLOT_rs = 16 + (7 << 2); + OPLL.P_CH[chan].SLOT[slot].eg_sh_rs = eg_rate_shift[SLOT_rs + OPLL.P_CH[chan].SLOT[slot].ksr]; + OPLL.P_CH[chan].SLOT[slot].eg_sel_rs = eg_rate_select[SLOT_rs + OPLL.P_CH[chan].SLOT[slot].ksr]; + SLOT_dp = 16 + (13 << 2); + OPLL.P_CH[chan].SLOT[slot].eg_sh_dp = eg_rate_shift[SLOT_dp + OPLL.P_CH[chan].SLOT[slot].ksr]; + OPLL.P_CH[chan].SLOT[slot].eg_sel_dp = eg_rate_select[SLOT_dp + OPLL.P_CH[chan].SLOT[slot].ksr]; + } + private static void set_mul(int slot, int v) + { + OPLL.P_CH[slot / 2].SLOT[slot & 1].mul = mul_tab[v & 0x0f]; + OPLL.P_CH[slot / 2].SLOT[slot & 1].KSR = (byte)((v & 0x10) != 0 ? 0 : 2); + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_type = (byte)(v & 0x20); + OPLL.P_CH[slot / 2].SLOT[slot & 1].vib = (byte)(v & 0x40); + OPLL.P_CH[slot / 2].SLOT[slot & 1].AMmask = (uint)((v & 0x80) != 0 ? ~0 : 0); + CALC_FCSLOT(slot / 2, slot & 1); + } + private static void set_ksl_tl(int chan, int v) + { + int ksl; + ksl = v >> 6; + OPLL.P_CH[chan].SLOT[0].ksl = (byte)(ksl != 0 ? 3 - ksl : 31); + OPLL.P_CH[chan].SLOT[0].TL = (uint)((v & 0x3f) << 1); + OPLL.P_CH[chan].SLOT[0].TLL = (int)(OPLL.P_CH[chan].SLOT[0].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[0].ksl)); + } + private static void set_ksl_wave_fb(int chan, int v) + { + int ksl; + OPLL.P_CH[chan].SLOT[0].wavetable = (uint)(((v & 0x08) >> 3) * 0x400); + OPLL.P_CH[chan].SLOT[0].fb_shift = (byte)((v & 7) != 0 ? (v & 7) + 8 : 0); + ksl = v >> 6; + OPLL.P_CH[chan].SLOT[1].ksl = (byte)(ksl != 0 ? 3 - ksl : 31); + OPLL.P_CH[chan].SLOT[1].TLL = (int)(OPLL.P_CH[chan].SLOT[1].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[1].ksl)); + OPLL.P_CH[chan].SLOT[1].wavetable = (uint)(((v & 0x10) >> 4) * 0x400); + } + private static void set_ar_dr(int slot, int v) + { + OPLL.P_CH[slot / 2].SLOT[slot & 1].ar = (uint)((v >> 4) != 0 ? 16 + ((v >> 4) << 2) : 0); + if ((OPLL.P_CH[slot / 2].SLOT[slot & 1].ar + OPLL.P_CH[slot / 2].SLOT[slot & 1].ksr) < 16 + 62) + { + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sh_ar = eg_rate_shift[OPLL.P_CH[slot / 2].SLOT[slot & 1].ar + OPLL.P_CH[slot / 2].SLOT[slot & 1].ksr]; + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sel_ar = eg_rate_select[OPLL.P_CH[slot / 2].SLOT[slot & 1].ar + OPLL.P_CH[slot / 2].SLOT[slot & 1].ksr]; + } + else + { + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sh_ar = 0; + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sel_ar = 13 * 8; + } + OPLL.P_CH[slot / 2].SLOT[slot & 1].dr = (uint)((v & 0x0f) != 0 ? 16 + ((v & 0x0f) << 2) : 0); + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sh_dr = eg_rate_shift[OPLL.P_CH[slot / 2].SLOT[slot & 1].dr + OPLL.P_CH[slot / 2].SLOT[slot & 1].ksr]; + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sel_dr = eg_rate_select[OPLL.P_CH[slot / 2].SLOT[slot & 1].dr + OPLL.P_CH[slot / 2].SLOT[slot & 1].ksr]; + } + private static void set_sl_rr(int slot, int v) + { + OPLL.P_CH[slot / 2].SLOT[slot & 1].sl = sl_tab[v >> 4]; + OPLL.P_CH[slot / 2].SLOT[slot & 1].rr = (uint)((v & 0x0f) != 0 ? 16 + ((v & 0x0f) << 2) : 0); + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sh_rr = eg_rate_shift[OPLL.P_CH[slot / 2].SLOT[slot & 1].rr + OPLL.P_CH[slot / 2].SLOT[slot & 1].ksr]; + OPLL.P_CH[slot / 2].SLOT[slot & 1].eg_sel_rr = eg_rate_select[OPLL.P_CH[slot / 2].SLOT[slot & 1].rr + OPLL.P_CH[slot / 2].SLOT[slot & 1].ksr]; + } + private static void load_instrument(int chan, int slot, int inst) + { + set_mul(slot, (int)OPLL.inst_tab[inst][0]); + set_mul(slot + 1, (int)OPLL.inst_tab[inst][1]); + set_ksl_tl(chan, (int)OPLL.inst_tab[inst][2]); + set_ksl_wave_fb(chan, (int)OPLL.inst_tab[inst][3]); + set_ar_dr(slot, (int)OPLL.inst_tab[inst][4]); + set_ar_dr(slot + 1, (int)OPLL.inst_tab[inst][5]); + set_sl_rr(slot, (int)OPLL.inst_tab[inst][6]); + set_sl_rr(slot + 1, (int)OPLL.inst_tab[inst][7]); + } + private static void update_instrument_zero(int r) + { + int chan; + int chan_max; + chan_max = 9; + if ((OPLL.rhythm & 0x20) != 0) + chan_max = 6; + switch (r) + { + case 0: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_mul(chan * 2, OPLL.inst_tab[0][0]); + } + } + break; + case 1: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_mul(chan * 2 + 1, OPLL.inst_tab[0][1]); + } + } + break; + case 2: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_ksl_tl(chan, OPLL.inst_tab[0][2]); + } + } + break; + case 3: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_ksl_wave_fb(chan, OPLL.inst_tab[0][3]); + } + } + break; + case 4: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_ar_dr(chan * 2, OPLL.inst_tab[0][4]); + } + } + break; + case 5: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_ar_dr(chan * 2 + 1, OPLL.inst_tab[0][5]); + } + } + break; + case 6: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_sl_rr(chan * 2, OPLL.inst_tab[0][6]); + } + } + break; + case 7: + for (chan = 0; chan < chan_max; chan++) + { + if ((OPLL.instvol_r[chan] & 0xf0) == 0) + { + set_sl_rr(chan * 2 + 1, OPLL.inst_tab[0][7]); + } + } + break; + } + } + static void OPLLWriteReg(int r, int v) + { + int inst; + int chan; + int slot; + r &= 0xff; + v &= 0xff; + switch (r & 0xf0) + { + case 0x00: + { + switch (r & 0x0f) + { + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + OPLL.inst_tab[0][r & 0x07] = (byte)v; + update_instrument_zero(r & 7); + break; + case 0x0e: + { + if ((v & 0x20) != 0) + { + if ((OPLL.rhythm & 0x20) == 0) + { + chan = 6; + slot = chan * 2; + load_instrument(chan, slot, 16); + chan = 7; + slot = chan * 2; + load_instrument(chan, slot, 17); + OPLL.P_CH[chan].SLOT[0].TL = (uint)(((OPLL.instvol_r[chan] >> 4) << 2) << 1); + OPLL.P_CH[chan].SLOT[0].TLL = (int)(OPLL.P_CH[chan].SLOT[0].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[0].ksl)); + chan = 8; + slot = chan * 2; + load_instrument(chan, slot, 18); + OPLL.P_CH[chan].SLOT[0].TL = (uint)(((OPLL.instvol_r[chan] >> 4) << 2) << 1); + OPLL.P_CH[chan].SLOT[0].TLL = (int)(OPLL.P_CH[chan].SLOT[0].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[0].ksl)); + } + if ((v & 0x10) != 0) + { + KEY_ON(6, 0, 2); + KEY_ON(6, 1, 2); + } + else + { + KEY_OFF(6, 0, unchecked((uint)(~2))); + KEY_OFF(6, 1, unchecked((uint)(~2))); + } + if ((v & 0x01) != 0) + KEY_ON(7, 0, 2); + else + KEY_OFF(7, 0, unchecked((uint)(~2))); + if ((v & 0x08) != 0) + KEY_ON(7, 1, 2); + else + KEY_OFF(7, 1, unchecked((uint)(~2))); + if ((v & 0x04) != 0) + KEY_ON(8, 0, 2); + else + KEY_OFF(8, 0, unchecked((uint)(~2))); + if ((v & 0x02) != 0) + KEY_ON(8, 1, 2); + else + KEY_OFF(8, 1, unchecked((uint)(~2))); + } + else + { + if ((OPLL.rhythm & 0x20) == 1) + { + chan = 6; + slot = chan * 2; + load_instrument(chan, slot, OPLL.instvol_r[chan] >> 4); + chan = 7; + slot = chan * 2; + load_instrument(chan, slot, OPLL.instvol_r[chan] >> 4); + chan = 8; + slot = chan * 2; + load_instrument(chan, slot, OPLL.instvol_r[chan] >> 4); + } + KEY_OFF(6, 0, unchecked((uint)(~2))); + KEY_OFF(6, 1, unchecked((uint)(~2))); + KEY_OFF(7, 0, unchecked((uint)(~2))); + KEY_OFF(7, 1, unchecked((uint)(~2))); + KEY_OFF(8, 0, unchecked((uint)(~2))); + KEY_OFF(8, 1, unchecked((uint)(~2))); + } + OPLL.rhythm = (byte)(v & 0x3f); + } + break; + } + } + break; + case 0x10: + case 0x20: + { + int block_fnum; + chan = r & 0x0f; + if (chan >= 9) + chan -= 9; + if ((r & 0x10) != 0) + { + block_fnum = (int)((OPLL.P_CH[chan].block_fnum & 0x0f00) | (uint)v); + } + else + { + block_fnum = (int)((uint)((v & 0x0f) << 8) | (OPLL.P_CH[chan].block_fnum & 0xff)); + if ((v & 0x10) != 0) + { + KEY_ON(chan, 0, 1); + KEY_ON(chan, 1, 1); + } + else + { + KEY_OFF(chan, 0, unchecked((uint)(~1))); + KEY_OFF(chan, 1, unchecked((uint)(~1))); + } + OPLL.P_CH[chan].sus = (byte)(v & 0x20); + } + if (OPLL.P_CH[chan].block_fnum != block_fnum) + { + byte block; + OPLL.P_CH[chan].block_fnum = (uint)block_fnum; + OPLL.P_CH[chan].kcode = (byte)((block_fnum & 0x0f00) >> 8); + OPLL.P_CH[chan].ksl_base = ksl_tab[block_fnum >> 5]; + block_fnum = block_fnum * 2; + block = (byte)((block_fnum & 0x1c00) >> 10); + OPLL.P_CH[chan].fc = OPLL.fn_tab[block_fnum & 0x03ff] >> (7 - block); + OPLL.P_CH[chan].SLOT[0].TLL = (int)(OPLL.P_CH[chan].SLOT[0].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[0].ksl)); + OPLL.P_CH[chan].SLOT[1].TLL = (int)(OPLL.P_CH[chan].SLOT[1].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[1].ksl)); + CALC_FCSLOT(chan, 0); + CALC_FCSLOT(chan, 1); + } + } + break; + case 0x30: + { + byte old_instvol; + chan = r & 0x0f; + if (chan >= 9) + chan -= 9; + old_instvol = OPLL.instvol_r[chan]; + OPLL.instvol_r[chan] = (byte)v; + OPLL.P_CH[chan].SLOT[1].TL = (uint)((v & 0x0f) << 3); + OPLL.P_CH[chan].SLOT[1].TLL = (int)(OPLL.P_CH[chan].SLOT[1].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[1].ksl)); + if ((chan >= 6) && ((OPLL.rhythm & 0x20) != 0)) + { + if (chan >= 7) + { + OPLL.P_CH[chan].SLOT[0].TL = (uint)((OPLL.instvol_r[chan] >> 4) << 3); + OPLL.P_CH[chan].SLOT[0].TLL = (int)(OPLL.P_CH[chan].SLOT[0].TL + (OPLL.P_CH[chan].ksl_base >> OPLL.P_CH[chan].SLOT[0].ksl)); + } + } + else + { + if ((old_instvol & 0xf0) == (v & 0xf0)) + return; + slot = chan * 2; + load_instrument(chan, slot, OPLL.instvol_r[chan] >> 4); + } + } + break; + default: + break; + } + } + private static int OPLL_LockTable() + { + num_lock++; + if (num_lock > 1) + return 0; + if (init_tables() == 0) + { + num_lock--; + return -1; + } + return 0; + } + private static void OPLL_UnLockTable() + { + if (num_lock != 0) + num_lock--; + } + private static void OPLLResetChip() + { + int c, s; + int i; + OPLL.eg_timer = 0; + OPLL.eg_cnt = 0; + OPLL.noise_rng = 1; + for (i = 0; i < 19; i++) + { + for (c = 0; c < 8; c++) + { + OPLL.inst_tab[i][c] = table[i][c]; + } + } + OPLLWriteReg(0x0f, 0); + for (i = 0x3f; i >= 0x10; i--) + OPLLWriteReg(i, 0x00); + for (c = 0; c < 9; c++) + { + for (s = 0; s < 2; s++) + { + OPLL.P_CH[c].SLOT[s].wavetable = 0; + OPLL.P_CH[c].SLOT[s].state = 0; + OPLL.P_CH[c].SLOT[s].volume = 0xff; + } + } + } + private static YM2413Struct OPLLCreate(int clock, int rate, int index) + { + OPLL_LockTable(); + OPLL = new YM2413Struct(); + OPLL.index = index; + OPLL.clock = clock; + OPLL.rate = rate; + OPLL_initalize(); + OPLLResetChip(); + return OPLL; + } + private static void OPLLDestroy() + { + OPLL_UnLockTable(); + } + /*private static void OPLLSetUpdateHandler(OPLL_UPDATEHANDLER UpdateHandler, void* param) + { + OPLL.UpdateHandler = UpdateHandler; + OPLL.UpdateParam = param; + }*/ + private static void OPLLWrite(int a, int v) + { + if ((a & 1) == 0) + { + OPLL.address = (byte)(v & 0xff); + } + else + { + if (OPLL.UpdateHandler != null) + { + //OPLL.UpdateHandler(OPLL.UpdateParam, 0); + } + OPLLWriteReg(OPLL.address, v); + } + } + private static byte OPLLRead(int a) + { + if ((a & 1) == 0) + { + return OPLL.status; + } + return 0xff; + } + public static void ym2413_start(int clock) + { + int rate = clock / 72; + ym2413_init(clock, rate, 0); + } + public static void ym2413_init(int clock, int rate, int index) + { + OPLLCreate(clock, rate, index); + } + private static void ym2413_shutdown() + { + OPLLDestroy(); + } + public static void ym2413_reset_chip() + { + OPLLResetChip(); + } + public static void ym2413_write(int a, int v) + { + OPLLWrite(a, v); + } + private static byte ym2413_read(int a) + { + return (byte)(OPLLRead(a) & 0x03); + } + /*private static void ym2413_set_update_handler(OPLL_UPDATEHANDLER UpdateHandler, void* param) + { + OPLLSetUpdateHandler(UpdateHandler, param); + }*/ + public unsafe static void ym2413_update_one(int offset, int length) + { + byte rhythm = (byte)(OPLL.rhythm & 0x20); + int i; + for (i = 0; i < length; i++) + { + int mo, ro; + output[0] = 0; + output[1] = 0; + advance_lfo(); + chan_calc(0); + chan_calc(1); + chan_calc(2); + chan_calc(3); + chan_calc(4); + chan_calc(5); + if (rhythm == 0) + { + chan_calc(6); + chan_calc(7); + chan_calc(8); + } + else + { + rhythm_calc((OPLL.noise_rng >> 0) & 1); + } + mo = output[0]; + ro = output[1]; + mo = limit(mo, 32767, -32768); + ro = limit(ro, 32767, -32768); + Sound.ym2413stream.streamoutput_Ptrs[0][offset + i] = mo; + Sound.ym2413stream.streamoutput_Ptrs[1][offset + i] = ro; + advance(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2413.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2413.cs.meta new file mode 100644 index 00000000..966e07b6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2413.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1cf690e1d4521994096d96af2809fafb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2610.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2610.cs new file mode 100644 index 00000000..607f7e59 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2610.cs @@ -0,0 +1,892 @@ +using System.IO; + +namespace MAME.Core +{ + public unsafe class YM2610 + { + public byte[] REGS; + public FM.FM_OPN OPN; + public byte addr_A1; + public byte[] pcmbuf; + public int pcm_size; + public byte adpcmTL; + public FM.ADPCM_CH[] adpcm; + public byte[] adpcmreg; + public byte adpcm_arrivedEndAddress; + public static YM2610 F2610 = new YM2610(); + public static EmuTimer.emu_timer[] timer; + public void timer_callback_0() + { + F2610.ym2610_timer_over(0); + } + public void timer_callback_1() + { + F2610.ym2610_timer_over(1); + } + public static void timer_handler(int c, int count, int clock) + { + if (count == 0) + { + EmuTimer.timer_enable(timer[c], false); + } + else + { + Atime period = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / clock), (uint)count);//8000000 + if (!EmuTimer.timer_enable(timer[c], true)) + { + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + } + } + } + public static void ym2610_update_request() + { + Sound.ym2610stream.stream_update(); + } + public void ADPCMA_calc_chan(int c) + { + uint step; + byte data; + int i; + adpcm[c].now_step += adpcm[c].step; + if (adpcm[c].now_step >= (1 << 16)) + { + step = adpcm[c].now_step >> 16; + adpcm[c].now_step &= (1 << 16) - 1; + for (i = 0; i < step; i++) + { + if ((adpcm[c].now_addr & ((1 << 21) - 1)) == ((adpcm[c].end << 1) & ((1 << 21) - 1))) + { + adpcm[c].flag = 0; + adpcm_arrivedEndAddress |= adpcm[c].flagMask; + return; + } + if ((adpcm[c].now_addr & 1) != 0) + { + data = (byte)(adpcm[c].now_data & 0x0f); + } + else + { + adpcm[c].now_data = FM.ymsndrom[adpcm[c].now_addr >> 1]; + data = (byte)((adpcm[c].now_data >> 4) & 0x0f); + } + adpcm[c].now_addr++; + adpcm[c].adpcm_acc += FM.jedi_table[adpcm[c].adpcm_step + data]; + if ((adpcm[c].adpcm_acc & ~0x7ff) != 0) + { + adpcm[c].adpcm_acc |= ~0xfff; + } + else + { + adpcm[c].adpcm_acc &= 0xfff; + } + adpcm[c].adpcm_step += FM.step_inc[data & 7]; + adpcm[c].adpcm_step = FM.Limit(adpcm[c].adpcm_step, 48 * 16, 0); + } + adpcm[c].adpcm_out = ((adpcm[c].adpcm_acc * adpcm[c].vol_mul) >> adpcm[c].vol_shift) & ~3; + } + FM.out_adpcm[FM.ipan[c]] += adpcm[c].adpcm_out; + } + public static void ym2610_start(int clock) + { + F2610 = new YM2610(); + F2610.OPN = new FM.FM_OPN(); + AY8910.ay8910_interface generic_ay8910 = new AY8910.ay8910_interface(); + generic_ay8910.flags = 3; + generic_ay8910.res_load = new int[3] { 1000, 1000, 1000 }; + generic_ay8910.portAread = null; + generic_ay8910.portBread = null; + generic_ay8910.portAwrite = null; + generic_ay8910.portBwrite = null; + int rate = clock / 72; + AY8910.ay8910_start_ym(17, 0, clock, generic_ay8910); + timer = new EmuTimer.emu_timer[2]; + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2610_F2610_timer_callback_0, false); + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2610_F2610_timer_callback_1, false); + ym2610_init(clock, rate); + } + public static void ym2610_init(int clock, int rate) + { + FM.FM_init(); + F2610.REGS = new byte[512]; + F2610.adpcmreg = new byte[0x30]; + F2610.adpcm = new FM.ADPCM_CH[6]; + F2610.OPN = new FM.FM_OPN(); + F2610.OPN.type = FM.TYPE_YM2610; + F2610.OPN.ST.clock = clock; + F2610.OPN.ST.rate = rate; + F2610.OPN.ST.timer_handler = YM2610.timer_handler; + switch (Machine.sBoard) + { + case "Taito B": + switch (Machine.sName) + { + case "pbobble": + case "silentd": + case "silentdj": + case "silentdu": + F2610.OPN.ST.IRQ_Handler = Taitob.irqhandler; + F2610.OPN.ST.SSG.set_clock = AY8910.AA8910[0].ay8910_set_clock_ym; + F2610.OPN.ST.SSG.write = AY8910.AA8910[0].ay8910_write_ym; + F2610.OPN.ST.SSG.read = AY8910.AA8910[0].ay8910_read_ym; + F2610.OPN.ST.SSG.reset = AY8910.AA8910[0].ay8910_reset_ym; + break; + } + break; + case "Neo Geo": + F2610.OPN.ST.IRQ_Handler = Neogeo.audio_cpu_irq; + F2610.OPN.ST.SSG.set_clock = AY8910.AA8910[0].ay8910_set_clock_ym; + F2610.OPN.ST.SSG.write = AY8910.AA8910[0].ay8910_write_ym; + F2610.OPN.ST.SSG.read = AY8910.AA8910[0].ay8910_read_ym; + F2610.OPN.ST.SSG.reset = AY8910.AA8910[0].ay8910_reset_ym; + break; + } + F2610.pcmbuf = FM.ymsndrom; + if (F2610.pcmbuf == null) + { + F2610.pcm_size = 0; + } + else + { + F2610.pcm_size = F2610.pcmbuf.Length; + } + YMDeltat.DELTAT.reg = new byte[16]; + if (YMDeltat.ymsnddeltatrom == null) + { + YMDeltat.ymsnddeltatrom = FM.ymsndrom; + } + if (YMDeltat.ymsnddeltatrom == null) + { + YMDeltat.DELTAT.memory_size = 0; + } + else + { + YMDeltat.DELTAT.memory_size = YMDeltat.ymsnddeltatrom.Length; + } + YMDeltat.DELTAT.status_set_handler = F2610.YM2610_deltat_status_set; + YMDeltat.DELTAT.status_reset_handler = F2610.YM2610_deltat_status_reset; + YMDeltat.DELTAT.status_change_EOS_bit = 0x80; + F2610.ym2610_reset_chip(); + FM.Init_ADPCMATable(); + } + public void ym2610_reset_chip() + { + int i; + OPN.OPNSetPres(6 * 24, 6 * 24, 4 * 2); + OPN.ST.SSG.reset(); + OPN.FM_IRQMASK_SET(0x03); + OPN.FM_BUSY_CLEAR(); + OPN.OPNWriteMode(0x27, 0x30); + OPN.eg_timer = 0; + OPN.eg_cnt = 0; + OPN.FM_STATUS_RESET(0xff); + OPN.reset_channels(6); + for (i = 0xb6; i >= 0xb4; i--) + { + OPN.OPNWriteReg(i, 0xc0); + OPN.OPNWriteReg(i | 0x100, 0xc0); + } + for (i = 0xb2; i >= 0x30; i--) + { + OPN.OPNWriteReg(i, 0); + OPN.OPNWriteReg(i | 0x100, 0); + } + for (i = 0x26; i >= 0x20; i--) + { + OPN.OPNWriteReg(i, 0); + } + for (i = 0; i < 6; i++) + { + adpcm[i].step = (uint)((float)(1 << 16) * ((float)F2610.OPN.ST.freqbase) / 3.0); + adpcm[i].now_addr = 0; + adpcm[i].now_step = 0; + adpcm[i].start = 0; + adpcm[i].end = 0; + adpcm[i].vol_mul = 0; + FM.ipan[i] = 3; + adpcm[i].flagMask = (byte)(1 << i); + adpcm[i].flag = 0; + adpcm[i].adpcm_acc = 0; + adpcm[i].adpcm_step = 0; + adpcm[i].adpcm_out = 0; + } + adpcmTL = 0x3f; + adpcm_arrivedEndAddress = 0; + YMDeltat.DELTAT.freqbase = F2610.OPN.ST.freqbase; + YMDeltat.DELTAT.output_pointer = 0; + YMDeltat.DELTAT.portshift = 8; + YMDeltat.DELTAT.output_range = 1 << 23; + YMDeltat.YM_DELTAT_ADPCM_Reset(3, 1); + } + public void ym2610_write(int a, byte v) + { + int addr; + int ch; + v &= 0xff; + switch (a & 3) + { + case 0: + OPN.ST.address = v; + addr_A1 = 0; + if (v < 16) + { + OPN.ST.SSG.write(0, v); + } + break; + case 1: + if (addr_A1 != 0) + break; + addr = OPN.ST.address; + REGS[addr] = v; + switch (addr & 0xf0) + { + case 0x00: + OPN.ST.SSG.write(a, v); + break; + case 0x10: + ym2610_update_request(); + switch (addr) + { + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x19: + case 0x1a: + case 0x1b: + YMDeltat.YM_DELTAT_ADPCM_Write(addr - 0x10, v); + break; + case 0x1c: + { + byte statusmask = (byte)~v; + for (ch = 0; ch < 6; ch++) + { + adpcm[ch].flagMask = (byte)(statusmask & (1 << ch)); + } + YMDeltat.DELTAT.status_change_EOS_bit = (byte)(statusmask & 0x80); + adpcm_arrivedEndAddress &= statusmask; + } + break; + default: + break; + } + break; + case 0x20: + ym2610_update_request(); + OPN.OPNWriteMode(addr, v); + break; + default: + ym2610_update_request(); + OPN.OPNWriteReg(addr, v); + break; + } + break; + case 2: + OPN.ST.address = v; + addr_A1 = 1; + break; + case 3: + if (addr_A1 != 1) + break; + ym2610_update_request(); + addr = OPN.ST.address; + REGS[addr | 0x100] = v; + if (addr < 0x30) + { + FM_ADPCMAWrite(addr, v); + } + else + { + OPN.OPNWriteReg(addr | 0x100, v); + } + break; + } + } + public byte ym2610_read(int a) + { + int addr = OPN.ST.address; + byte ret = 0; + switch (a & 3) + { + case 0: + ret = (byte)(OPN.FM_STATUS_FLAG() & 0x83); + break; + case 1: + if (addr < 16) + { + ret = OPN.ST.SSG.read(); + } + if (addr == 0xff) + { + ret = 0x01; + } + break; + case 2: + ret = adpcm_arrivedEndAddress; + break; + case 3: + ret = 0; + break; + } + return ret; + } + public int ym2610_timer_over(int c) + { + if (c != 0) + { + OPN.TimerBOver(); + } + else + { + ym2610_update_request(); + OPN.TimerAOver(); + if ((OPN.ST.mode & 0x80) != 0) + { + OPN.CSMKeyControll(); + } + } + return OPN.ST.irq; + } + private void FM_ADPCMAWrite(int r, byte v) + { + byte c = (byte)(r & 0x07); + adpcmreg[r] = (byte)(v & 0xff); + switch (r) + { + case 0x00: + if ((v & 0x80) == 0) + { + for (c = 0; c < 6; c++) + { + if (((v >> c) & 1) != 0) + { + adpcm[c].step = (uint)((float)(1 << 16) * ((float)F2610.OPN.ST.freqbase) / 3.0); + adpcm[c].now_addr = adpcm[c].start << 1; + adpcm[c].now_step = 0; + adpcm[c].adpcm_acc = 0; + adpcm[c].adpcm_step = 0; + adpcm[c].adpcm_out = 0; + adpcm[c].flag = 1; + if (pcmbuf == null) + { + adpcm[c].flag = 0; + } + else + { + if (adpcm[c].end >= pcm_size) + { + + } + if (adpcm[c].start >= pcm_size) + { + adpcm[c].flag = 0; + } + } + } + } + } + else + { + for (c = 0; c < 6; c++) + { + if (((v >> c) & 1) != 0) + { + adpcm[c].flag = 0; + } + } + } + break; + case 0x01: + adpcmTL = (byte)((v & 0x3f) ^ 0x3f); + for (c = 0; c < 6; c++) + { + int volume = F2610.adpcmTL + adpcm[c].IL; + if (volume >= 63) + { + adpcm[c].vol_mul = 0; + adpcm[c].vol_shift = 0; + } + else + { + adpcm[c].vol_mul = (sbyte)(15 - (volume & 7)); + adpcm[c].vol_shift = (byte)(1 + (volume >> 3)); + } + adpcm[c].adpcm_out = ((adpcm[c].adpcm_acc * adpcm[c].vol_mul) >> adpcm[c].vol_shift) & ~3; + } + break; + default: + c = (byte)(r & 0x07); + if (c >= 0x06) + return; + switch (r & 0x38) + { + case 0x08: + { + int volume; + adpcm[c].IL = (byte)((v & 0x1f) ^ 0x1f); + volume = adpcmTL + adpcm[c].IL; + if (volume >= 63) /* This is correct, 63 = quiet */ + { + adpcm[c].vol_mul = 0; + adpcm[c].vol_shift = 0; + } + else + { + adpcm[c].vol_mul = (sbyte)(15 - (volume & 7)); + adpcm[c].vol_shift = (byte)(1 + (volume >> 3)); + } + FM.ipan[c] = (v >> 6) & 0x03; + adpcm[c].adpcm_out = ((adpcm[c].adpcm_acc * adpcm[c].vol_mul) >> adpcm[c].vol_shift) & ~3; + } + break; + case 0x10: + case 0x18: + adpcm[c].start = (uint)((F2610.adpcmreg[0x18 + c] * 0x0100 | adpcmreg[0x10 + c]) << 8); + break; + case 0x20: + case 0x28: + adpcm[c].end = (uint)((F2610.adpcmreg[0x28 + c] * 0x0100 | adpcmreg[0x20 + c]) << 8); + adpcm[c].end += (1 << 8) - 1; + break; + } + break; + } + } + public void ym2610_update_one(int offset, int length) + { + int i, j; + OPN.refresh_fc_eg_chan(F2610.OPN.type, 1); + if ((OPN.ST.mode & 0xc0) != 0) + { + if (OPN.CH[2].SLOT[0].Incr == -1) + { + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 0, (int)OPN.SL3.fc[1], F2610.OPN.SL3.kcode[1]); + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 2, (int)OPN.SL3.fc[2], F2610.OPN.SL3.kcode[2]); + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 1, (int)OPN.SL3.fc[0], F2610.OPN.SL3.kcode[0]); + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 3, (int)OPN.CH[2].fc, F2610.OPN.CH[2].kcode); + } + } + else + { + OPN.refresh_fc_eg_chan(F2610.OPN.type, 2); + } + OPN.refresh_fc_eg_chan(F2610.OPN.type, 4); + OPN.refresh_fc_eg_chan(F2610.OPN.type, 5); + 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; + OPN.eg_timer += OPN.eg_timer_add; + while (OPN.eg_timer >= OPN.eg_timer_overflow) + { + OPN.eg_timer -= OPN.eg_timer_overflow; + OPN.eg_cnt++; + OPN.advance_eg_channel(1); + OPN.advance_eg_channel(2); + OPN.advance_eg_channel(4); + OPN.advance_eg_channel(5); + } + OPN.chan_calc(1, 1); + OPN.chan_calc(2, 2); + OPN.chan_calc(4, 4); + OPN.chan_calc(5, 5); + if ((YMDeltat.DELTAT.portstate & 0x80) != 0) + { + YMDeltat.YM_DELTAT_ADPCM_CALC(); + } + for (j = 0; j < 6; j++) + { + if (adpcm[j].flag != 0) + { + ADPCMA_calc_chan(j); + } + } + 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.Limit(lt, 32767, -32768); + rt = FM.Limit(rt, 32767, -32768); + Sound.ym2610stream.streamoutput_Ptrs[0][offset + i] = lt; + Sound.ym2610stream.streamoutput_Ptrs[1][offset + i] = rt; + } + } + public void ym2610b_update_one(int offset, int length) + { + int i, j; + OPN.refresh_fc_eg_chan(F2610.OPN.type, 0); + OPN.refresh_fc_eg_chan(F2610.OPN.type, 1); + if ((OPN.ST.mode & 0xc0) != 0) + { + if (OPN.CH[2].SLOT[0].Incr == -1) + { + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 0, (int)OPN.SL3.fc[1], OPN.SL3.kcode[1]); + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 2, (int)OPN.SL3.fc[2], OPN.SL3.kcode[2]); + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 1, (int)OPN.SL3.fc[0], OPN.SL3.kcode[0]); + OPN.refresh_fc_eg_slot(F2610.OPN.type, 2, 3, (int)OPN.CH[2].fc, OPN.CH[2].kcode); + } + } + else + { + OPN.refresh_fc_eg_chan(F2610.OPN.type, 2); + } + OPN.refresh_fc_eg_chan(F2610.OPN.type, 3); + OPN.refresh_fc_eg_chan(F2610.OPN.type, 4); + OPN.refresh_fc_eg_chan(F2610.OPN.type, 5); + 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[0] = 0; + FM.out_fm[1] = 0; + FM.out_fm[2] = 0; + FM.out_fm[3] = 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) + { + OPN.eg_timer -= OPN.eg_timer_overflow; + OPN.eg_cnt++; + OPN.advance_eg_channel(0); + OPN.advance_eg_channel(1); + OPN.advance_eg_channel(2); + OPN.advance_eg_channel(3); + OPN.advance_eg_channel(4); + OPN.advance_eg_channel(5); + } + OPN.chan_calc(0, 0); + OPN.chan_calc(1, 1); + OPN.chan_calc(2, 2); + OPN.chan_calc(3, 3); + OPN.chan_calc(4, 4); + OPN.chan_calc(5, 5); + if ((YMDeltat.DELTAT.portstate & 0x80) != 0) + { + YMDeltat.YM_DELTAT_ADPCM_CALC(); + } + for (j = 0; j < 6; j++) + { + if (adpcm[j].flag != 0) + { + ADPCMA_calc_chan(j); + } + } + 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[0] >> 1) & OPN.pan[0]); + rt += (int)((FM.out_fm[0] >> 1) & OPN.pan[1]); + 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[3] >> 1) & OPN.pan[6]); + rt += (int)((FM.out_fm[3] >> 1) & OPN.pan[7]); + 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); + Sound.ym2610stream.streamoutput_Ptrs[0][offset + i] = lt; + Sound.ym2610stream.streamoutput_Ptrs[1][offset + i] = rt; + } + } + public void ym2610_postload() + { + byte r; + for (r = 0; r < 16; r++) + { + OPN.ST.SSG.write(0, r); + OPN.ST.SSG.write(1, REGS[r]); + } + for (r = 0x30; r < 0x9e; r++) + { + if ((r & 3) != 3) + { + OPN.OPNWriteReg(r, F2610.REGS[r]); + OPN.OPNWriteReg(r | 0x100, F2610.REGS[r | 0x100]); + } + } + for (r = 0xb0; r < 0xb6; r++) + { + if ((r & 3) != 3) + { + OPN.OPNWriteReg(r, F2610.REGS[r]); + OPN.OPNWriteReg(r | 0x100, F2610.REGS[r | 0x100]); + } + } + FM_ADPCMAWrite(1, F2610.REGS[0x101]); + for (r = 0; r < 6; r++) + { + FM_ADPCMAWrite(r + 0x08, REGS[r + 0x108]); + FM_ADPCMAWrite(r + 0x10, REGS[r + 0x110]); + FM_ADPCMAWrite(r + 0x18, REGS[r + 0x118]); + FM_ADPCMAWrite(r + 0x20, REGS[r + 0x120]); + FM_ADPCMAWrite(r + 0x28, REGS[r + 0x128]); + } + YMDeltat.YM_DELTAT_postload(REGS, 0x010); + } + private void YM2610_deltat_status_set(byte changebits) + { + adpcm_arrivedEndAddress |= changebits; + } + private void YM2610_deltat_status_reset(byte changebits) + { + adpcm_arrivedEndAddress &= (byte)(~changebits); + } + public void SaveStateBinary(BinaryWriter writer) + { + int i, j; + writer.Write(REGS, 0, 512); + writer.Write(addr_A1); + writer.Write(adpcmTL); + writer.Write(adpcmreg, 0, 0x30); + writer.Write(adpcm_arrivedEndAddress); + writer.Write(OPN.ST.freqbase); + writer.Write(OPN.ST.timer_prescaler); + writer.Write(OPN.ST.busy_expiry_time.seconds); + writer.Write(OPN.ST.busy_expiry_time.attoseconds); + writer.Write(OPN.ST.address); + writer.Write(OPN.ST.irq); + writer.Write(OPN.ST.irqmask); + writer.Write(OPN.ST.status); + writer.Write(OPN.ST.mode); + writer.Write(OPN.ST.prescaler_sel); + writer.Write(OPN.ST.fn_h); + writer.Write(OPN.ST.TA); + writer.Write(OPN.ST.TAC); + writer.Write(OPN.ST.TB); + writer.Write(OPN.ST.TBC); + for (i = 0; i < 12; i++) + { + writer.Write(OPN.pan[i]); + } + writer.Write(OPN.eg_cnt); + writer.Write(OPN.eg_timer); + writer.Write(OPN.eg_timer_add); + writer.Write(OPN.eg_timer_overflow); + writer.Write(OPN.lfo_cnt); + writer.Write(OPN.lfo_inc); + for (i = 0; i < 8; i++) + { + writer.Write(OPN.lfo_freq[i]); + } + for (i = 0; i < 6; i++) + { + for (j = 0; j < 4; j++) + { + writer.Write(OPN.CH[i].SLOT[j].KSR); + writer.Write(OPN.CH[i].SLOT[j].ar); + writer.Write(OPN.CH[i].SLOT[j].d1r); + writer.Write(OPN.CH[i].SLOT[j].d2r); + writer.Write(OPN.CH[i].SLOT[j].rr); + writer.Write(OPN.CH[i].SLOT[j].ksr); + writer.Write(OPN.CH[i].SLOT[j].mul); + writer.Write(OPN.CH[i].SLOT[j].phase); + writer.Write(OPN.CH[i].SLOT[j].Incr); + writer.Write(OPN.CH[i].SLOT[j].state); + writer.Write(OPN.CH[i].SLOT[j].tl); + writer.Write(OPN.CH[i].SLOT[j].volume); + writer.Write(OPN.CH[i].SLOT[j].sl); + writer.Write(OPN.CH[i].SLOT[j].vol_out); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_ar); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_ar); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_d1r); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_d1r); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_d2r); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_d2r); + writer.Write(OPN.CH[i].SLOT[j].eg_sh_rr); + writer.Write(OPN.CH[i].SLOT[j].eg_sel_rr); + writer.Write(OPN.CH[i].SLOT[j].ssg); + writer.Write(OPN.CH[i].SLOT[j].ssgn); + writer.Write(OPN.CH[i].SLOT[j].key); + writer.Write(OPN.CH[i].SLOT[j].AMmask); + } + } + for (i = 0; i < 6; i++) + { + writer.Write(adpcm[i].flag); + writer.Write(adpcm[i].flagMask); + writer.Write(adpcm[i].now_data); + writer.Write(adpcm[i].now_addr); + writer.Write(adpcm[i].now_step); + writer.Write(adpcm[i].step); + writer.Write(adpcm[i].start); + writer.Write(adpcm[i].end); + writer.Write(adpcm[i].IL); + writer.Write(adpcm[i].adpcm_acc); + writer.Write(adpcm[i].adpcm_step); + writer.Write(adpcm[i].adpcm_out); + writer.Write(adpcm[i].vol_mul); + writer.Write(adpcm[i].vol_shift); + } + for (i = 0; i < 6; i++) + { + writer.Write(OPN.CH[i].ALGO); + writer.Write(OPN.CH[i].FB); + writer.Write(OPN.CH[i].op1_out0); + writer.Write(OPN.CH[i].op1_out1); + writer.Write(OPN.CH[i].mem_value); + writer.Write(OPN.CH[i].pms); + writer.Write(OPN.CH[i].ams); + writer.Write(OPN.CH[i].fc); + writer.Write(OPN.CH[i].kcode); + writer.Write(OPN.CH[i].block_fnum); + } + for (i = 0; i < 3; i++) + { + writer.Write(OPN.SL3.fc[i]); + } + writer.Write(OPN.SL3.fn_h); + writer.Write(OPN.SL3.kcode, 0, 3); + for (i = 0; i < 3; i++) + { + writer.Write(OPN.SL3.block_fnum[i]); + } + writer.Write(YMDeltat.DELTAT.portstate); + writer.Write(YMDeltat.DELTAT.now_addr); + writer.Write(YMDeltat.DELTAT.now_step); + writer.Write(YMDeltat.DELTAT.acc); + writer.Write(YMDeltat.DELTAT.prev_acc); + writer.Write(YMDeltat.DELTAT.adpcmd); + writer.Write(YMDeltat.DELTAT.adpcml); + } + public void LoadStateBinary(BinaryReader reader) + { + int i, j; + REGS = reader.ReadBytes(512); + addr_A1 = reader.ReadByte(); + adpcmTL = reader.ReadByte(); + adpcmreg = reader.ReadBytes(0x30); + adpcm_arrivedEndAddress = reader.ReadByte(); + OPN.ST.freqbase = reader.ReadDouble(); + OPN.ST.timer_prescaler = reader.ReadInt32(); + OPN.ST.busy_expiry_time.seconds = reader.ReadInt32(); + OPN.ST.busy_expiry_time.attoseconds = reader.ReadInt64(); + OPN.ST.address = reader.ReadByte(); + OPN.ST.irq = reader.ReadByte(); + OPN.ST.irqmask = reader.ReadByte(); + OPN.ST.status = reader.ReadByte(); + OPN.ST.mode = reader.ReadByte(); + OPN.ST.prescaler_sel = reader.ReadByte(); + OPN.ST.fn_h = reader.ReadByte(); + OPN.ST.TA = reader.ReadInt32(); + OPN.ST.TAC = reader.ReadInt32(); + OPN.ST.TB = reader.ReadByte(); + OPN.ST.TBC = reader.ReadInt32(); + for (i = 0; i < 12; i++) + { + OPN.pan[i] = reader.ReadUInt32(); + } + OPN.eg_cnt = reader.ReadUInt32(); + OPN.eg_timer = reader.ReadUInt32(); + OPN.eg_timer_add = reader.ReadUInt32(); + OPN.eg_timer_overflow = reader.ReadUInt32(); + OPN.lfo_cnt = reader.ReadInt32(); + OPN.lfo_inc = reader.ReadInt32(); + for (i = 0; i < 8; i++) + { + OPN.lfo_freq[i] = reader.ReadInt32(); + } + for (i = 0; i < 6; i++) + { + for (j = 0; j < 4; j++) + { + OPN.CH[i].SLOT[j].KSR = reader.ReadByte(); + OPN.CH[i].SLOT[j].ar = reader.ReadInt32(); + OPN.CH[i].SLOT[j].d1r = reader.ReadInt32(); + OPN.CH[i].SLOT[j].d2r = reader.ReadInt32(); + OPN.CH[i].SLOT[j].rr = reader.ReadInt32(); + OPN.CH[i].SLOT[j].ksr = reader.ReadByte(); + OPN.CH[i].SLOT[j].mul = reader.ReadInt32(); + OPN.CH[i].SLOT[j].phase = reader.ReadUInt32(); + OPN.CH[i].SLOT[j].Incr = reader.ReadInt32(); + OPN.CH[i].SLOT[j].state = reader.ReadByte(); + OPN.CH[i].SLOT[j].tl = reader.ReadInt32(); + OPN.CH[i].SLOT[j].volume = reader.ReadInt32(); + OPN.CH[i].SLOT[j].sl = reader.ReadInt32(); + OPN.CH[i].SLOT[j].vol_out = reader.ReadUInt32(); + OPN.CH[i].SLOT[j].eg_sh_ar = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_ar = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sh_d1r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_d1r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sh_d2r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_d2r = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sh_rr = reader.ReadByte(); + OPN.CH[i].SLOT[j].eg_sel_rr = reader.ReadByte(); + OPN.CH[i].SLOT[j].ssg = reader.ReadByte(); + OPN.CH[i].SLOT[j].ssgn = reader.ReadByte(); + OPN.CH[i].SLOT[j].key = reader.ReadUInt32(); + OPN.CH[i].SLOT[j].AMmask = reader.ReadUInt32(); + } + } + for (i = 0; i < 6; i++) + { + adpcm[i].flag = reader.ReadByte(); + adpcm[i].flagMask = reader.ReadByte(); + adpcm[i].now_data = reader.ReadByte(); + adpcm[i].now_addr = reader.ReadUInt32(); + adpcm[i].now_step = reader.ReadUInt32(); + adpcm[i].step = reader.ReadUInt32(); + adpcm[i].start = reader.ReadUInt32(); + adpcm[i].end = reader.ReadUInt32(); + adpcm[i].IL = reader.ReadByte(); + adpcm[i].adpcm_acc = reader.ReadInt32(); + adpcm[i].adpcm_step = reader.ReadInt32(); + adpcm[i].adpcm_out = reader.ReadInt32(); + adpcm[i].vol_mul = reader.ReadSByte(); + adpcm[i].vol_shift = reader.ReadByte(); + } + for (i = 0; i < 6; i++) + { + OPN.CH[i].ALGO = reader.ReadByte(); + OPN.CH[i].FB = reader.ReadByte(); + OPN.CH[i].op1_out0 = reader.ReadInt32(); + OPN.CH[i].op1_out1 = reader.ReadInt32(); + OPN.CH[i].mem_value = reader.ReadInt32(); + OPN.CH[i].pms = reader.ReadInt32(); + OPN.CH[i].ams = reader.ReadByte(); + OPN.CH[i].fc = reader.ReadUInt32(); + OPN.CH[i].kcode = reader.ReadByte(); + OPN.CH[i].block_fnum = reader.ReadUInt32(); + } + for (i = 0; i < 3; i++) + { + OPN.SL3.fc[i] = reader.ReadUInt32(); + } + OPN.SL3.fn_h = reader.ReadByte(); + OPN.SL3.kcode = reader.ReadBytes(3); + for (i = 0; i < 3; i++) + { + OPN.SL3.block_fnum[i] = reader.ReadUInt32(); + } + YMDeltat.DELTAT.portstate = reader.ReadByte(); + YMDeltat.DELTAT.now_addr = reader.ReadInt32(); + YMDeltat.DELTAT.now_step = reader.ReadInt32(); + YMDeltat.DELTAT.acc = reader.ReadInt32(); + YMDeltat.DELTAT.prev_acc = reader.ReadInt32(); + YMDeltat.DELTAT.adpcmd = reader.ReadInt32(); + YMDeltat.DELTAT.adpcml = reader.ReadInt32(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2610.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2610.cs.meta new file mode 100644 index 00000000..deefaff5 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM2610.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc334660010ee054e97f8302cca8e62e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM3812.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM3812.cs new file mode 100644 index 00000000..8611b4d9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM3812.cs @@ -0,0 +1,382 @@ +using System.IO; + +namespace MAME.Core +{ + public class YM3812 + { + public static EmuTimer.emu_timer[] timer; + public delegate void ym3812_delegate(LineState linestate); + public static ym3812_delegate ym3812handler; + public static void IRQHandler_3812(int irq) + { + if (ym3812handler != null) + { + ym3812handler(irq != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void timer_callback_3812_0() + { + FMOpl.ym3812_timer_over(0); + } + public static void timer_callback_3812_1() + { + FMOpl.ym3812_timer_over(1); + } + private static void TimerHandler_3812(int c, Atime period) + { + if (Attotime.attotime_compare(period, Attotime.ATTOTIME_ZERO) == 0) + { + EmuTimer.timer_enable(timer[c], false); + } + else + { + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + } + } + public static void _stream_update_3812(int interval) + { + Sound.ym3812stream.stream_update(); + } + public static void ym3812_start(int clock) + { + FMOpl.tl_tab = new int[0x1800]; + FMOpl.sin_tab = new uint[0x1000]; + timer = new EmuTimer.emu_timer[2]; + int rate = clock / 72; + switch (Machine.sName) + { + case "pcktgal": + case "pcktgalb": + case "pcktgal2": + case "pcktgal2j": + case "spool3": + case "spool3i": + ym3812handler = null; + break; + case "starfigh": + ym3812handler = null; + break; + case "drgnwrld": + case "drgnwrldv30": + case "drgnwrldv21": + case "drgnwrldv21j": + case "drgnwrldv20j": + case "drgnwrldv10c": + case "drgnwrldv11h": + case "drgnwrldv40k": + ym3812handler = null; + break; + default: + ym3812handler = null; + break; + } + FMOpl.ym3812_init(0, clock, rate); + FMOpl.ym3812_set_timer_handler(TimerHandler_3812); + FMOpl.ym3812_set_irq_handler(IRQHandler_3812); + FMOpl.ym3812_set_update_handler(_stream_update_3812); + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3812_0, false); + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3812_1, false); + } + public static void ym3812_control_port_0_w(byte data) + { + FMOpl.ym3812_write(0, data); + } + public static void ym3812_write_port_0_w(byte data) + { + FMOpl.ym3812_write(1, data); + } + public static void SaveStateBinary(BinaryWriter writer) + { + int i, j; + for (i = 0; i < 9; i++) + { + writer.Write(FMOpl.YM3812.P_CH[i].block_fnum); + writer.Write(FMOpl.YM3812.P_CH[i].kcode); + for (j = 0; j < 2; j++) + { + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].ar); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].dr); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].rr); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].KSR); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].ksl); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].ksr); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].mul); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].Cnt); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].FB); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].op1_out[0]); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].op1_out[1]); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].CON); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].eg_type); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].state); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].TL); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].volume); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].sl); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].key); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].AMmask); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].vib); + writer.Write(FMOpl.YM3812.P_CH[i].SLOT[j].wavetable); + } + } + writer.Write(FMOpl.YM3812.eg_cnt); + writer.Write(FMOpl.YM3812.eg_timer); + writer.Write(FMOpl.YM3812.rhythm); + writer.Write(FMOpl.YM3812.lfo_am_depth); + writer.Write(FMOpl.YM3812.lfo_pm_depth_range); + writer.Write(FMOpl.YM3812.lfo_am_cnt); + writer.Write(FMOpl.YM3812.lfo_pm_cnt); + writer.Write(FMOpl.YM3812.noise_rng); + writer.Write(FMOpl.YM3812.noise_p); + writer.Write(FMOpl.YM3812.wavesel); + for (i = 0; i < 2; i++) + { + writer.Write(FMOpl.YM3812.T[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(FMOpl.YM3812.st[i]); + } + writer.Write(FMOpl.YM3812.address); + writer.Write(FMOpl.YM3812.status); + writer.Write(FMOpl.YM3812.statusmask); + writer.Write(FMOpl.YM3812.mode); + } + public static void LoadStateBinary(BinaryReader reader) + { + int i, j; + for (i = 0; i < 9; i++) + { + FMOpl.YM3812.P_CH[i].block_fnum = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].kcode = reader.ReadByte(); + for (j = 0; j < 2; j++) + { + FMOpl.YM3812.P_CH[i].SLOT[j].ar = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].dr = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].rr = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].KSR = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].ksl = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].ksr = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].mul = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].Cnt = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].FB = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].op1_out[0] = reader.ReadInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].op1_out[1] = reader.ReadInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].CON = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].eg_type = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].state = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].TL = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].volume = reader.ReadInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].sl = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].key = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].AMmask = reader.ReadUInt32(); + FMOpl.YM3812.P_CH[i].SLOT[j].vib = reader.ReadByte(); + FMOpl.YM3812.P_CH[i].SLOT[j].wavetable = reader.ReadUInt16(); + } + } + FMOpl.YM3812.eg_cnt = reader.ReadUInt32(); + FMOpl.YM3812.eg_timer = reader.ReadUInt32(); + FMOpl.YM3812.rhythm = reader.ReadByte(); + FMOpl.YM3812.lfo_am_depth = reader.ReadByte(); + FMOpl.YM3812.lfo_pm_depth_range = reader.ReadByte(); + FMOpl.YM3812.lfo_am_cnt = reader.ReadUInt32(); + FMOpl.YM3812.lfo_pm_cnt = reader.ReadUInt32(); + FMOpl.YM3812.noise_rng = reader.ReadUInt32(); + FMOpl.YM3812.noise_p = reader.ReadUInt32(); + FMOpl.YM3812.wavesel = reader.ReadByte(); + for (i = 0; i < 2; i++) + { + FMOpl.YM3812.T[i] = reader.ReadUInt32(); + } + for (i = 0; i < 2; i++) + { + FMOpl.YM3812.st[i] = reader.ReadByte(); + } + FMOpl.YM3812.address = reader.ReadByte(); + FMOpl.YM3812.status = reader.ReadByte(); + FMOpl.YM3812.statusmask = reader.ReadByte(); + FMOpl.YM3812.mode = reader.ReadByte(); + } + public static void IRQHandler_3526(int irq) + { + if (ym3812handler != null) + { + ym3812handler(irq != 0 ? LineState.ASSERT_LINE : LineState.CLEAR_LINE); + } + } + public static void timer_callback_3526_0() + { + FMOpl.ym3526_timer_over(0); + } + public static void timer_callback_3526_1() + { + FMOpl.ym3812_timer_over(1); + } + public static void TimerHandler_3526(int c, Atime period) + { + if (Attotime.attotime_compare(period, Attotime.ATTOTIME_ZERO) == 0) + { + EmuTimer.timer_enable(timer[c], false); + } + else + { + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + } + } + public static void _stream_update_3526(int interval) + { + Sound.ym3526stream.stream_update(); + } + public static void ym3526_start(int clock) + { + int rate = clock / 72; + FMOpl.YM3526 = FMOpl.ym3526_init(0, clock, rate); + timer = new EmuTimer.emu_timer[2]; + FMOpl.ym3526_set_timer_handler(TimerHandler_3526); + FMOpl.ym3526_set_irq_handler(IRQHandler_3526); + FMOpl.ym3526_set_update_handler(_stream_update_3526); + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3526_0, false); + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3526_1, false); + } + public static void ym3526_control_port_0_w(byte data) + { + FMOpl.ym3526_write(0, data); + } + public static void ym3526_write_port_0_w(byte data) + { + FMOpl.ym3526_write(1, data); + } + public static byte ym3526_status_port_0_r() + { + return FMOpl.ym3526_read(0); + } + public static byte ym3526_read_port_0_r() + { + return FMOpl.ym3526_read(1); + } + public static void ym3526_control_port_1_w(byte data) + { + FMOpl.ym3526_write(0, data); + } + public static void ym3526_write_port_1_w(byte data) + { + FMOpl.ym3526_write(1, data); + } + public static byte ym3526_status_port_1_r() + { + return FMOpl.ym3526_read(0); + } + public static byte ym3526_read_port_1_r() + { + return FMOpl.ym3526_read(1); + } + public static void SaveStateBinary_YM3526(BinaryWriter writer) + { + int i, j; + for (i = 0; i < 9; i++) + { + writer.Write(FMOpl.YM3526.P_CH[i].block_fnum); + writer.Write(FMOpl.YM3526.P_CH[i].kcode); + for (j = 0; j < 2; j++) + { + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].ar); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].dr); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].rr); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].KSR); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].ksl); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].ksr); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].mul); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].Cnt); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].FB); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].op1_out[0]); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].op1_out[1]); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].CON); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].eg_type); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].state); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].TL); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].volume); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].sl); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].key); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].AMmask); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].vib); + writer.Write(FMOpl.YM3526.P_CH[i].SLOT[j].wavetable); + } + } + writer.Write(FMOpl.YM3526.eg_cnt); + writer.Write(FMOpl.YM3526.eg_timer); + writer.Write(FMOpl.YM3526.rhythm); + writer.Write(FMOpl.YM3526.lfo_am_depth); + writer.Write(FMOpl.YM3526.lfo_pm_depth_range); + writer.Write(FMOpl.YM3526.lfo_am_cnt); + writer.Write(FMOpl.YM3526.lfo_pm_cnt); + writer.Write(FMOpl.YM3526.noise_rng); + writer.Write(FMOpl.YM3526.noise_p); + writer.Write(FMOpl.YM3526.wavesel); + for (i = 0; i < 2; i++) + { + writer.Write(FMOpl.YM3526.T[i]); + } + for (i = 0; i < 2; i++) + { + writer.Write(FMOpl.YM3526.st[i]); + } + writer.Write(FMOpl.YM3526.address); + writer.Write(FMOpl.YM3526.status); + writer.Write(FMOpl.YM3526.statusmask); + writer.Write(FMOpl.YM3526.mode); + } + public static void LoadStateBinary_YM3526(BinaryReader reader) + { + int i, j; + for (i = 0; i < 9; i++) + { + FMOpl.YM3526.P_CH[i].block_fnum = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].kcode = reader.ReadByte(); + for (j = 0; j < 2; j++) + { + FMOpl.YM3526.P_CH[i].SLOT[j].ar = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].dr = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].rr = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].KSR = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].ksl = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].ksr = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].mul = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].Cnt = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].FB = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].op1_out[0] = reader.ReadInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].op1_out[1] = reader.ReadInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].CON = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].eg_type = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].state = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].TL = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].volume = reader.ReadInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].sl = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].key = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].AMmask = reader.ReadUInt32(); + FMOpl.YM3526.P_CH[i].SLOT[j].vib = reader.ReadByte(); + FMOpl.YM3526.P_CH[i].SLOT[j].wavetable = reader.ReadUInt16(); + } + } + FMOpl.YM3526.eg_cnt = reader.ReadUInt32(); + FMOpl.YM3526.eg_timer = reader.ReadUInt32(); + FMOpl.YM3526.rhythm = reader.ReadByte(); + FMOpl.YM3526.lfo_am_depth = reader.ReadByte(); + FMOpl.YM3526.lfo_pm_depth_range = reader.ReadByte(); + FMOpl.YM3526.lfo_am_cnt = reader.ReadUInt32(); + FMOpl.YM3526.lfo_pm_cnt = reader.ReadUInt32(); + FMOpl.YM3526.noise_rng = reader.ReadUInt32(); + FMOpl.YM3526.noise_p = reader.ReadUInt32(); + FMOpl.YM3526.wavesel = reader.ReadByte(); + for (i = 0; i < 2; i++) + { + FMOpl.YM3526.T[i] = reader.ReadUInt32(); + } + for (i = 0; i < 2; i++) + { + FMOpl.YM3526.st[i] = reader.ReadByte(); + } + FMOpl.YM3526.address = reader.ReadByte(); + FMOpl.YM3526.status = reader.ReadByte(); + FMOpl.YM3526.statusmask = reader.ReadByte(); + FMOpl.YM3526.mode = reader.ReadByte(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM3812.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM3812.cs.meta new file mode 100644 index 00000000..de4da489 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YM3812.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5eb9ee5f51817e14cb838d198f829555 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YMDeltat.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YMDeltat.cs new file mode 100644 index 00000000..41ca872b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YMDeltat.cs @@ -0,0 +1,396 @@ +namespace MAME.Core +{ + public class YMDeltat + { + public struct YM_DELTAT + { + public int output_pointer; + public int pan_offset; + public double freqbase; + public int memory_size; + public int output_range; + public int now_addr; + public int now_step; + public int step; + public int start; + public int limit; + public int end; + public int delta; + public int volume; + public int acc; + public int adpcmd; + public int adpcml; + public int prev_acc; + public byte now_data; + public byte CPU_data; + public byte portstate; + public byte control2; + public byte portshift; + public byte DRAMportshift; + public byte memread; + public status_callback status_set_handler; + public status_callback status_reset_handler; + public byte status_change_EOS_bit; + public byte status_change_BRDY_bit; + public byte status_change_ZERO_bit; + public byte PCM_BSY; + public byte[] reg; + public byte emulation_mode; + } + public delegate void status_callback(byte b1); + public static YM_DELTAT DELTAT; + public static byte[] ymsnddeltatrom; + private static int YM_DELTAT_DELTA_MAX = 24576; + private static int YM_DELTAT_DELTA_MIN = 127; + private static int YM_DELTAT_DELTA_DEF = 127; + private static int YM_DELTAT_DECODE_RANGE = 32768; + private static int YM_DELTAT_DECODE_MIN = -YM_DELTAT_DECODE_RANGE; + private static int YM_DELTAT_DECODE_MAX = YM_DELTAT_DECODE_RANGE - 1; + private static int[] ym_deltat_decode_tableB1 = new int[16]{ + 1, 3, 5, 7, 9, 11, 13, 15, + -1, -3, -5, -7, -9, -11, -13, -15, + }; + private static int[] ym_deltat_decode_tableB2 = new int[16]{ + 57, 57, 57, 57, 77, 102, 128, 153, + 57, 57, 57, 57, 77, 102, 128, 153 + }; + private static byte[] dram_rightshift = new byte[4] { 3, 0, 0, 0 }; + public static void YM_DELTAT_ADPCM_Write(int r, byte v) + { + if (r >= 0x10) + { + return; + } + DELTAT.reg[r] = v; + switch (r) + { + case 0x00: + if (DELTAT.emulation_mode == 1) + { + v |= 0x20; + } + DELTAT.portstate = (byte)(v & (0x80 | 0x40 | 0x20 | 0x10 | 0x01)); + if ((DELTAT.portstate & 0x80) != 0) + { + DELTAT.PCM_BSY = 1; + DELTAT.now_step = 0; + DELTAT.acc = 0; + DELTAT.prev_acc = 0; + DELTAT.adpcml = 0; + DELTAT.adpcmd = YM_DELTAT_DELTA_DEF; + DELTAT.now_data = 0; + } + if ((DELTAT.portstate & 0x20) != 0) + { + DELTAT.now_addr = DELTAT.start << 1; + DELTAT.memread = 2; + if (ymsnddeltatrom == null) + { + DELTAT.portstate = 0x00; + DELTAT.PCM_BSY = 0; + } + else + { + if (DELTAT.end >= DELTAT.memory_size) + { + DELTAT.end = DELTAT.memory_size - 1; + } + if (DELTAT.start >= DELTAT.memory_size) + { + DELTAT.portstate = 0x00; + DELTAT.PCM_BSY = 0; + } + } + } + else + { + DELTAT.now_addr = 0; + } + if ((DELTAT.portstate & 0x01) != 0) + { + DELTAT.portstate = 0x00; + DELTAT.PCM_BSY = 0; + if (DELTAT.status_set_handler != null) + { + if (DELTAT.status_change_BRDY_bit != 0) + { + DELTAT.status_set_handler(DELTAT.status_change_BRDY_bit); + } + } + } + break; + case 0x01: + /* handle emulation mode */ + if (DELTAT.emulation_mode == 1) + { + v |= 0x01; + } + DELTAT.pan_offset = (v >> 6) & 0x03; + if ((DELTAT.control2 & 3) != (v & 3)) + { + if (DELTAT.DRAMportshift != dram_rightshift[v & 3]) + { + DELTAT.DRAMportshift = dram_rightshift[v & 3]; + DELTAT.start = (DELTAT.reg[0x3] * 0x0100 | DELTAT.reg[0x2]) << (DELTAT.portshift - DELTAT.DRAMportshift); + DELTAT.end = (DELTAT.reg[0x5] * 0x0100 | DELTAT.reg[0x4]) << (DELTAT.portshift - DELTAT.DRAMportshift); + DELTAT.end += (1 << (DELTAT.portshift - DELTAT.DRAMportshift)) - 1; + DELTAT.limit = (DELTAT.reg[0xd] * 0x0100 | DELTAT.reg[0xc]) << (DELTAT.portshift - DELTAT.DRAMportshift); + } + } + DELTAT.control2 = v; + break; + case 0x02: + case 0x03: + DELTAT.start = (DELTAT.reg[0x3] * 0x0100 | DELTAT.reg[0x2]) << (DELTAT.portshift - DELTAT.DRAMportshift); + break; + case 0x04: + case 0x05: + DELTAT.end = (DELTAT.reg[0x5] * 0x0100 | DELTAT.reg[0x4]) << (DELTAT.portshift - DELTAT.DRAMportshift); + DELTAT.end += (1 << (DELTAT.portshift - DELTAT.DRAMportshift)) - 1; + break; + case 0x06: + case 0x07: + break; + case 0x08: + if ((DELTAT.portstate & 0xe0) == 0x60) + { + if (DELTAT.memread != 0) + { + DELTAT.now_addr = DELTAT.start << 1; + DELTAT.memread = 0; + } + if (DELTAT.now_addr != (DELTAT.end << 1)) + { + ymsnddeltatrom[DELTAT.now_addr >> 1] = v; + DELTAT.now_addr += 2; + if (DELTAT.status_reset_handler != null) + { + if (DELTAT.status_change_BRDY_bit != 0) + { + DELTAT.status_reset_handler(DELTAT.status_change_BRDY_bit); + } + } + if (DELTAT.status_set_handler != null) + { + if (DELTAT.status_change_BRDY_bit != 0) + { + DELTAT.status_set_handler(DELTAT.status_change_BRDY_bit); + } + } + } + else + { + if (DELTAT.status_set_handler != null) + { + if (DELTAT.status_change_EOS_bit != 0) + { + DELTAT.status_set_handler(DELTAT.status_change_EOS_bit); + } + } + } + return; + } + if ((DELTAT.portstate & 0xe0) == 0x80) + { + DELTAT.CPU_data = v; + if (DELTAT.status_reset_handler != null) + { + if (DELTAT.status_change_BRDY_bit != 0) + { + DELTAT.status_reset_handler(DELTAT.status_change_BRDY_bit); + } + } + return; + } + break; + case 0x09: + case 0x0a: + DELTAT.delta = (DELTAT.reg[0xa] * 0x0100 | DELTAT.reg[0x9]); + DELTAT.step = (int)(DELTAT.delta * DELTAT.freqbase); + break; + case 0x0b: + { + int oldvol = DELTAT.volume; + DELTAT.volume = (v & 0xff) * (DELTAT.output_range / 256) / YM_DELTAT_DECODE_RANGE; + if (oldvol != 0) + { + DELTAT.adpcml = (int)((double)DELTAT.adpcml / (double)oldvol * (double)DELTAT.volume); + } + } + break; + case 0x0c: + case 0x0d: + DELTAT.limit = (DELTAT.reg[0xd] * 0x0100 | DELTAT.reg[0xc]) << (DELTAT.portshift - DELTAT.DRAMportshift); + break; + } + } + public static void YM_DELTAT_ADPCM_Reset(int pan, int emulation_mode) + { + DELTAT.now_addr = 0; + DELTAT.now_step = 0; + DELTAT.step = 0; + DELTAT.start = 0; + DELTAT.end = 0; + DELTAT.limit = -1; + DELTAT.volume = 0; + DELTAT.pan_offset = 0; + DELTAT.acc = 0; + DELTAT.prev_acc = 0; + DELTAT.adpcmd = 127; + DELTAT.adpcml = 0; + DELTAT.emulation_mode = (byte)emulation_mode; + DELTAT.portstate = (emulation_mode == 1) ? (byte)0x20 : (byte)0; + DELTAT.control2 = (emulation_mode == 1) ? (byte)0x01 : (byte)0; + DELTAT.DRAMportshift = dram_rightshift[DELTAT.control2 & 3]; + if (DELTAT.status_set_handler != null) + { + if (DELTAT.status_change_BRDY_bit != 0) + { + DELTAT.status_set_handler(DELTAT.status_change_BRDY_bit); + } + } + } + public static void YM_DELTAT_postload(byte[] regs, int offset) + { + int r; + DELTAT.volume = 0; + for (r = 1; r < 16; r++) + { + YM_DELTAT_ADPCM_Write(r, regs[offset + r]); + } + DELTAT.reg[0] = regs[offset]; + if (ymsnddeltatrom != null) + { + DELTAT.now_data = ymsnddeltatrom[DELTAT.now_addr >> 1]; + } + } + private static int Limit(int val, int max, int min) + { + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + else + { + return val; + } + } + private static void YM_DELTAT_synthesis_from_external_memory() + { + int step; + int data; + DELTAT.now_step += DELTAT.step; + if (DELTAT.now_step >= (1 << 16)) + { + step = DELTAT.now_step >> 16; + DELTAT.now_step &= (1 << 16) - 1; + do + { + if (DELTAT.now_addr == (DELTAT.limit << 1)) + { + DELTAT.now_addr = 0; + } + if (DELTAT.now_addr == (DELTAT.end << 1)) + { + if ((DELTAT.portstate & 0x10) != 0) + { + DELTAT.now_addr = DELTAT.start << 1; + DELTAT.acc = 0; + DELTAT.adpcmd = YM_DELTAT_DELTA_DEF; + DELTAT.prev_acc = 0; + } + else + { + if (DELTAT.status_set_handler != null) + { + if (DELTAT.status_change_EOS_bit != 0) + { + DELTAT.status_set_handler(DELTAT.status_change_EOS_bit); + } + } + DELTAT.PCM_BSY = 0; + DELTAT.portstate = 0; + DELTAT.adpcml = 0; + DELTAT.prev_acc = 0; + return; + } + } + if ((DELTAT.now_addr & 1) != 0) + { + data = DELTAT.now_data & 0x0f; + } + else + { + DELTAT.now_data = ymsnddeltatrom[DELTAT.now_addr >> 1]; + data = DELTAT.now_data >> 4; + } + DELTAT.now_addr++; + DELTAT.now_addr &= ((1 << (24 + 1)) - 1); + DELTAT.prev_acc = DELTAT.acc; + DELTAT.acc += (ym_deltat_decode_tableB1[data] * DELTAT.adpcmd / 8); + DELTAT.acc = Limit(DELTAT.acc, YM_DELTAT_DECODE_MAX, YM_DELTAT_DECODE_MIN); + DELTAT.adpcmd = (DELTAT.adpcmd * ym_deltat_decode_tableB2[data]) / 64; + DELTAT.adpcmd = Limit(DELTAT.adpcmd, YM_DELTAT_DELTA_MAX, YM_DELTAT_DELTA_MIN); + } while ((--step) != 0); + } + 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; + } + private static void YM_DELTAT_synthesis_from_CPU_memory() + { + int step; + int data; + DELTAT.now_step += DELTAT.step; + if (DELTAT.now_step >= (1 << 16)) + { + step = DELTAT.now_step >> 16; + DELTAT.now_step &= (1 << 16) - 1; + do + { + if ((DELTAT.now_addr & 1) != 0) + { + data = DELTAT.now_data & 0x0f; + DELTAT.now_data = DELTAT.CPU_data; + if (DELTAT.status_set_handler != null) + if (DELTAT.status_change_BRDY_bit != 0) + DELTAT.status_set_handler(DELTAT.status_change_BRDY_bit); + } + else + { + data = DELTAT.now_data >> 4; + } + DELTAT.now_addr++; + DELTAT.prev_acc = DELTAT.acc; + DELTAT.acc += (ym_deltat_decode_tableB1[data] * DELTAT.adpcmd / 8); + DELTAT.acc = Limit(DELTAT.acc, YM_DELTAT_DECODE_MAX, YM_DELTAT_DECODE_MIN); + DELTAT.adpcmd = (DELTAT.adpcmd * ym_deltat_decode_tableB2[data]) / 64; + DELTAT.adpcmd = Limit(DELTAT.adpcmd, YM_DELTAT_DELTA_MAX, YM_DELTAT_DELTA_MIN); + } while ((--step) != 0); + } + 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; + } + public static void YM_DELTAT_ADPCM_CALC() + { + if ((DELTAT.portstate & 0xe0) == 0xa0) + { + YM_DELTAT_synthesis_from_external_memory(); + return; + } + if ((DELTAT.portstate & 0xe0) == 0x80) + { + YM_DELTAT_synthesis_from_CPU_memory(); + return; + } + return; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YMDeltat.cs.meta b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YMDeltat.cs.meta new file mode 100644 index 00000000..078aa10e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/YMDeltat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe494a27a95e9c04a8a4dc1bf8e89954 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef index 252c0609..05af0da8 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef @@ -4,7 +4,8 @@ "references": [ "AxiReplay", "VirtualNes.Core", - "UIEffect2018" + "UIEffect2018", + "Mame.Core" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UMAME.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UMAME.cs index b49c686c..b885f896 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UMAME.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UMAME.cs @@ -170,17 +170,36 @@ public class UMAME : MonoBehaviour, IEmuCore if (bLogicUpdatePause) { - //ɼ֡Input - mUniKeyboard.UpdateInputKey(); - //һ֡ - //emu.UnlockNextFreme(); - //֡ - emu.UpdateFrame(); + PushEmulatorFrame(); + if (InGameUI.Instance.IsNetPlay) + FixEmulatorFrame(); } - mUniVideoPlayer.ApplyFilterEffect(); mUniVideoPlayer.ApplyScreenScaler(); } + + //Ƿ֡Ч + void FixEmulatorFrame() + { + var skipFrameCount = App.roomMgr.netReplay.GetSkipFrameCount(); + if (skipFrameCount > 0) App.log.Debug($"SKIP FRAME : {skipFrameCount}"); + for (var i = 0; i < skipFrameCount; i++) + if (!PushEmulatorFrame()) + break; + } + + bool PushEmulatorFrame() + { + //ɼ֡Input + bool bhadNext = mUniKeyboard.SampleInput(); + //δյInput,֡ƽ + if (!bhadNext) return false; + //һ֡ + //emu.UnlockNextFreme(); + //֡ + emu.UpdateFrame(); + return true; + } public void SaveReplay() { string Path = SavePath + Machine.sName + ".rp"; diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UniInterface/UniKeyboard.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UniInterface/UniKeyboard.cs index 3c5ed6c8..fc5aae48 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UniInterface/UniKeyboard.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/MameEmulator/UniInterface/UniKeyboard.cs @@ -1,5 +1,9 @@ +using AxibugEmuOnline.Client; +using AxibugEmuOnline.Client.ClientCore; using AxibugEmuOnline.Client.Event; +using AxiReplay; using MAME.Core; +using System; using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -20,16 +24,16 @@ public class UniKeyboard : MonoBehaviour, IKeyboard public ulong GetPressedKeys() { ulong InputData; - if (!bReplayMode) - InputData = mPlayMode.GetPressedKeys(); - else - InputData = mReplayMode.GetPressedKeys(); - return InputData; + if (!bReplayMode)//ģʽ + return mPlayMode.GetPressedKeys(); + else//Replayģʽ + return mReplayMode.GetPressedKeys(); } - public void UpdateInputKey() + public bool SampleInput() { - UpdateLogic(); + if (bReplayMode) return true; + return mPlayMode.SampleInput(); } #region @@ -46,37 +50,96 @@ public class UniKeyboard : MonoBehaviour, IKeyboard mReplayMode = new ReplayMode(); } - public void UpdateLogic() + public static IEnumerable GetInputpDataToMotionKey(ulong inputdata) { - if (bReplayMode) return; - mPlayMode.UpdateLogic(); + if (inputdata == 0) + yield break; + for (int i = 0; i < MotionKey.AllNeedCheckList.Length; i++) + { + if ((inputdata & MotionKey.AllNeedCheckList[i]) > 0) + yield return MotionKey.GetKeyName(MotionKey.AllNeedCheckList[i]); + } } public class PlayMode { UniKeyboard mUniKeyboard; - ulong tempInputAllData = 0; - public ulong CurryInpuAllData = 0; + public ulong CurrLocalInpuAllData = 0; + public ulong CurrRemoteInpuAllData = 0; public PlayMode(UniKeyboard uniKeyboard) { this.mUniKeyboard = uniKeyboard; } - public void UpdateLogic() - { - tempInputAllData = 0; - tempInputAllData |= mUniKeyboard.ControllerMapper.Controller0.GetSingleAllInput(); - tempInputAllData |= mUniKeyboard.ControllerMapper.Controller1.GetSingleAllInput(); - tempInputAllData |= mUniKeyboard.ControllerMapper.Controller2.GetSingleAllInput(); - tempInputAllData |= mUniKeyboard.ControllerMapper.Controller3.GetSingleAllInput(); - CurryInpuAllData = tempInputAllData; - } - public ulong GetPressedKeys() { - UMAME.instance.mReplayWriter.NextFramebyFrameIdx((int)UMAME.instance.mUniVideoPlayer.mFrame, CurryInpuAllData); - return CurryInpuAllData; + if (InGameUI.Instance.IsNetPlay) + return CurrRemoteInpuAllData; + else + return CurrLocalInpuAllData; } + + public bool SampleInput() + { + //Netģʽ + if (InGameUI.Instance.IsNetPlay) + { + bool bHadNetData = false; + int targetFrame; ReplayStep replayData; int frameDiff; bool inputDiff; + if (App.roomMgr.netReplay.TryGetNextFrame((int)UMAME.instance.Frame, out replayData, out frameDiff, out inputDiff)) + { + if (inputDiff) + { + App.log.Debug($"{DateTime.Now.ToString("hh:mm:ss.fff")} TryGetNextFrame remoteFrame->{App.roomMgr.netReplay.mRemoteFrameIdx} diff->{frameDiff} " + + $"frame=>{replayData.FrameStartID} InPut=>{replayData.InPut}"); + } + CurrRemoteInpuAllData = replayData.InPut; + + bHadNetData = true; + } + else// + { + CurrRemoteInpuAllData = 0; + } + //ͱز + App.roomMgr.SendRoomSingelPlayerInput(UMAME.instance.Frame, DoLocalPressedKeys()); + return bHadNetData; + } + //ģʽ + else + { + DoLocalPressedKeys(); + return true; + } + } + + ulong DoLocalPressedKeys() + { + ulong tempLocalInputAllData = 0; + tempLocalInputAllData |= mUniKeyboard.ControllerMapper.Controller0.GetSingleAllInput(); + tempLocalInputAllData |= mUniKeyboard.ControllerMapper.Controller1.GetSingleAllInput(); + tempLocalInputAllData |= mUniKeyboard.ControllerMapper.Controller2.GetSingleAllInput(); + tempLocalInputAllData |= mUniKeyboard.ControllerMapper.Controller3.GetSingleAllInput(); + +#if UNITY_EDITOR + if (CurrLocalInpuAllData != tempLocalInputAllData) + { + string ShowKeyNames = string.Empty; + foreach (string keyname in GetInputpDataToMotionKey(CurrLocalInpuAllData)) + { + ShowKeyNames += keyname + " |"; + } + Debug.Log("GetPressedKeys=>" + ShowKeyNames); + } +#endif + + CurrLocalInpuAllData = tempLocalInputAllData; + //дreplay + UMAME.instance.mReplayWriter.NextFramebyFrameIdx((int)UMAME.instance.mUniVideoPlayer.mFrame, CurrLocalInpuAllData); + + return CurrLocalInpuAllData; + } + } public class ReplayMode { @@ -93,6 +156,14 @@ public class UniKeyboard : MonoBehaviour, IKeyboard //б仯 if (UMAME.instance.mReplayReader.NextFramebyFrameIdx(targetFrame, out stepData)) { +#if UNITY_EDITOR + string ShowKeyNames = string.Empty; + foreach (string keyname in GetInputpDataToMotionKey(currInputData)) + { + ShowKeyNames += keyname + " |"; + } + Debug.Log("GetPressedKeys=>" + ShowKeyNames); +#endif currInputData = stepData.InPut; } return currInputData; @@ -187,7 +258,7 @@ public class MameSingleConoller : IController UP, DOWN, LEFT, RIGHT, BTN_A, BTN_B, BTN_C, BTN_D, BTN_E, BTN_F; - public MotionKey tg_INSERT_COIN, tg_GAMESTART, + public ulong tg_INSERT_COIN, tg_GAMESTART, tg_UP, tg_DOWN, tg_LEFT, tg_RIGHT, tg_BTN_A, tg_BTN_B, tg_BTN_C, tg_BTN_D, tg_BTN_E, tg_BTN_F; diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/NesEmulator/CoreSupporter.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/NesEmulator/CoreSupporter.cs index e1c2aea1..76fe4b64 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/NesEmulator/CoreSupporter.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Emulator/NesEmulator/CoreSupporter.cs @@ -131,6 +131,7 @@ namespace AxibugEmuOnline.Client } App.roomMgr.SendRoomSingelPlayerInput(frameIndex, rawData); } + //单机模式 else { m_sampledState = m_controllerMapper.CreateState(); diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs index 3d0703dc..10c2f858 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs @@ -511,7 +511,7 @@ namespace AxibugEmuOnline.Client.Manager /// /// 同步上行 /// - public void SendRoomSingelPlayerInput(uint FrameID, uint InputData) + public void SendRoomSingelPlayerInput(uint FrameID, ulong InputData) { _Protobuf_Room_SinglePlayerInputData.FrameID = FrameID; _Protobuf_Room_SinglePlayerInputData.InputData = InputData; diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs index abd7e0b8..7db4888f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs @@ -72,7 +72,7 @@ namespace AxibugProtobuf { "aW5pSW5mbyJLChVQcm90b2J1Zl9TY3Jlbm5fRnJhbWUSDgoGUm9vbUlEGAEg", "ASgFEg8KB0ZyYW1lSUQYAiABKAUSEQoJUmF3Qml0bWFwGAMgASgMIkkKI1By", "b3RvYnVmX1Jvb21fU2luZ2xlUGxheWVySW5wdXREYXRhEg8KB0ZyYW1lSUQY", - "ASABKA0SEQoJSW5wdXREYXRhGAIgASgNIoABCidQcm90b2J1Zl9Sb29tX1N5", + "ASABKA0SEQoJSW5wdXREYXRhGAIgASgEIoABCidQcm90b2J1Zl9Sb29tX1N5", "bl9Sb29tRnJhbWVBbGxJbnB1dERhdGESDwoHRnJhbWVJRBgBIAEoDRIRCglJ", "bnB1dERhdGEYAiABKAQSFQoNU2VydmVyRnJhbWVJRBgDIAEoDRIaChJTZXJ2", "ZXJGb3J3YXJkQ291bnQYBCABKA0iPgoUUHJvdG9idWZfUm9vbV9DcmVhdGUS", @@ -157,16 +157,17 @@ namespace AxibugProtobuf { "bBAFEhQKEFN3aXRjaFByb0NvbnRyb2wQBhIQCgxTd2l0Y2hKb3lDb24QBxIS", "Cg5YQk9YMzYwQ29udHJvbBAIEhIKDlhCT1hPTkVDb250cm9sEAkSEQoNUFNW", "aXRhQ29udHJvbBAKEhIKDldpaVVQYWRDb250cm9sEAsSFAoQV2lpUmVtb3Rl", - "Q29udHJvbBAMEhYKEk5pbnRlbmRvM0RTQ29udHJvbBANKssBCg9Sb21QbGF0", + "Q29udHJvbBAMEhYKEk5pbnRlbmRvM0RTQ29udHJvbBANKtsBCg9Sb21QbGF0", "Zm9ybVR5cGUSCwoHSW52YWxpZBAAEgcKA05lcxABEhEKDU1hc3Rlcl9TeXN0", "ZW0QAhINCglHYW1lX0dlYXIQAxIMCghHYW1lX0JveRAEEhIKDkdhbWVfQm95", "X0NvbG9yEAUSEQoNQ29sZWNvX1Zpc2lvbhAGEgsKB1NDXzMwMDAQBxILCgdT", "R18xMDAwEAgSCgoGTkVPR0VPEBQSBwoDSUdTEBUSCAoEQ1BTMRAWEggKBENQ", - "UzIQFxIICgNBbGwQ5wcqcAoNUm9vbUdhbWVTdGF0ZRISCg5Ob25lX0dhbWVT", - "dGF0ZRAAEgwKCE9ubHlIb3N0EAESEQoNV2FpdFJhd1VwZGF0ZRACEg0KCVdh", - "aXRSZWFkeRADEgkKBVBhdXNlEAQSEAoMSW5PbmxpbmVHYW1lEAUqTgoRTG9n", - "aW5SZXN1bHRTdGF0dXMSIQodTG9naW5SZXN1bHRTdGF0dXNfQmFzZURlZmF1", - "bHQQABIGCgJPSxABEg4KCkFjY291bnRFcnIQAkICSAFiBnByb3RvMw==")); + "UzIQFxIOCgpBcmNhZGVfT0xEEB4SCAoDQWxsEOcHKnAKDVJvb21HYW1lU3Rh", + "dGUSEgoOTm9uZV9HYW1lU3RhdGUQABIMCghPbmx5SG9zdBABEhEKDVdhaXRS", + "YXdVcGRhdGUQAhINCglXYWl0UmVhZHkQAxIJCgVQYXVzZRAEEhAKDEluT25s", + "aW5lR2FtZRAFKk4KEUxvZ2luUmVzdWx0U3RhdHVzEiEKHUxvZ2luUmVzdWx0", + "U3RhdHVzX0Jhc2VEZWZhdWx0EAASBgoCT0sQARIOCgpBY2NvdW50RXJyEAJC", + "AkgBYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.GamePadType), typeof(global::AxibugProtobuf.RomPlatformType), typeof(global::AxibugProtobuf.RoomGameState), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -478,6 +479,7 @@ namespace AxibugProtobuf { [pbr::OriginalName("IGS")] Igs = 21, [pbr::OriginalName("CPS1")] Cps1 = 22, [pbr::OriginalName("CPS2")] Cps2 = 23, + [pbr::OriginalName("Arcade_OLD")] ArcadeOld = 30, [pbr::OriginalName("All")] All = 999, } @@ -5797,12 +5799,12 @@ namespace AxibugProtobuf { /// Field number for the "InputData" field. public const int InputDataFieldNumber = 2; - private uint inputData_; + private ulong inputData_; /// ///单个玩家操作位运算汇总 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint InputData { + public ulong InputData { get { return inputData_; } set { inputData_ = value; @@ -5831,7 +5833,7 @@ namespace AxibugProtobuf { public override int GetHashCode() { int hash = 1; if (FrameID != 0) hash ^= FrameID.GetHashCode(); - if (InputData != 0) hash ^= InputData.GetHashCode(); + if (InputData != 0UL) hash ^= InputData.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -5852,9 +5854,9 @@ namespace AxibugProtobuf { output.WriteRawTag(8); output.WriteUInt32(FrameID); } - if (InputData != 0) { + if (InputData != 0UL) { output.WriteRawTag(16); - output.WriteUInt32(InputData); + output.WriteUInt64(InputData); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -5869,9 +5871,9 @@ namespace AxibugProtobuf { output.WriteRawTag(8); output.WriteUInt32(FrameID); } - if (InputData != 0) { + if (InputData != 0UL) { output.WriteRawTag(16); - output.WriteUInt32(InputData); + output.WriteUInt64(InputData); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -5885,8 +5887,8 @@ namespace AxibugProtobuf { if (FrameID != 0) { size += 1 + pb::CodedOutputStream.ComputeUInt32Size(FrameID); } - if (InputData != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(InputData); + if (InputData != 0UL) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(InputData); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -5902,7 +5904,7 @@ namespace AxibugProtobuf { if (other.FrameID != 0) { FrameID = other.FrameID; } - if (other.InputData != 0) { + if (other.InputData != 0UL) { InputData = other.InputData; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); @@ -5924,7 +5926,7 @@ namespace AxibugProtobuf { break; } case 16: { - InputData = input.ReadUInt32(); + InputData = input.ReadUInt64(); break; } } @@ -5946,7 +5948,7 @@ namespace AxibugProtobuf { break; } case 16: { - InputData = input.ReadUInt32(); + InputData = input.ReadUInt64(); break; } }