Browse Source

* fixed the encoding of negative integers in BAS_EncodeNumber

git-svn-id: branches/z80@44593 -
nickysn 5 years ago
parent
commit
f7c213738e
1 changed files with 2 additions and 7 deletions
  1. 2 7
      utils/ihx2tzx/zxbasic.pas

+ 2 - 7
utils/ihx2tzx/zxbasic.pas

@@ -135,13 +135,8 @@ begin
   if (N >= -65535) and (N <= 65535) then
   begin
     Str(N, Result);
-    if N >= 0 then
-      Result := Result + #14#0#0 + Chr(Byte(N)) + Chr(Byte(N shr 8)) + #0
-    else
-    begin
-      N := Word(N + 131072);
-      Result := Result + #14#0#255 + Chr(Byte(N)) + Chr(Byte(N shr 8)) + #0;
-    end;
+    N := Abs(N);
+    Result := Result + #14#0#0 + Chr(Byte(N)) + Chr(Byte(N shr 8)) + #0;
   end
   else
     Result := BAS_EncodeNumber(Real(N));