Forráskód Böngészése

new version with some changes for the microbit V2

Klaas, Wilfried 3 éve
szülő
commit
ab65ab0bea
6 módosított fájl, 60 hozzáadás és 59 törlés
  1. 2 2
      SPS_EMU.000
  2. 1 1
      SPS_Emu.lpi
  3. BIN
      SPS_Emu.lsu
  4. 13 17
      ugui.lfm
  5. 10 9
      ugui.pas
  6. 34 30
      usps.pas

+ 2 - 2
SPS_EMU.000

@@ -2,8 +2,8 @@
 LSUTextFile=1
 Copyrigth=MCS Media Computer Software
 [LSUInfo]
-CompileDate=08.04.2021
-CompileTime=16:42:42
+CompileDate=03.05.2021
+CompileTime=14:32:31
 Name=Wilfried Klaas
 LSUBinFile=H:\privat\git-sourcen\SPS_Emulator\SPS_Emu.lsu
 LSUTextFile=H:\privat\git-sourcen\SPS_Emulator\SPS_Emu.

+ 1 - 1
SPS_Emu.lpi

@@ -22,7 +22,7 @@
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="2"/>
       <RevisionNr Value="1"/>
-      <BuildNr Value="80"/>
+      <BuildNr Value="81"/>
       <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"/>
     </VersionInfo>

BIN
SPS_Emu.lsu


+ 13 - 17
ugui.lfm

@@ -688,26 +688,26 @@ object Form1: TForm1
       Caption = 'ID_SAVE'
     end
     object ToolButton4: TToolButton
-      Left = 299
+      Left = 303
       Height = 26
       Top = 2
       Caption = 'ToolButton4'
       Style = tbsSeparator
     end
     object ToolButton6: TToolButton
-      Left = 337
+      Left = 345
       Top = 2
       Action = acNextStep
       Caption = 'ID_EXEC_NEXT'
     end
     object ToolButton7: TToolButton
-      Left = 363
+      Left = 371
       Top = 2
       Action = acStop
       Caption = 'ID_EXEC_STOP'
     end
     object ToolButton5: TToolButton
-      Left = 389
+      Left = 397
       Top = 2
       Action = acDebug
       Caption = 'ID_EXEC_DEBUG'
@@ -746,33 +746,33 @@ object Form1: TForm1
       ParentFont = False
     end
     object ToolButton8: TToolButton
-      Left = 331
+      Left = 337
       Height = 26
       Top = 2
       Caption = 'ToolButton8'
       Style = tbsSeparator
     end
     object ToolButton9: TToolButton
-      Left = 305
+      Left = 311
       Top = 2
       Action = acThisStep
       Caption = 'ID_EXEC_STATEMENT'
     end
     object ToolButton10: TToolButton
-      Left = 221
+      Left = 225
       Top = 2
       Action = acShowHexFile
       Caption = 'ID_PRGFILE'
     end
     object ToolButton11: TToolButton
-      Left = 215
+      Left = 217
       Height = 26
       Top = 2
       Caption = 'ToolButton11'
       Style = tbsSeparator
     end
     object ToolButton12: TToolButton
-      Left = 247
+      Left = 251
       Top = 2
       Action = acUpload
       Caption = 'ID_PRGULOAD'
@@ -790,19 +790,19 @@ object Form1: TForm1
       Style = tbsSeparator
     end
     object ToolButton15: TToolButton
-      Left = 163
+      Left = 165
       Top = 2
       Action = acNewRow
       Caption = 'ID_NEWLINE'
     end
     object ToolButton16: TToolButton
-      Left = 189
+      Left = 191
       Top = 2
       Action = acDeleteRow
       Caption = 'ID_DELLINE'
     end
     object ToolButton17: TToolButton
-      Left = 415
+      Left = 423
       Height = 26
       Top = 2
       Caption = 'ToolButton17'
@@ -827,7 +827,7 @@ object Form1: TForm1
       OptimalFill = True
     end
     object ToolButton19: TToolButton
-      Left = 273
+      Left = 277
       Top = 2
       Action = acHexFile
       Caption = 'ID_HEXFILE'
@@ -885,14 +885,10 @@ object Form1: TForm1
           Width = 32
         end      
         item
-          MinSize = 10
-          MaxSize = 200
           ReadOnly = True
           Title.Caption = 'ID_GRID_DESCRIPTION'
         end      
         item
