瀏覽代碼

Merge branch 'develop'

Wilfried Klaas 3 年之前
父節點
當前提交
f31d8eb16b
共有 7 個文件被更改,包括 132 次插入65 次删除
  1. 9 1
      README.md
  2. 2 2
      SPS_EMU.000
  3. 1 1
      SPS_Emu.lpi
  4. 二進制
      SPS_Emu.lsu
  5. 99 52
      ugui.pas
  6. 8 7
      umicrobit.pas
  7. 13 2
      usps.pas

+ 9 - 1
README.md

@@ -1,4 +1,13 @@
 # **SPS_Emulator Version History**
 # **SPS_Emulator Version History**
+**15.05.2021 Version 0.2.1.88**
+
+  * Bug: BBC micro:bit V2 wrong images will be displayed on image > 1 (only a little offset of 1)
+  * Bug: Jump to illegal address will lead into deactivating the stop button, if the emulator is running. Now the emulator will stop and show a error message. 
+
+**09.05.2021 Version 0.2.1.85**
+
+  * Feature: automatic upload for BBC micro:bit V2 via serial connection. Now you don't have to put the mb into programming mode anymore. Simply click on the upload button.
+
 **08.04.2021 Version 0.2.1.80**
 **08.04.2021 Version 0.2.1.80**
 
 
   * Feature: upload activating for BBC micro:bit V2 via serial connection. 
   * Feature: upload activating for BBC micro:bit V2 via serial connection. 
@@ -58,7 +67,6 @@
   * BUG: on "new file" changes of the actual file will not be saved
   * BUG: on "new file" changes of the actual file will not be saved
   * FEATURE: loading and saving of input presets, adding PRG and SEL Buttons to preset
   * FEATURE: loading and saving of input presets, adding PRG and SEL Buttons to preset
   * BUG: Holtec -> Holtek
   * BUG: Holtec -> Holtek
-	
 
 
 **10.11.2018 Version 0.2.1.50**
 **10.11.2018 Version 0.2.1.50**
 
 

+ 2 - 2
SPS_EMU.000

@@ -2,8 +2,8 @@
 LSUTextFile=1
 LSUTextFile=1
 Copyrigth=MCS Media Computer Software
 Copyrigth=MCS Media Computer Software
 [LSUInfo]
 [LSUInfo]
-CompileDate=09.05.2021
-CompileTime=14:46:27
+CompileDate=15.05.2021
+CompileTime=11:32:02
 Name=Wilfried Klaas
 Name=Wilfried Klaas
 LSUBinFile=C:\e-platte\daten\git-sourcen\SPS_Emulator\SPS_Emu.lsu
 LSUBinFile=C:\e-platte\daten\git-sourcen\SPS_Emulator\SPS_Emu.lsu
 LSUTextFile=C:\e-platte\daten\git-sourcen\SPS_Emulator\SPS_Emu.
 LSUTextFile=C:\e-platte\daten\git-sourcen\SPS_Emulator\SPS_Emu.

+ 1 - 1
SPS_Emu.lpi

@@ -22,7 +22,7 @@
       <AutoIncrementBuild Value="True"/>
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="2"/>
       <MinorVersionNr Value="2"/>
       <RevisionNr Value="1"/>
       <RevisionNr Value="1"/>
-      <BuildNr Value="86"/>
+      <BuildNr Value="88"/>
       <Language Value="0407"/>
       <Language Value="0407"/>
       <StringTable CompanyName="MCS" FileDescription="TPS/SPS Emulator" InternalName="SPS_EMU" LegalCopyright="MCS (C) Wilfried Klaas" OriginalFilename="SPS_EMU.exe" ProductName="TPS/SPS Emulator" ProductVersion="0.2"/>
       <StringTable CompanyName="MCS" FileDescription="TPS/SPS Emulator" InternalName="SPS_EMU" LegalCopyright="MCS (C) Wilfried Klaas" OriginalFilename="SPS_EMU.exe" ProductName="TPS/SPS Emulator" ProductVersion="0.2"/>
     </VersionInfo>
     </VersionInfo>

