private void handleDisplayChars() { getStartAddress(); VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("bank ram", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); vcom.addBinaryMemCommand(m_startAddress, m_startAddress + 0x2000, new CommandStruct.CS_BinaryDelegate(got_ram), null, this.Dispatcher); vcom.addTextCommand("bank cpu", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); }
private void handleDisplaySprites(int startAddress, int bank) { m_startAddress = startAddress; m_startBank = bank; VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("bank ram", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); vcom.addBinaryMemCommand(m_startAddress, m_startAddress + 0x3fff, new CommandStruct.CS_BinaryDelegate(got_ram), null, this.Dispatcher); vcom.addTextCommand("bank cpu", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); }
private void hitBreakpoint(String eventType, int number, int address) { int relAddr = address - m_screenAddress; int y = relAddr / 40; int x = relAddr % 40; int[] pixels = new int[8 * 8]; Int32Rect rect = new Int32Rect(x * 8, y * 8, 8, 8); m_wb.CopyPixels(rect, pixels, 8 * 4, 0); for (int dy = 0; dy < 8; dy++) { for (int dx = 0; dx < 8; dx++) { int value = pixels[dy * 8 + dx]; value = (int)(value ^ 0xFFFFFFFF); pixels[dy * 8 + dx] = value; } } m_wb.WritePixels(rect, pixels, 8 * 4, 0); canvas.Source = null; canvas.Source = m_wb; if (autorunCB.IsChecked ?? true) { VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("x", CommandStruct.eMode.DoCommandOnly, null, null, null); } }
private void show_diss_post_registers() { ShowSrcDissStruct sms = show_diss_common(); if (sms == null) { SetSourceView("Source not found for this address "); if (mIsAPUMode) { sms = new ShowSrcDissStruct() { endNext = m_registerSet.GetPC() + 0x10 , startPrev = m_registerSet.GetPC() }; } else { sms = new ShowSrcDissStruct() { endNext = m_registerSet.GetPC() + 0x20 , startPrev = m_registerSet.GetPC() }; } } sms.displayDissCallback = new CommandStruct.CS_TextDelegate(show_diss_get_post_dissasem); string command = "d " + sms.startPrev.ToString("X") + " " + m_registerSet.GetPC().ToString("X"); VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand(command, CommandStruct.eMode.DoCommandReturnResults, new CommandStruct.CS_TextDelegate(show_src_diss_get_pre_dissasem), sms, this.Dispatcher); }
private void drawScreen() { //first we need to get the RAM upto date VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("bank ram", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); vcom.addBinaryMemCommand(m_screenAddress, m_screenAddress + 0x400, new CommandStruct.CS_BinaryDelegate(got_screen), null, this.Dispatcher); }
public void removeBreakpoint(int number) { VICECOMManager vc = VICECOMManager.getVICEComManager(); string command = "del " + number; vc.addTextCommand(command, CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); mBreakPointToDispatch.Remove(number); }
private void dispatchCommand(string command) { VICECOMManager vcom = VICECOMManager.getVICEComManager(); if (command.IndexOf("!memmapzap") == 0) { vcom.addTextCommand("memmapzap", CommandStruct.eMode.DoCommandThenExit, null, null, this.Dispatcher); } else if (command.IndexOf("!memmapshow") == 0) { vcom.addTextCommand("memmapshow", CommandStruct.eMode.DoCommandReturnResults, new CommandStruct.CS_TextDelegate(memmapshow_callback), null, this.Dispatcher); } else if (command.IndexOf("!domem") == 0) { //vcom.addBinaryMemCommand(0, 0xFFFF, full_mem_dump, null, this.Dispatcher); } else if (command.IndexOf("!sm") == 0) { get_registers_callmeback(new NoArgDelegate(show_src_diss_post_registers)); } else if (command.IndexOf("!s") == 0) { get_registers_callmeback(new NoArgDelegate(show_src_post_registers)); } else if (command.IndexOf("!d") == 0) { get_registers_callmeback(new NoArgDelegate(show_diss_post_registers)); } else if (command.IndexOf("!breaklist") == 0) { vcom.addTextCommand("break", CommandStruct.eMode.DoCommandReturnResults, new CommandStruct.CS_TextDelegate(breaklist_callback), null, this.Dispatcher); } else if (command.IndexOf("break") == 0 || command.IndexOf("watch") == 0) { vcom.addTextCommand(command, CommandStruct.eMode.DoCommandReturnResults, new CommandStruct.CS_TextDelegate(break_callback), null, this.Dispatcher); } else if (command.StartsWith("quit")) { vcom.addTextCommand("quit", CommandStruct.eMode.DoCommandFireCallback, new CommandStruct.CS_TextDelegate(quit_callback), null, this.Dispatcher); } else { // Any other commands get here //bool silent = false; if (command.IndexOf('!') == 0) { command = command.Substring(1); //silent = true; } if (command.IndexOf("x") != 0) { vcom.addTextCommand(command, CommandStruct.eMode.DoCommandReturnResults, new CommandStruct.CS_TextDelegate(command_just_show_reply), null, this.Dispatcher); } else { vcom.addTextCommand(command, CommandStruct.eMode.DoCommandOnly, null, null, this.Dispatcher); } } }
public void addBreakPointAndNotifyMe(int startAddress, int endAddress, BreakPointEventDelegate me, Dispatcher dispatcher, IBreakpointReturn owner) { VICECOMManager vc = VICECOMManager.getVICEComManager(); string command = string.Format("break {0:X4} {1:X4}", startAddress, endAddress); vc.addTextCommand(command, CommandStruct.eMode.DoCommandReturnResults, bpd_addBreak, new CallBackStruct { me = me, owner = owner }, dispatcher); }
private void show_src_diss_get_pre_dissasem(string reply, object userData) { ShowSrcDissStruct sms = userData as ShowSrcDissStruct; sms.disassemblyBefore = reply; string command = "d " + m_registerSet.GetPC().ToString("X") + " " + sms.endNext.ToString("X"); VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand(command, CommandStruct.eMode.DoCommandReturnResults, sms.displayDissCallback, sms, this.Dispatcher); }
private void got_char(byte[] data, object none) { C64RAM ram = C64RAM.getInstace(); ram.injectBinaryData(m_screenAddress, data); VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("bank cpu", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); renderScreen(); }
private void getButton_Click(object sender, RoutedEventArgs e) { VICECOMManager vcom = VICECOMManager.getVICEComManager(); int count; if (!Int32.TryParse(mCount.Text, out count)) { count = 500; } vcom.addTextCommand("chis " + count.ToString(), CommandStruct.eMode.DoCommandReturnResults, chis_gotData, null, this.Dispatcher); }
private void DispatchNextCommand(string command) { if (command.StartsWith("vice:")) { string viceCommand = null; string destString = null; if (command.Contains(">>")) { int pipeIndex = command.IndexOf(">>"); viceCommand = command.Substring(5, pipeIndex - 5).Trim(); destString = command.Substring(pipeIndex + 2).Trim(); } else { viceCommand = command.Substring(5); } mResults.Text += "executing vice command " + viceCommand + "\n"; VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand(viceCommand, CommandStruct.eMode.DoCommandReturnResults, sp_gotData, destString, this.Dispatcher); } else if (command.StartsWith("host:")) { string hostCommand = command.Substring(5).Trim(); int fileNameEnd = hostCommand.IndexOf(' '); string filename = hostCommand.Substring(0, fileNameEnd); string param = hostCommand.Substring(fileNameEnd); mResults.Text += "executing host command " + filename + "with params " + param + "\n"; var proc = new Process { StartInfo = new ProcessStartInfo { FileName = filename, Arguments = param, UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, CreateNoWindow = true } }; proc.Start(); while (!proc.StandardOutput.EndOfStream) { mResults.Text += proc.StandardOutput.ReadLine() + "\n"; } while (!proc.StandardError.EndOfStream) { mResults.Text += proc.StandardOutput.ReadLine() + "\n"; } DispatchNextCommand(); } }
private void got_new_value(byte[] data, object obj) { WatchObject wo = obj as WatchObject; wo.m_value = data[0]; DataContext = null; DataContext = this; VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("x", CommandStruct.eMode.DoCommandOnly, null, null, null); }
private void handleDisplayBitmap() { m_startAddress = Convert.ToInt32(startBox.Text, 16); // m_startBank = bank; VICECOMManager vcom = VICECOMManager.getVICEComManager(); if (ram0Rad.IsChecked ?? true) { vcom.addTextCommand("bank ram", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); } else if (ram1Rad.IsChecked ?? true) { vcom.addTextCommand("bank ram1", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); } else { vcom.addTextCommand("bank vdc", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); } vcom.addBinaryMemCommand(m_startAddress, m_startAddress + 0x2000, new CommandStruct.CS_BinaryDelegate(got_ram), null, this.Dispatcher); vcom.addTextCommand("bank cpu", CommandStruct.eMode.DoCommandThrowAwayResults, null, null, null); }
private void hitBreakpoint(String eventType, int number, int address) { try { WatchObject obj = m_breakpointToWatchMap[number]; VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addBinaryMemCommand(obj.m_address, obj.m_address + 0x0100, new CommandStruct.CS_BinaryDelegate(got_new_value), obj, this.Dispatcher); } catch (Exception) { VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("x", CommandStruct.eMode.DoCommandOnly, null, null, null); } }
public void updateC64(MainWindow mw) { VICECOMManager vcom = VICECOMManager.getVICEComManager(); string text = mTextBox.Text; int value = 0; string command = ""; switch (mType) { default: case eDisplayType.Decimal: if (Int32.TryParse(text, System.Globalization.NumberStyles.Integer, CultureInfo.InvariantCulture, out value)) { command = String.Format(">{0:X04} {1:X02}", mAddress, value); } mTextBox.Text = String.Format("{0:d}", value); break; case eDisplayType.Hex: switch (mWidth) { default: case eWidth.Byte: if (Int32.TryParse(text, System.Globalization.NumberStyles.HexNumber, CultureInfo.InvariantCulture, out value)) { command = String.Format(">{0:X04} {1:X02}", mAddress, value); } break; case eWidth.Word: if (Int32.TryParse(text, System.Globalization.NumberStyles.HexNumber, CultureInfo.InvariantCulture, out value)) { command = String.Format(">{0:X04} {1:X02} {2:X02}", mAddress, value & 0xFF, (value & 0xFF00) / 256); } break; } break; } if (command.Length > 0) { vcom.addTextCommand(command, CommandStruct.eMode.DoCommandThrowAwayResults, null, null, mw.Dispatcher); } }
public void addWatchPointAndNotifyMe(int startAddress, int endAddress, BreakPointEventDelegate me, Dispatcher dispatcher, bool load, bool store, IBreakpointReturn owner) { VICECOMManager vc = VICECOMManager.getVICEComManager(); string pre = String.Empty; if (load) { pre += "load "; } if (store) { pre += "store "; } string command = string.Format("watch {0:s} {1:X4} {2:X4}", pre, startAddress, endAddress); vc.addTextCommand(command, CommandStruct.eMode.DoCommandReturnResults, bpd_addBreak, new CallBackStruct { me = me, owner = owner }, dispatcher); }
private void get_registers_callmeback(NoArgDelegate callme) { VICECOMManager vcom = VICECOMManager.getVICEComManager(); vcom.addTextCommand("r", CommandStruct.eMode.DoCommandReturnResults, new CommandStruct.CS_TextDelegate(get_registers_callback), callme, this.Dispatcher); }