-          MinSize = 10
-          MaxSize = 200
           SizePriority = 2
           Title.Caption = 'ID_GRID_COMMENT'
           Width = 128

+ 10 - 9
ugui.pas

@@ -1022,6 +1022,7 @@ begin
         SdpoSerial1.Device := comService;
         SdpoSerial1.Active := True;
 
+        SdpoSerial1.WriteData('h');
         if (not readString(line)) then
         begin
           error := True;
@@ -1415,20 +1416,20 @@ begin
 
     Label2.Visible := True;
     ADC2.Visible := True;
-    PWM2.Visible := False;
+    PWM2.Visible := True;
     Label16.Visible := False;
     RC1.Visible := False;
     Label17.Visible := False;
     RC2.Visible := False;
-    Servo1.Visible := False;
-    Servo2.Visible := False;
-    Shape1.Visible := False;
-    Shape2.Visible := False;
-    EditE.Visible := False;
-    EditF.Visible := False;
+    Servo1.Visible := True;
+    Servo2.Visible := True;
+    Shape1.Visible := True;
+    Shape2.Visible := True;
+    EditE.Visible := True;
+    EditF.Visible := True;
     acUpload.Enabled := True;
-    Label5.Visible := False;
-    btnTone.Visible := False;
+    Label5.Visible := True;
+    btnTone.Visible := True;
     ADC1.Value := 0;
     ADC1.MaxValue := 15;
     ADC2.Value := 0;

+ 34 - 30
usps.pas

@@ -676,8 +676,8 @@ begin
   if (cmd = 0) then
   begin
     case version of
