| 
					
				 | 
			
			
				@@ -178,7 +178,8 @@ type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure StringGrid1EditingDone(Sender: TObject);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure StringGrid1Selection(Sender: TObject; aCol, aRow: integer);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure tbPreset1Click(Sender: TObject);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    procedure tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: boolean);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    procedure tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      var Handled: boolean);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure tbPrgChange(Sender: TObject);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure tbResetClick(Sender: TObject);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure tbSelChange(Sender: TObject);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -193,6 +194,7 @@ type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     dirty: boolean;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     lastNote: byte;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     Examples: TStringList;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    procedure doStopExecute();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure initMidi;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure playNote(note: byte);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure loadFromList(Lines: TStringList; filename: string);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -202,7 +204,7 @@ type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure loadFile(filename: string);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure programSps;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    procedure nextStep;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    procedure nextStep(singleStep: boolean);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure renumberGrid;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure saveFile(filename: string);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     procedure selectAddress(addr: byte);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -619,8 +621,8 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (StringGrid1.Cells[1, x] <> '') then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        line := StringGrid1.Cells[0, x] + ',' + StringGrid1.Cells[1, x] + ',' +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          StringGrid1.Cells[2, x] + ',"' + StringGrid1.Cells[4, x] + '"';
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        line := StringGrid1.Cells[0, x] + ',' + StringGrid1.Cells[1, x] +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          ',' + StringGrid1.Cells[2, x] + ',"' + StringGrid1.Cells[4, x] + '"';
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Writeln(f, line);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     end;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -655,12 +657,20 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     Statusbar1.SimpleText := MCSLSU.GetLSUText('statusbar', 'ID_SPS_RUNNING', lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     while (not stopit) do
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      nextStep();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      nextStep(False);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if not sps.isActive() then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        stopit := True;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        doStopExecute(); // error in sps
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (cbAdrActual.Checked) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         selectAddress(sps.getAddress());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       Application.ProcessMessages;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    Statusbar1.SimpleText := MCSLSU.GetLSUText('statusbar', 'ID_SPS_STOPPED', lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if sps.getLastError() <> '' then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      MyMsgBox(sps.getLastError(), 'Error', MB_OK + MB_ICONERROR)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    else
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      Statusbar1.SimpleText := MCSLSU.GetLSUText('statusbar', 'ID_SPS_STOPPED', lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     cbAdrActual.Enabled := False;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     acNextStep.Enabled := True;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     sps.doReset();
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -767,7 +777,7 @@ end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 procedure TForm1.acNextStepExecute(Sender: TObject);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  nextStep();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  nextStep(True);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   selectAddress(sps.getAddress());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -787,7 +797,7 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   savePreset(filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-procedure TForm1.nextStep;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+procedure TForm1.nextStep(singleStep: boolean);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (not sps.isActive()) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -800,14 +810,14 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   else
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     acNextStep.Enabled := False;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    acStop.Enabled := False;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    acStop.Enabled := not singleStep;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     inputMicrobit();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     inputSps();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     sps.nextStep();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     outputSps();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     outputMicrobit();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    acNextStep.Enabled := True;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    acStop.Enabled := True;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    acNextStep.Enabled := singleStep;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    acStop.Enabled := not singleStep;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -890,7 +900,8 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         tmp := tmp + '0';
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       line := line + tmp;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      line := line + '      ' + StringGrid1.Cells[3, x] + '   ,"' + StringGrid1.Cells[4, x] + '"';
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      line := line + '      ' + StringGrid1.Cells[3, x] + '   ,"' +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        StringGrid1.Cells[4, x] + '"';
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       list.add(line);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -901,24 +912,28 @@ end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 procedure TForm1.acStopExecute(Sender: TObject);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (sps.isActive()) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     stopit := True;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     sps.break();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    acDebug.ImageIndex := 40;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //   repeat
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //     Application.ProcessMessages;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //   until (not sps.isDelayActive());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    sps.doReset();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    acStop.Enabled := False;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    acDebug.Enabled := True;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    outputSps();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    selectAddress(0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    activateSps(False);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    doStopExecute();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+procedure TForm1.doStopExecute();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  acDebug.ImageIndex := 40;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //   repeat
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //     Application.ProcessMessages;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //   until (not sps.isDelayActive());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  sps.doReset();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  acStop.Enabled := False;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  acDebug.Enabled := True;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  outputSps();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  selectAddress(0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  activateSps(False);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 procedure TForm1.acThisStepExecute(Sender: TObject);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 var
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   Data, com: byte;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1023,12 +1038,12 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (return = mrOk) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         hexFile := serialUpload;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SdpoSerial1.BaudRate:= br__9600;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SdpoSerial1.BaudRate := br__9600;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if cbTPSVersion.ItemIndex = 5 then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           // Micro:bit V2 auto programm
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          SdpoSerial1.BaudRate:= br115200;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          SdpoSerial1.BaudRate := br115200;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SdpoSerial1.Device := comService;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1124,7 +1139,8 @@ var 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (dirty) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    i := MCSLSU.LSUAutoMsgBox('Messages', 'SAVE_CHANGES', MB_ICONQUESTION or MB_YESNOCANCEL);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    i := MCSLSU.LSUAutoMsgBox('Messages', 'SAVE_CHANGES', MB_ICONQUESTION or
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      MB_YESNOCANCEL);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (i = mrYes) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       saveFile(activeFile);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1254,7 +1270,8 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   else
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    Caption := MCSLSU.GetLSUText('form1Captions', 'ID_CAPTION', lsuCode) + ':' + ExtractFileName(activeFile);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    Caption := MCSLSU.GetLSUText('form1Captions', 'ID_CAPTION', lsuCode) +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ':' + ExtractFileName(activeFile);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1269,7 +1286,8 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     StringGrid1.Columns[i].Title.Caption :=
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       MCSLSU.GetLSUText('form1Captions', StringGrid1.Columns[i].Title.Caption, lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  StringGrid1.Cells[0, 0] := MCSLSU.GetLSUText('form1Captions', 'ID_GRID_STORAGE', lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  StringGrid1.Cells[0, 0] := MCSLSU.GetLSUText('form1Captions',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'ID_GRID_STORAGE', lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   StringGrid1.Repaint;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1462,6 +1480,14 @@ end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   canClose := checkDirty();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if canClose then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (sps.isActive()) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      acStopExecute(Sender);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 procedure TForm1.StringGrid1EditingDone(Sender: TObject);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1486,7 +1512,8 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     x := StringGrid1.Row;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     StringGrid1.Cells[3, x] :=
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]), HexToInt(StringGrid1.Cells[2, x]));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      HexToInt(StringGrid1.Cells[2, x]));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     setDirty(True);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1593,10 +1620,13 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   WriteIniInteger(key, 'accx', XMLPropStorage1.ReadInteger(key + '.accx', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   WriteIniInteger(key, 'accy', XMLPropStorage1.ReadInteger(key + '.accy', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   WriteIniInteger(key, 'accz', XMLPropStorage1.ReadInteger(key + '.accz', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  WriteIniInteger(key, 'sound', XMLPropStorage1.ReadInteger(key + '.sound', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  WriteIniInteger(key, 'light', XMLPropStorage1.ReadInteger(key + '.light', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  WriteIniInteger(key, 'sound', XMLPropStorage1.ReadInteger(key + '.sound', 0),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  WriteIniInteger(key, 'light', XMLPropStorage1.ReadInteger(key + '.light', 0),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   WriteIniInteger(key, 'comp', XMLPropStorage1.ReadInteger(key + '.comp', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  WriteIniInteger(key, 'gesture', XMLPropStorage1.ReadInteger(key + '.gesture', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  WriteIniInteger(key, 'gesture', XMLPropStorage1.ReadInteger(key +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    '.gesture', 0), filename);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 procedure TForm1.loadSection(filename: string; key: string);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1604,10 +1634,14 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteBoolean(key + '.set', ReadIniBool(key, 'set', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteBoolean(key + '.prg', ReadIniBool(key, 'prg', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteBoolean(key + '.sel', ReadIniBool(key, 'sel', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  XMLPropStorage1.WriteBoolean(key + '.input1', ReadIniBool(key, 'input1', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  XMLPropStorage1.WriteBoolean(key + '.input2', ReadIniBool(key, 'input2', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  XMLPropStorage1.WriteBoolean(key + '.input3', ReadIniBool(key, 'input3', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  XMLPropStorage1.WriteBoolean(key + '.input4', ReadIniBool(key, 'input4', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  XMLPropStorage1.WriteBoolean(key + '.input1', ReadIniBool(key,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'input1', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  XMLPropStorage1.WriteBoolean(key + '.input2', ReadIniBool(key,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'input2', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  XMLPropStorage1.WriteBoolean(key + '.input3', ReadIniBool(key,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'input3', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  XMLPropStorage1.WriteBoolean(key + '.input4', ReadIniBool(key,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'input4', False, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteInteger(key + '.adc1', ReadIniInteger(key, 'adc1', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteInteger(key + '.adc2', ReadIniInteger(key, 'adc2', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteInteger(key + '.rc1', ReadIniInteger(key, 'rc1', 0, filename));
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1617,10 +1651,13 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteInteger(key + '.accx', ReadIniInteger(key, 'accx', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteInteger(key + '.accy', ReadIniInteger(key, 'accy', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteInteger(key + '.accz', ReadIniInteger(key, 'accz', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  XMLPropStorage1.WriteInteger(key + '.sound', ReadIniInteger(key, 'sound', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  XMLPropStorage1.WriteInteger(key + '.light', ReadIniInteger(key, 'light', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  XMLPropStorage1.WriteInteger(key + '.sound', ReadIniInteger(key,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'sound', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  XMLPropStorage1.WriteInteger(key + '.light', ReadIniInteger(key,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'light', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   XMLPropStorage1.WriteInteger(key + '.comp', ReadIniInteger(key, 'comp', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  XMLPropStorage1.WriteInteger(key + '.gesture', ReadIniInteger(key, 'gesture', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  XMLPropStorage1.WriteInteger(key + '.gesture', ReadIniInteger(key,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    'gesture', 0, filename));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 procedure TForm1.tbPreset1Click(Sender: TObject);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1661,17 +1698,26 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   ADC2.Value := XMLPropStorage1.ReadInteger(key + '.adc2', ADC2.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   RC1.Value := XMLPropStorage1.ReadInteger(key + '.rc1', RC1.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   RC2.Value := XMLPropStorage1.ReadInteger(key + '.rc2', RC2.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.tbLogo.Checked := XMLPropStorage1.ReadBoolean(key + '.logo', fMicrobit.tbLogo.Checked);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.accx.Value := XMLPropStorage1.ReadInteger(key + '.accx', fMicrobit.accx.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.accy.Value := XMLPropStorage1.ReadInteger(key + '.accy', fMicrobit.accy.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.accz.Value := XMLPropStorage1.ReadInteger(key + '.accz', fMicrobit.accz.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.snd.Value := XMLPropStorage1.ReadInteger(key + '.sound', fMicrobit.snd.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.light.Value := XMLPropStorage1.ReadInteger(key + '.light', fMicrobit.light.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.compass.Value := XMLPropStorage1.ReadInteger(key + '.comp', fMicrobit.compass.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  fMicrobit.cbGesture.ItemIndex := XMLPropStorage1.ReadInteger(key + '.gesture', fMicrobit.cbGesture.ItemIndex);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-procedure TForm1.tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: boolean);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.tbLogo.Checked := XMLPropStorage1.ReadBoolean(key + '.logo',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fMicrobit.tbLogo.Checked);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.accx.Value := XMLPropStorage1.ReadInteger(key + '.accx',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fMicrobit.accx.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.accy.Value := XMLPropStorage1.ReadInteger(key + '.accy',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fMicrobit.accy.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.accz.Value := XMLPropStorage1.ReadInteger(key + '.accz',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fMicrobit.accz.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.snd.Value := XMLPropStorage1.ReadInteger(key + '.sound',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fMicrobit.snd.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.light.Value := XMLPropStorage1.ReadInteger(key + '.light',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fMicrobit.light.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.compass.Value := XMLPropStorage1.ReadInteger(key + '.comp',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fMicrobit.compass.Value);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  fMicrobit.cbGesture.ItemIndex :=
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    XMLPropStorage1.ReadInteger(key + '.gesture', fMicrobit.cbGesture.ItemIndex);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+procedure TForm1.tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  var Handled: boolean);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 var
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   key: string;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1775,8 +1821,8 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (InfoBox.newVersion) then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     MCSLabel.Font.Color := clred;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    MCSLabel.Hint := InfoBox.versionHint + chr($0a) + chr($0d) + MCSLSU.GetLSUText(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      'form1Captions', 'ID_CLICK_HERE', lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    MCSLabel.Hint := InfoBox.versionHint + chr($0a) + chr($0d) +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      MCSLSU.GetLSUText('form1Captions', 'ID_CLICK_HERE', lsuCode);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   MCSLabel.Caption := InfoBox.versionText;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1820,7 +1866,8 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (StringGrid1.Cells[2, x] = '') then
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       StringGrid1.Cells[2, x] := '0';
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     StringGrid1.Cells[3, x] :=
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]), HexToInt(StringGrid1.Cells[2, x]));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      HexToInt(StringGrid1.Cells[2, x]));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 |