docs: def reformat_v09_trace(raw_trace, max_lines=None):
      """
      reformat v09 trace simmilar to XRoar one
      and add CC and Memory-Information.
  
      Note:
          v09 traces contains the register info line one trace line later!
          We reoder it as XRoar done: addr+Opcode with resulted registers
      """
      print()
      print("Reformat v09 trace...")
      mem_info = SBC09MemInfo(sys.stderr)
  
      result = []
      next_update = time.time() + 1
      old_line = None
      for line_no, line in enumerate(raw_trace.splitlines()):
          if max_lines is not None and line_no >= max_lines:
              msg = "max lines %i arraived -> Abort." % max_lines
              print(msg)
              result.append(msg)
              break
  
          if time.time() > next_update:
              print("reformat %i trace lines..." % line_no)
              next_update = time.time() + 1
  
          try:
              pc = int(line[3:7], 16)
              op_code = int(line[10:15].strip().replace(" ", ""), 16)
              cc = int(line[57:59], 16)
              a = int(line[46:48], 16)
              b = int(line[51:53], 16)
              x = int(line[18:22], 16)
              y = int(line[25:29], 16)
              u = int(line[32:36], 16)
              s = int(line[39:43], 16)
          except ValueError as err:
              print("Error in line %i: %s" % (line_no, err))
              print("Content on line %i:" % line_no)
              print("-"*79)
              print(repr(line))
              print("-"*79)
              continue
  
          op_data = MC6809OP_DATA_DICT[op_code]
          mnemonic = op_data["mnemonic"]
  
          cc_txt = cc_value2txt(cc)
          mem = mem_info.get_shortest(pc)
  #        print op_data
  
          register_line = "cc=%02x a=%02x b=%02x dp=?? x=%04x y=%04x u=%04x s=%04x| %s" % (
              cc, a, b, x, y, u, s, cc_txt
          )
          if old_line is None:
              line = "(init with: %s)" % register_line
          else:
              line = old_line % register_line
  
          old_line = "%04x| %-11s %-27s %%s | %s" % (
              pc, "%x" % op_code, mnemonic,
              mem
          )
  
          result.append(line)
  
      print("Done, %i trace lines converted." % line_no)
  #    print raw_trace[:700]
      return result