public void SetAxisStepsPerUnit(M92 m92) { X = m92.X ?? X; Y = m92.Y ?? Y; Z = m92.Z ?? Z; E = m92.E ?? E; }
private void btnDraw_Click(object sender, EventArgs e) { M92.bG00 = cb00.Checked; M92.bG01 = cb01.Checked; M92.bG10 = cb10.Checked; M92.bG11 = cb11.Checked; M92.bG20 = cb20.Checked; M92.bG21 = cb21.Checked; M92.bSprite = cbSprite.Checked; int n1, n2; string[] ss1 = tbInput.Text.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries); n1 = Convert.ToInt32(ss1[0], 16); n2 = Convert.ToInt32(ss1[1], 16); Bitmap bm1 = M92.GetAllGDI(n1, n2); pictureBox1.Image = bm1; }
public void LoadRom() { mame.Timer.lt = new List <mame.Timer.emu_timer>(); sSelect = RomInfo.Rom.Name; Machine.FORM = 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; cpsToolStripMenuItem.Enabled = false; neogeoToolStripMenuItem.Enabled = false; namcos1ToolStripMenuItem.Enabled = false; pgmToolStripMenuItem.Enabled = false; m72ToolStripMenuItem.Enabled = false; m92ToolStripMenuItem.Enabled = false; switch (Machine.sBoard) { case "CPS-1": case "CPS-1(QSound)": case "CPS2": Video.nMode = 3; itemSize = new ToolStripMenuItem[Video.nMode]; for (i = 0; i < Video.nMode; i++) { itemSize[i] = new ToolStripMenuItem(); itemSize[i].Size = new Size(152, 22); itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click); } itemSize[0].Text = "512x512"; itemSize[1].Text = "512x256"; itemSize[2].Text = "384x224"; resetToolStripMenuItem.DropDownItems.Clear(); resetToolStripMenuItem.DropDownItems.AddRange(itemSize); itemSelect(); cpsToolStripMenuItem.Enabled = true; CPS.CPSInit(); CPS.GDIInit(); break; case "Neo Geo": Video.nMode = 1; itemSize = new ToolStripMenuItem[Video.nMode]; for (i = 0; i < Video.nMode; i++) { itemSize[i] = new ToolStripMenuItem(); itemSize[i].Size = new Size(152, 22); itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click); } itemSize[0].Text = "320x224"; resetToolStripMenuItem.DropDownItems.Clear(); resetToolStripMenuItem.DropDownItems.AddRange(itemSize); Video.iMode = 0; itemSelect(); neogeoToolStripMenuItem.Enabled = true; Neogeo.NeogeoInit(); Neogeo.GDIInit(); break; case "Namco System 1": Video.nMode = 1; itemSize = new ToolStripMenuItem[Video.nMode]; for (i = 0; i < Video.nMode; i++) { itemSize[i] = new ToolStripMenuItem(); itemSize[i].Size = new Size(152, 22); itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click); } itemSize[0].Text = "288x224"; resetToolStripMenuItem.DropDownItems.Clear(); resetToolStripMenuItem.DropDownItems.AddRange(itemSize); Video.iMode = 0; itemSelect(); namcos1ToolStripMenuItem.Enabled = true; Namcos1.Namcos1Init(); Namcos1.GDIInit(); break; case "IGS011": Video.nMode = 1; itemSize = new ToolStripMenuItem[Video.nMode]; for (i = 0; i < Video.nMode; i++) { itemSize[i] = new ToolStripMenuItem(); itemSize[i].Size = new Size(152, 22); itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click); } itemSize[0].Text = "512x240"; resetToolStripMenuItem.DropDownItems.Clear(); resetToolStripMenuItem.DropDownItems.AddRange(itemSize); Video.iMode = 0; itemSelect(); IGS011.GDIInit(); IGS011.IGS011Init(); break; case "PGM": Video.nMode = 1; itemSize = new ToolStripMenuItem[Video.nMode]; for (i = 0; i < Video.nMode; i++) { itemSize[i] = new ToolStripMenuItem(); itemSize[i].Size = new Size(152, 22); itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click); } itemSize[0].Text = "448x224"; resetToolStripMenuItem.DropDownItems.Clear(); resetToolStripMenuItem.DropDownItems.AddRange(itemSize); Video.iMode = 0; itemSelect(); pgmToolStripMenuItem.Enabled = true; PGM.PGMInit(); PGM.GDIInit(); break; case "M72": Video.nMode = 1; itemSize = new ToolStripMenuItem[Video.nMode]; for (i = 0; i < Video.nMode; i++) { itemSize[i] = new ToolStripMenuItem(); itemSize[i].Size = new Size(152, 22); itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click); } itemSize[0].Text = "384x256"; resetToolStripMenuItem.DropDownItems.Clear(); resetToolStripMenuItem.DropDownItems.AddRange(itemSize); Video.iMode = 0; itemSelect(); m72ToolStripMenuItem.Enabled = true; M72.M72Init(); M72.GDIInit(); break; case "M92": Video.nMode = 1; itemSize = new ToolStripMenuItem[Video.nMode]; for (i = 0; i < Video.nMode; i++) { itemSize[i] = new ToolStripMenuItem(); itemSize[i].Size = new Size(152, 22); itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click); } itemSize[0].Text = "320x240"; resetToolStripMenuItem.DropDownItems.Clear(); resetToolStripMenuItem.DropDownItems.AddRange(itemSize); Video.iMode = 0; itemSelect(); m92ToolStripMenuItem.Enabled = true; M92.M92Init(); M92.GDIInit(); break; } if (Machine.bRom) { this.Text = "MAME.NET: " + Machine.sDescription + " [" + Machine.sName + "]"; Mame.init_machine(); Generic.nvram_load(); } else { MessageBox.Show("error rom"); } }
private void ProcessReveivedData(string data) { string[] args = data.Split(' ').ToArray(); switch (args[0]) { case "M105": M105 m105 = CreateMCommandInstance <M105>(args[0], data); WritePort(string.Format(m105.Reply[0], Extruder.CurrentTemp, Extruder.TargetTemp, Hotbed.CurrentTemp, Hotbed.TargetTemp)); break; case "M503": M503 m503 = CreateMCommandInstance <M503>(args[0], data); WritePort(m503.Reply); break; case "M92": M92 m92 = CreateMCommandInstance <M92>(args[0], data); Settings.AxisStepsPerUnit.SetAxisStepsPerUnit(m92); WritePort(string.Format(m92.Reply[0], m92.X, m92.Y, m92.Z, m92.E)); break; case "M115": M115 m115 = CreateMCommandInstance <M115>(args[0], data); WritePort(m115.Reply); break; case "M114": M114 m114 = CreateMCommandInstance <M114>(args[0], data); WritePort(string.Format(m114.Reply[0], Extruder.X, Extruder.Y, Extruder.Z)); break; case "M220": M220 m220 = CreateMCommandInstance <M220>(args[0], data); Settings.FeedRate.SetFeedRatePercent(m220); WritePort(string.Format(m220.Reply[0], Settings.FeedRate.FeedRatePercent)); break; case "M221": WritePort("E0 Flow: 100%"); break; case "G1": if (args.Count() == 1) { WritePort("ok"); } double X = 0; double Y = 0; double Z = 0; for (int a = 1; a <= args.Count() - 1; a++) { if (args[a].StartsWith("X")) { X += Convert.ToDouble(args[a].Substring(1)); } if (args[a].StartsWith("Y")) { Y += Convert.ToDouble(args[a].Substring(1)); } if (args[a].StartsWith("Z")) { Z += Convert.ToDouble(args[a].Substring(1)); } } Extruder.MoveExtruder(X, Y, Z); WritePort("ok"); break; case "M104": M104 m104 = CreateMCommandInstance <M104>(args[0], data); Extruder.SetHotEndTargetTemp(m104); WritePort("ok"); break; case "M140": M140 m140 = CreateMCommandInstance <M140>(args[0], data); WritePort(m140.Reply[0]); break; default: WritePort("ok"); break; } }