From 6fa787674f53b7e01dfb9f2de12e92367c44ba0c Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 9 Feb 2021 16:58:20 +0000 Subject: [PATCH] + unicode version of MoveBuf git-svn-id: branches/unicodekvm@48555 - --- packages/fv/src/drivers.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/fv/src/drivers.inc b/packages/fv/src/drivers.inc index b769a8d2b4..1f07013292 100644 --- a/packages/fv/src/drivers.inc +++ b/packages/fv/src/drivers.inc @@ -1039,6 +1039,19 @@ END; {---------------------------------------------------------------------------} { MoveBuf -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 10Jul99 LdB } {---------------------------------------------------------------------------} +{$ifdef FV_UNICODE} +PROCEDURE MoveBuf (Var Dest, Source; Attr: Byte; Count: Sw_Word); +VAR I: Word; P: PEnhancedVideoCell; +BEGIN + { todo: split string into extended grapheme clusters properly, handle non-BMP characters, + handle wide (CJK) characters, etc. } + For I := 1 To Count Do Begin + P := @(PEnhancedVideoCell(@Dest)[I-1]); { Pointer to TEnhancedVideoCell } + If (Attr <> 0) Then P^.Attribute := Attr; { Copy attribute } + P^.ExtendedGraphemeCluster := WideChar(TWordArray(Source)[I-1]); { Copy source data } + End; +END; +{$else FV_UNICODE} PROCEDURE MoveBuf (Var Dest, Source; Attr: Byte; Count: Sw_Word); VAR I: Word; P: PWord; BEGIN @@ -1048,6 +1061,7 @@ BEGIN WordRec(P^).Lo := TByteArray(Source)[I-1]; { Copy source data } End; END; +{$endif FV_UNICODE} {---------------------------------------------------------------------------} { MoveChar -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 10Jul99 LdB }