-      Holtek, ATMega8, MicroBit, MicroBitV2: MCSStrings.copyArray2List(O_LIST_H, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(O_LIST_AT, list);
+      Holtek, ATMega8, MicroBit: MCSStrings.copyArray2List(O_LIST_H, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(O_LIST_AT, list);
     end;
   end;
   if (cmd = 1) then
@@ -693,31 +693,31 @@ begin
   if (cmd = 5) then
   begin
     case version of
-      Holtek, MicroBit, MicroBitV2: MCSStrings.copyArray2List(IS_A_LIST_H, list);
+      Holtek, MicroBit: MCSStrings.copyArray2List(IS_A_LIST_H, list);
       ATMega8: MCSStrings.copyArray2List(IS_A_LIST_A8, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(IS_A_LIST_AT, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(IS_A_LIST_AT, list);
     end;
   end;
   if (cmd = 6) then
   begin
     case version of
-      Holtek, MicroBit, MicroBitV2: MCSStrings.copyArray2List(A_IS_LIST_H, list);
+      Holtek, MicroBit: MCSStrings.copyArray2List(A_IS_LIST_H, list);
       ATMega8: MCSStrings.copyArray2List(A_IS_LIST_A8, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(A_IS_LIST_AT, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(A_IS_LIST_AT, list);
     end;
   end;
   if (cmd = 7) then
   begin
     case version of
-      Holtek, ATMega8, MicroBit, MicroBitV2: MCSStrings.copyArray2List(A_CALC_LIST_H, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(A_CALC_LIST_AT, list);
+      Holtek, ATMega8, MicroBit: MCSStrings.copyArray2List(A_CALC_LIST_H, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(A_CALC_LIST_AT, list);
     end;
   end;
   if (cmd = 8) then
   begin
     case version of
-      Holtek, ATMega8, MicroBit, MicroBitV2: MCSStrings.copyArray2List(PAGE_LIST_H, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(PAGE_LIST_AT, list);
+      Holtek, ATMega8, MicroBit: MCSStrings.copyArray2List(PAGE_LIST_H, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(PAGE_LIST_AT, list);
     end;
   end;
   if (cmd = 9) then
@@ -729,9 +729,9 @@ begin
   if (cmd = 12) then
   begin
     case version of
-      Holtek, MicroBit, MicroBitV2: MCSStrings.copyArray2List(SKIP_LIST_H, list);
+      Holtek, MicroBit: MCSStrings.copyArray2List(SKIP_LIST_H, list);
       ATMega8: MCSStrings.copyArray2List(SKIP_LIST_A8, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(SKIP_LIST_AT, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(SKIP_LIST_AT, list);
     end;
   end;
   if (cmd = 13) then
@@ -739,15 +739,15 @@ begin
   if (cmd = 14) then
   begin
     case version of
-      Holtek, ATMega8, MicroBit, MicroBitV2: MCSStrings.copyArray2List(RET_LIST_H, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(RET_LIST_AT, list);
+      Holtek, ATMega8, MicroBit: MCSStrings.copyArray2List(RET_LIST_H, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(RET_LIST_AT, list);
     end;
   end;
   if (cmd = 15) then
   begin
     case version of
-      Holtek, ATMega8, MicroBit, MicroBitV2: MCSStrings.copyArray2List(F_LIST_H, list);
-      ATTiny84, Arduino: MCSStrings.copyArray2List(F_LIST_AT, list);
+      Holtek, ATMega8, MicroBit: MCSStrings.copyArray2List(F_LIST_H, list);
+      ATTiny84, Arduino, MicroBitV2: MCSStrings.copyArray2List(F_LIST_AT, list);
     end;
   end;
 end;
@@ -888,7 +888,7 @@ var
 begin
   case Data of
     0: case version of
-        ATTiny84, Arduino:
+        ATTiny84, Arduino, MicroBitV2:
         begin
           tmpValue := b;
           b := a;
@@ -945,23 +945,23 @@ begin
     9: a := a xor b;
     10: a := not a;
     11: case version of
-        ATTiny84, Arduino: a := a mod b;
+        ATTiny84, Arduino, MicroBitV2: a := a mod b;
       end;
     12: case version of
-        ATTiny84, Arduino: a := a + 16 * b;
+        ATTiny84, Arduino, MicroBitV2: a := a + 16 * b;
       end;
     13: case version of
-        ATTiny84, Arduino: a := b - a;
+        ATTiny84, Arduino, MicroBitV2: a := b - a;
       end;
     14: case version of
-        ATTiny84, Arduino: a := a SHR 1;
+        ATTiny84, Arduino, MicroBitV2: a := a SHR 1;
       end;
     15: case version of
-        ATTiny84, Arduino: a := a SHL 1;
+        ATTiny84, Arduino, MicroBitV2: a := a SHL 1;
       end;
   end;
   case version of
-    Holtek, ATMega8, MicroBit, MicroBitV2: a := a and 15;
+    Holtek, ATMega8, MicroBit: a := a and 15;
   end;
 end;
 
@@ -1045,7 +1045,7 @@ procedure TSPS.doCall(Data: byte);
 begin
   saveaddr[saveCnt] := addr;
   case version of
-    ATTiny84, Arduino: saveCnt := saveCnt + 1;
+    ATTiny84, Arduino, MicroBitV2: saveCnt := saveCnt + 1;
   end;
   addr := adrpage + Data;
 end;
@@ -1056,7 +1056,7 @@ begin
   if (Data = 0) then
   begin
     case version of
-      ATTiny84, Arduino:
+      ATTiny84, Arduino, MicroBitV2:
       begin
         if (saveCnt = 0) then
         begin
@@ -1069,7 +1069,7 @@ begin
     addr := saveaddr[saveCnt];
     exit;
   end;
-  if ((Data <= 6) and ((version = ATTiny84) or (version = Arduino))) then
+  if ((Data <= 6) and ((version = ATTiny84) or (version = Arduino) or (version = MicroBitV2))) then
   begin
     // call subroutine number
     saveaddr[saveCnt] := addr;
@@ -1077,7 +1077,7 @@ begin
     addr := subs[Data];
     exit;
   end;
-  if ((Data = $0f) and ((version = ATTiny84) or (version = Arduino))) then
+  if ((Data = $0f) and ((version = ATTiny84) or (version = Arduino) or (version = MicroBitV2))) then
   begin
     doReset();
     exit;
@@ -1091,10 +1091,10 @@ begin
   // Some byte commands
   case (Data) of
     0: case version of
-        ATTiny84, Arduino: a := adc1;
+        ATTiny84, Arduino, MicroBitV2: a := adc1;
       end;
     1: case version of
-        ATTiny84, Arduino: a := adc2;
+        ATTiny84, Arduino, MicroBitV2: a := adc2;
       end;
     2: case version of
         ATTiny84, Arduino: a := rc1;
@@ -1122,8 +1122,12 @@ begin
     end;
     8:
       case version of
-        ATTiny84, Arduino: doTone(Data);
+        ATTiny84, Arduino, MicroBitV2: doTone(Data);
       end;
+    15: begin
+      addr := 0;
+      exit;
+    end;
   end;
 end;