二進制
SPS_Emu.lsu


+ 99 - 52
ugui.pas

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

+ 8 - 7
umicrobit.pas

@@ -18,12 +18,6 @@ const
     (1, 1, 1, 1, 1),
     (1, 1, 1, 1, 1),
     (0, 1, 1, 1, 0),
     (0, 1, 1, 1, 0),
     (0, 0, 1, 0, 0)),
     (0, 0, 1, 0, 0)),
-    //IMAGE_HEART_SMALL: TMBImage =
-    ((0, 0, 0, 0, 0),
-    (0, 1, 0, 1, 0),
-    (0, 1, 1, 1, 0),
-    (0, 0, 1, 0, 0),
-    (0, 0, 0, 0, 0)),
     // smilies
     // smilies
     //IMAGE_HAPPY: TMBImage = (
     //IMAGE_HAPPY: TMBImage = (
     ((0, 0, 0, 0, 0),
     ((0, 0, 0, 0, 0),
@@ -397,7 +391,14 @@ const
     (1, 1, 0, 1, 1),
     (1, 1, 0, 1, 1),
     (0, 1, 0, 1, 0),
     (0, 1, 0, 1, 0),
     (0, 1, 1, 1, 0),
     (0, 1, 1, 1, 0),
-    (0, 0, 0, 0, 0)));
+    (0, 0, 0, 0, 0)),
+    //IMAGE_HEART_SMALL: TMBImage =
+    ((0, 0, 0, 0, 0),
+    (0, 1, 0, 1, 0),
+    (0, 1, 1, 1, 0),
+    (0, 0, 1, 0, 0),
+    (0, 0, 0, 0, 0))
+);
 
 
 implementation
 implementation
 
 

+ 13 - 2
usps.pas

@@ -207,6 +207,8 @@ type
     soundLevel: byte;
     soundLevel: byte;
     lightLevel: byte;
     lightLevel: byte;
 
 
+    errorMessage: string;
+
     procedure doNull(Data: byte);
     procedure doNull(Data: byte);
     procedure doPort(Data: byte);
     procedure doPort(Data: byte);
     procedure doDelay(Data: byte);
     procedure doDelay(Data: byte);
@@ -270,6 +272,7 @@ type
     procedure break();
     procedure break();
     procedure doSingleCommand(command: byte);
     procedure doSingleCommand(command: byte);
     procedure preFetch();
     procedure preFetch();
+    function getLastError():string;
 
 
     procedure writeEEProm(adr: byte; Data: byte);
     procedure writeEEProm(adr: byte; Data: byte);
 
 
@@ -432,14 +435,17 @@ end;
 procedure TSPS.nextStep();
 procedure TSPS.nextStep();
 var
 var
   Value: byte;
   Value: byte;
+  oldAddr : word;
 begin
 begin
+  errorMessage := '';
   Value := eeprom[addr];
   Value := eeprom[addr];
+  oldAddr := addr;
   addr := addr + 1;
   addr := addr + 1;
-
   doSingleCommand(Value);
   doSingleCommand(Value);
 
 
   if (addr > e2e) then
   if (addr > e2e) then
   begin
   begin
+    errorMessage := 'Address out of range after address: 0x' + IntToHex(oldAddr, 2);
     doReset();
     doReset();
   end;
   end;
   preFetch();
   preFetch();
@@ -621,6 +627,11 @@ begin
   end;
   end;
 end;
 end;
 
 
+function TSPS.getLastError(): string;
+begin
+  result := errorMessage;
+end;
+
 procedure TSPS.writeEEProm(adr: byte; Data: byte);
 procedure TSPS.writeEEProm(adr: byte; Data: byte);
 begin
 begin
   eeprom[adr] := Data;
   eeprom[adr] := Data;
@@ -834,7 +845,7 @@ begin
         end
         end
         else
         else
         begin
         begin
-          image := IMAGE_MAP[5];
+          image := IMAGE_MAP[4];
           if a <= length(IMAGE_MAP) then
           if a <= length(IMAGE_MAP) then
           begin
           begin
             DebugLn('display an image');
             DebugLn('display an image');