Ejemplo n.º 1
0
  private void renderDisassembly(final List<DisassembledLine> lines) {
    final Address pc = emulator.getCPU().getPC(); // used to mark the current PC value

    final StringBuilder result = new StringBuilder();
    final Iterator<DisassembledLine> it = lines.iterator();

    boolean first = true;
    while (it.hasNext()) {
      final DisassembledLine line = it.next();

      if (first) {
        first = false;
        addressAtTopOfScreen = line.getAddress();
      }

      if (!it.hasNext()) {
        addressAtBottomOfScreen = line.getAddress();
      }

      // create disassembled line
      result.append(toString(pc, line));
      if (it.hasNext()) {
        result.append("\n");
      }
    }

    SwingUtilities.invokeLater(
        new Runnable() {

          @Override
          public void run() {
            textArea.setText(result.toString());
          }
        });
  }
Ejemplo n.º 2
0
  @Override
  public void refreshDisplay() {
    if (emulator == null) {
      return;
    }

    setViewStartingAddress(emulator.getCPU().getPC());
  }