Commit 31b58188 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Avoid unnecessary remainder calculations. Fix wonky "snap to grid" logic.

Detail:
  s/Drag, s/Messages, s/StartLoop - Avoid unnecessary remainder calculation in DivRem macro
  s/Icons - Fix grid coordinate rounding when tidying to the left
Admin:
  Tested on Cortex-A15


Version 1.00. Tagged as 'Pinboard-1_00'
parent 4941a771
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "0.99" Module_MajorVersion SETS "1.00"
Module_Version SETA 99 Module_Version SETA 100
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "29 Sep 2015" Module_Date SETS "08 May 2016"
Module_ApplicationDate SETS "29-Sep-15" Module_ApplicationDate SETS "08-May-16"
Module_ComponentName SETS "Pinboard" Module_ComponentName SETS "Pinboard"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Pinboard" Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Pinboard"
Module_FullVersion SETS "0.99" Module_FullVersion SETS "1.00"
Module_HelpVersion SETS "0.99 (29 Sep 2015)" Module_HelpVersion SETS "1.00 (08 May 2016)"
END END
/* (0.99) /* (1.00)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.99 #define Module_MajorVersion_CMHG 1.00
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 29 Sep 2015 #define Module_Date_CMHG 08 May 2016
#define Module_MajorVersion "0.99" #define Module_MajorVersion "1.00"
#define Module_Version 99 #define Module_Version 100
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "29 Sep 2015" #define Module_Date "08 May 2016"
#define Module_ApplicationDate "29-Sep-15" #define Module_ApplicationDate "08-May-16"
#define Module_ComponentName "Pinboard" #define Module_ComponentName "Pinboard"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Pinboard" #define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Pinboard"
#define Module_FullVersion "0.99" #define Module_FullVersion "1.00"
#define Module_HelpVersion "0.99 (29 Sep 2015)" #define Module_HelpVersion "1.00 (08 May 2016)"
#define Module_LibraryVersionInfo "0:99" #define Module_LibraryVersionInfo "1:0"
...@@ -359,7 +359,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11" ...@@ -359,7 +359,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
BNE %FT02 BNE %FT02
; If tidy to left ; If tidy to left
MOV r10, #grid_x_spacing MOV r10, #grid_x_spacing
DivRem r1, r5, r10, r2 DivRem r1, r5, r10, r2, norem
MUL r8, r1, r10 ; x = (mouse_x DIV x_spacing) * x_spacing MUL r8, r1, r10 ; x = (mouse_x DIV x_spacing) * x_spacing
B %FT04 B %FT04
02 ; If tidy to right 02 ; If tidy to right
...@@ -367,7 +367,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11" ...@@ -367,7 +367,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
LDR r11, Screen_x1 LDR r11, Screen_x1
ADD r1, r11, #grid_x_spacing ADD r1, r11, #grid_x_spacing
SUB r2, r1, r5 SUB r2, r1, r5
DivRem r1, r2, r10, r0 DivRem r1, r2, r10, r0, norem
MUL r2, r1, r10 MUL r2, r1, r10
SUB r8, r11, r2 SUB r8, r11, r2
...@@ -379,7 +379,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11" ...@@ -379,7 +379,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
LDR r11, Screen_y1 LDR r11, Screen_y1
ADD r1, r11, #grid_y_spacing ADD r1, r11, #grid_y_spacing
SUB r2, r1, r6 SUB r2, r1, r6
DivRem r1, r2, r10, r0 DivRem r1, r2, r10, r0, norem
MUL r2, r1, r10 MUL r2, r1, r10
SUB r9, r11, r2 SUB r9, r11, r2
B %FT08 B %FT08
...@@ -389,7 +389,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11" ...@@ -389,7 +389,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
CMP r6, #0 ; it's height. CMP r6, #0 ; it's height.
MOVLT r6, #0 MOVLT r6, #0
MOV r10, #grid_y_spacing MOV r10, #grid_y_spacing
DivRem r1, r6, r10, r2 DivRem r1, r6, r10, r2, norem
MLA r9, r1, r10, r0 ; y = (mouse_y DIV y_spacing) * y_spacing) + icon_bar_height MLA r9, r1, r10, r0 ; y = (mouse_y DIV y_spacing) * y_spacing) + icon_bar_height
08 ; Get the state of the icon where the drag was started 08 ; Get the state of the icon where the drag was started
...@@ -465,23 +465,23 @@ DragIconsToApp ...@@ -465,23 +465,23 @@ DragIconsToApp
STR r0,[r14],#4 ; Display mode is always 0 (large icons sort by name) STR r0,[r14],#4 ; Display mode is always 0 (large icons sort by name)
; Left column = bbox_left / grid_x_spacing ; Left column = bbox_left / grid_x_spacing
DivRem r10,r6,r4,r0 DivRem r10,r6,r4,r0,norem
STR r10,[r14],#4 STR r10,[r14],#4
; Top row = (screen_y - bbox_top) / grid_y_spacing ; Top row = (screen_y - bbox_top) / grid_y_spacing
LDR r10,Screen_y1 LDR r10,Screen_y1
SUB r9,r10,r9 SUB r9,r10,r9
DivRem r10,r9,r5,r0 DivRem r10,r9,r5,r0,norem
STR r10,[r14],#4 STR r10,[r14],#4
; Right column = bbox_right / grid_x_spacing ; Right column = bbox_right / grid_x_spacing
DivRem r10,r8,r4,r0 DivRem r10,r8,r4,r0,norem
STR r10,[r14],#4 STR r10,[r14],#4
; Bottom row = (screen_y - bbox_bottom) / grid_y_spacing ; Bottom row = (screen_y - bbox_bottom) / grid_y_spacing
LDR r10,Screen_y1 LDR r10,Screen_y1
SUB r7,r10,r7 SUB r7,r10,r7
DivRem r10,r7,r5,r0 DivRem r10,r7,r5,r0,norem
STR r10,[r14],#4 STR r10,[r14],#4
MOV r0,#0 MOV r0,#0
......
...@@ -781,7 +781,7 @@ FindNearestGridXY Entry "r0-r4, r7-r11" ...@@ -781,7 +781,7 @@ FindNearestGridXY Entry "r0-r4, r7-r11"
; If tidy to left ; If tidy to left
MOV r10, #grid_x_spacing MOV r10, #grid_x_spacing
DivRem r1, r5, r10, r2 DivRem r1, r5, r10, r2
CMP r5, r10, LSR #2 CMP r5, r10, LSR #1
ADDGT r1, r1, #1 ADDGT r1, r1, #1
MUL r5, r1, r10 ; x = (mouse_x DIV x_spacing) * x_spacing MUL r5, r1, r10 ; x = (mouse_x DIV x_spacing) * x_spacing
B %FT04 B %FT04
......
...@@ -266,7 +266,7 @@ FilerSelection ROUT ...@@ -266,7 +266,7 @@ FilerSelection ROUT
; icon) appears underneath the pointer on the pinboard. ; icon) appears underneath the pointer on the pinboard.
LDR r7, [r14, #44] ; r7 = mouse x LDR r7, [r14, #44] ; r7 = mouse x
SUB r8, r7, r0 ; r8 = mouse x - x1 SUB r8, r7, r0 ; r8 = mouse x - x1
DivRem r9, r8, r4, r10 ; r9 = column number of initiating icon DivRem r9, r8, r4, r10, norem ; r9 = column number of initiating icon
MOV r4, #grid_x_spacing ; new item width MOV r4, #grid_x_spacing ; new item width
MUL r8, r9, r4 MUL r8, r9, r4
SUB r0, r7, r8 ; new x1 (nearly!) SUB r0, r7, r8 ; new x1 (nearly!)
......
...@@ -542,7 +542,7 @@ PlotImageTiled ...@@ -542,7 +542,7 @@ PlotImageTiled
LDR r14,[r1,#28] ; X0 of current rectangle. LDR r14,[r1,#28] ; X0 of current rectangle.
LDR r0,scale_x1 ; width of image in OS units LDR r0,scale_x1 ; width of image in OS units
DivRem r3,r14,r0,r2 ; DivRem r3,r14,r0,r2,norem ;
MUL r6,r0,r3 ; MinX of leftmost tile to plot MUL r6,r0,r3 ; MinX of leftmost tile to plot
Debug bd,"First x ",r6 Debug bd,"First x ",r6
...@@ -558,7 +558,7 @@ PlotImageTiled ...@@ -558,7 +558,7 @@ PlotImageTiled
LDR r4,[r1,#32] ; Y0 of current rectangle. LDR r4,[r1,#32] ; Y0 of current rectangle.
SUB r2,r0,r4 ; r2 = ScrY1 - Y0 SUB r2,r0,r4 ; r2 = ScrY1 - Y0
ADD r2,r2,r3 ; r2 = (ScrY1-Y0)+YSize-1 ADD r2,r2,r3 ; r2 = (ScrY1-Y0)+YSize-1
DivRem r3,r2,r14,r5 ; r3 = (ScrY1-Y0+YSize-1) / YSize DivRem r3,r2,r14,r5,norem ; r3 = (ScrY1-Y0+YSize-1) / YSize
LDR r14,scale_y1 ; LDR r14,scale_y1 ;
MUL r5,r3,r14 ; r5 = INT ( (ScrY1-Y0+YSize-1) / YSize ) * YSize MUL r5,r3,r14 ; r5 = INT ( (ScrY1-Y0+YSize-1) / YSize ) * YSize
SUB r8,r0,r5 ; r3 = ScrY1 - r5 (Base Y) SUB r8,r0,r5 ; r3 = ScrY1 - r5 (Base Y)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment