Advertisement
paul_nicholls

Untitled

Sep 14th, 2024
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.10 KB | None | 0 0
  1. procedure expandCharacter2x(srcData,dstData : Pointer);
  2. var
  3.   dByteL : Byte;
  4.   dByteR : Byte;
  5.  
  6.   sByte  : Byte;
  7.   dDataL : Byte;
  8.   dDataR : Byte;
  9.   sData  : Byte;
  10.   y      : Byte;
  11. begin
  12. // A -> AB
  13. //      CD
  14.   dByteL := 0;
  15.   dByteR := dByteL+8;
  16.   for y := 0 to 7 do begin
  17.     sByte := y div 2;
  18.     sData := srcData^[sByte];
  19.     asm
  20.       // do left hand/right hand char shift dData <- sData
  21.       lda sData
  22.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  23.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  24.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  25.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  26.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  27.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  28.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  29.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  30.     end;
  31.     dstData^[dByteL] := dDataL;
  32.     dstData^[dByteR] := dDataR;
  33.     Inc(dByteL);
  34.     Inc(dByteR);
  35.   end;
  36.  
  37.   dByteL := 16;
  38.   dByteR := dByteL+8;
  39.   for y := 8 to 15 do begin
  40.     sByte := y div 2;
  41.     sData := srcData^[sByte];
  42.     asm
  43.       // do left hand/right hand char shift dData <- sData
  44.       lda sData
  45.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  46.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  47.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  48.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  49.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  50.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  51.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  52.       cmp #128; rol dDataR; rol dDataL; cmp #128; rol dDataR; rol dDataL; asl
  53.     end;
  54.     dstData^[dByteL] := dDataL;
  55.     dstData^[dByteR] := dDataR;
  56.     Inc(dByteL);
  57.     Inc(dByteR);
  58.   end;
  59. end;
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement