From a2eed66ea8fc118bda969ffe17e735800726ab8b Mon Sep 17 00:00:00 2001
From: Kevin Bracey <kbracey@gitlab.riscosopen.org>
Date: Wed, 4 May 2005 11:14:34 +0000
Subject: [PATCH] Added code for hardware acceleration of "scroll down"
 function. Untested.

Version 5.35, 4.79.2.85. Tagged as 'Kernel-5_35-4_79_2_85'
---
 VersionASM    | 10 +++++-----
 VersionNum    | 14 +++++++-------
 s/vdu/vduwrch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 12 deletions(-)

diff --git a/VersionASM b/VersionASM
index 866773a..640ce14 100644
--- a/VersionASM
+++ b/VersionASM
@@ -13,11 +13,11 @@
                         GBLS    Module_ComponentPath
 Module_MajorVersion     SETS    "5.35"
 Module_Version          SETA    535
-Module_MinorVersion     SETS    "4.79.2.84"
-Module_Date             SETS    "21 Mar 2005"
-Module_ApplicationDate  SETS    "21-Mar-05"
+Module_MinorVersion     SETS    "4.79.2.85"
+Module_Date             SETS    "04 May 2005"
+Module_ApplicationDate  SETS    "04-May-05"
 Module_ComponentName    SETS    "Kernel"
 Module_ComponentPath    SETS    "RiscOS/Sources/Kernel"
-Module_FullVersion      SETS    "5.35 (4.79.2.84)"
-Module_HelpVersion      SETS    "5.35 (21 Mar 2005) 4.79.2.84"
+Module_FullVersion      SETS    "5.35 (4.79.2.85)"
+Module_HelpVersion      SETS    "5.35 (04 May 2005) 4.79.2.85"
                         END
diff --git a/VersionNum b/VersionNum
index 63ef8d7..d6bc04f 100644
--- a/VersionNum
+++ b/VersionNum
@@ -5,19 +5,19 @@
  *
  */
 #define Module_MajorVersion_CMHG        5.35
-#define Module_MinorVersion_CMHG        4.79.2.84
-#define Module_Date_CMHG                21 Mar 2005
+#define Module_MinorVersion_CMHG        4.79.2.85
+#define Module_Date_CMHG                04 May 2005
 
 #define Module_MajorVersion             "5.35"
 #define Module_Version                  535
-#define Module_MinorVersion             "4.79.2.84"
-#define Module_Date                     "21 Mar 2005"
+#define Module_MinorVersion             "4.79.2.85"
+#define Module_Date                     "04 May 2005"
 
-#define Module_ApplicationDate          "21-Mar-05"
+#define Module_ApplicationDate          "04-May-05"
 
 #define Module_ComponentName            "Kernel"
 #define Module_ComponentPath            "RiscOS/Sources/Kernel"
 
-#define Module_FullVersion              "5.35 (4.79.2.84)"
-#define Module_HelpVersion              "5.35 (21 Mar 2005) 4.79.2.84"
+#define Module_FullVersion              "5.35 (4.79.2.85)"
+#define Module_HelpVersion              "5.35 (04 May 2005) 4.79.2.85"
 #define Module_LibraryVersionInfo       "5:35"
diff --git a/s/vdu/vduwrch b/s/vdu/vduwrch
index 3e51a9e..e3b381d 100644
--- a/s/vdu/vduwrch
+++ b/s/vdu/vduwrch
@@ -1925,6 +1925,7 @@ TryCopyUpCommon
         Pull    PC,MI                   ; return with Z clear (unsuccessful)
         MOV     R2, R0                  ; dstL=srcL
         ADD     R3, R1, R7              ; dstB=srcB +1row
+TryCopyCommon
         Push    "R0-R5"
         MOV     R0, #3
         MOV     R1, #1
@@ -1950,6 +1951,45 @@ TryCopyWindowUp
         Push    R14
         ADR     R14, TryCopyUpCommon
         B       TextWindowToGraphics
+
+; *****************************************************************************
+;
+;       TryCopyScreenDown - use GraphicsV to copy screen down
+;
+; in:   nothing
+; out:  R0-R11 corrupted
+;       Z flag set if successful
+
+TryCopyScreenDown
+        Push    R14
+        BL      CheckAcceleration
+        Pull    PC, NE                  ; return with Z clear (unsuccessful)
+        BL      ScreenToGraphics
+TryCopyDownCommon
+        SUB     R4, R2, R0              ; width-1
+        SUB     R5, R3, R1              ; height-1
+        SUBS    R5, R5, R7              ; less one row
+        Pull    PC,MI                   ; return with Z clear (unsuccessful)
+        MOV     R2, R0                  ; dstL=srcL
+        MOV     R3, R1                  ; dstB=bot
+        ADD     R1, R1, R7              ; srcB=bot +1row
+        B       TryCopyCommon
+
+; .............................................................................
+;
+;       TryCopyWindowDown - use GraphicsV to copy window down
+;
+; in:   nothing
+; out:  R0-R11 corrupted
+;       Z flag set if successful
+
+TryCopyWindowDown
+        LDR     R0, [WsPtr, #VduSprite]
+        TEQ     R0, #0                  ; don't try it if outputting to sprite
+        MOVNE   PC, R14                 ; return with Z clear (unsuccessful)
+        Push    R14
+        ADR     R14, TryCopyDownCommon
+        B       TextWindowToGraphics
  ]
 
 ; *****************************************************************************
@@ -2006,6 +2046,11 @@ HardScrollSpriteDown
         Push    R14
         TST     R6, #TeletextMode
         BNE     TTXSoftScrollDown
+ [ UseGraphicsV
+        BL      TryCopyScreenDown
+        Pull    R14, EQ
+        BEQ     ClearTopLine
+ ]
         BL      GetScreenInfo           ; get box info for whole 'screen'
 
         MOV     R0, #0
@@ -2030,6 +2075,11 @@ SoftScrollDown
         TST     R6, #TeletextMode
         BNE     TTXSoftScrollDown
 
+ [ UseGraphicsV
+        BL      TryCopyWindowDown
+        Pull    R14, EQ
+        BEQ     ClearTopLine
+ ]
         BL      GetWindowInfo
 
 ;       R2 = address of top left
-- 
GitLab