Source
...
Target
Commits (5)
  • Robert Sprowson's avatar
    Explicitly test shift when Filer_Run-ning something on the Pinboard · 4941a771
    Robert Sprowson authored
    Filer-2_40 and later require explicit opt in, otherwise it's just a normal Filer_Run.
    
    Version 0.99. Tagged as 'Pinboard-0_99'
    4941a771
  • Jeffrey Lee's avatar
    Avoid unnecessary remainder calculations. Fix wonky "snap to grid" logic. · 31b58188
    Jeffrey Lee authored
    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'
    31b58188
  • Robert Sprowson's avatar
    Emit boot relative Pin/AddTinyDir commands where possible · 51a0712b
    Robert Sprowson authored
    When saving the desktop settings, use the same substring matching logic that !Configure's boot addapps/lookat/run uses, and replace the base of the name with Boot: or Boot:^.
    This means that if the boot drive is renamed the pinboard still starts up with the same items on it.
    Ditch support for Message_SaveDesktop - the code's been a NOP since Ursula (circa 1998).
    Tested on a Raspberry Pi, renaming the SD card.
    
    Version 1.01. Tagged as 'Pinboard-1_01'
    51a0712b
  • Robert Sprowson's avatar
    Remove use of RESOURCEEXTRA · 00992bc2
    Robert Sprowson authored
    Requires BuildSys-6_91.
    
    Version 1.02. Tagged as 'Pinboard-1_02'
    00992bc2
  • ROOL's avatar
    Fixes for pinboard backdrop sprite changing · f462c775
    ROOL authored
    Detail:
      Fix out-by-1 error in MakeCompactModeWord, the palette checksum read from array index -1 due to the loop construction.
      Consider the x/y size as well as the compact mode word when deciding whether to recache the backdrop sprite.
      Don't assume the screen byte size is equivalent to working out the sprite byte size, due to word rounding at the end of each line. Calculate it properly.
      Allow the Wimp_SlotSize to exactly equal the required memory (previously, had to be larger).
    Admin:
      Submission from Timothy Baldwin, with minor refactoring.
    
    Version 1.03. Tagged as 'Pinboard-1_03'
    f462c775
......@@ -21,8 +21,8 @@
# ---- ---- -----------
# 14-Mar-01 SNB Recreated
COMPONENT = Pinboard
RESOURCEEXTRA = resources_templates
COMPONENT = Pinboard
INSTRES_FILES = Templates
include StdTools
include AAsmModule
......
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.98"
Module_Version SETA 98
Module_MajorVersion SETS "1.03"
Module_Version SETA 103
Module_MinorVersion SETS ""
Module_Date SETS "09 Mar 2014"
Module_ApplicationDate SETS "09-Mar-14"
Module_Date SETS "06 May 2017"
Module_ApplicationDate SETS "06-May-17"
Module_ComponentName SETS "Pinboard"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Pinboard"
Module_FullVersion SETS "0.98"
Module_HelpVersion SETS "0.98 (09 Mar 2014)"
Module_FullVersion SETS "1.03"
Module_HelpVersion SETS "1.03 (06 May 2017)"
END
/* (0.98)
/* (1.03)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.98
#define Module_MajorVersion_CMHG 1.03
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Mar 2014
#define Module_Date_CMHG 06 May 2017
#define Module_MajorVersion "0.98"
#define Module_Version 98
#define Module_MajorVersion "1.03"
#define Module_Version 103
#define Module_MinorVersion ""
#define Module_Date "09 Mar 2014"
#define Module_Date "06 May 2017"
#define Module_ApplicationDate "09-Mar-14"
#define Module_ApplicationDate "06-May-17"
#define Module_ComponentName "Pinboard"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Pinboard"
#define Module_FullVersion "0.98"
#define Module_HelpVersion "0.98 (09 Mar 2014)"
#define Module_LibraryVersionInfo "0:98"
#define Module_FullVersion "1.03"
#define Module_HelpVersion "1.03 (06 May 2017)"
#define Module_LibraryVersionInfo "1:3"
......@@ -90,7 +90,7 @@ MakeCompactModeWord
SUBS r14, r14, #1
LDRB r1, [sp, r14, LSL #2]
ADD r0, r0, r1
BPL %BT10
BNE %BT10
ADD sp, sp, #20*4
......@@ -193,8 +193,16 @@ ModeChange
LDR r14, CachedBackdropMode
TEQ r0, r14
DebugIf NE, bd,"BackdropMode changed, recacheing sprite",r0,r14
DebugIf NE, bd,"BackdropMode changed",r0,r14
LDREQ r0, CachedBackdrop_x1
LDREQ r14, Screen_x1
TEQEQ r0, r14
LDREQ r0, CachedBackdrop_y1
LDREQ r14, Screen_y1
TEQEQ r0, r14
DebugIf NE, bd,"Backdrop mode changed, recacheing sprite"
03
BLNE CacheBackdropSprite
Pull "PC"
......@@ -395,7 +403,7 @@ Int_CacheBackdropSprite ROUT
TST r0,#bd_OptionScaled ; Scaled ?
BEQ %FT01
; Sprite is scaled, get screen size (r4 = width, r5 = height, r2 = memory req.)
; Sprite is scaled, get screen size (r4 = width, r5 = height)
MOV r0,#-1 ; Use current mode
......@@ -407,8 +415,6 @@ Int_CacheBackdropSprite ROUT
SWIVC XOS_ReadModeVariable
ADDVC r5,r2,#1
STRVC r5,scale_y1
MOVVC r1,#VduExt_ScreenSize
SWIVC XOS_ReadModeVariable ; R2= screen size in bytes
Pull "PC",VS
B %FT10 ; Go allocate memory etc.
......@@ -501,6 +507,7 @@ Int_CacheBackdropSprite ROUT
STR r2,scale_x1
Debug bd,"Width in OS units is ",r4
10
MOV r0,#-1
MOV r1,#VduExt_Log2BPP
SWI XOS_ReadModeVariable ; Get Log2BPP for current mode
......@@ -513,7 +520,6 @@ Int_CacheBackdropSprite ROUT
MUL r2,r3,r5 ; r2 = size in bytes
10
Debug bd,"Destination sprite width = ",r4
Debug bd,"Destination sprite height = ",r5
Debug bd,"Sprite size would be ",r2
......@@ -538,7 +544,7 @@ Int_CacheBackdropSprite ROUT
Debug bd,"actual Slot size is ",r0
CMP r3,r0
BLT got_memory
BLS got_memory
LDR r0,backdrop_handle
MOV r1,#0
......@@ -623,6 +629,11 @@ LoadedOK
Debug bd,"BackdropMode is brought to you by the number ",r0
LDR r0,Screen_x1
LDR r1,Screen_y1
STR r0,CachedBackdrop_x1
STR r1,CachedBackdrop_y1
LDR r0,=&100 + SpriteReason_CreateSprite
MOV r1,#&8000
ADRL r2,BackdropSpriteName ; Create new sprite in current mode
......
......@@ -359,7 +359,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
BNE %FT02
; If tidy to left
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
B %FT04
02 ; If tidy to right
......@@ -367,7 +367,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
LDR r11, Screen_x1
ADD r1, r11, #grid_x_spacing
SUB r2, r1, r5
DivRem r1, r2, r10, r0
DivRem r1, r2, r10, r0, norem
MUL r2, r1, r10
SUB r8, r11, r2
......@@ -379,7 +379,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
LDR r11, Screen_y1
ADD r1, r11, #grid_y_spacing
SUB r2, r1, r6
DivRem r1, r2, r10, r0
DivRem r1, r2, r10, r0, norem
MUL r2, r1, r10
SUB r9, r11, r2
B %FT08
......@@ -389,7 +389,7 @@ lock_movement_to_grid Entry "r0-r7, r10-r11"
CMP r6, #0 ; it's height.
MOVLT r6, #0
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
08 ; Get the state of the icon where the drag was started
......@@ -465,23 +465,23 @@ DragIconsToApp
STR r0,[r14],#4 ; Display mode is always 0 (large icons sort by name)
; Left column = bbox_left / grid_x_spacing
DivRem r10,r6,r4,r0
DivRem r10,r6,r4,r0,norem
STR r10,[r14],#4
; Top row = (screen_y - bbox_top) / grid_y_spacing
LDR r10,Screen_y1
SUB r9,r10,r9
DivRem r10,r9,r5,r0
DivRem r10,r9,r5,r0,norem
STR r10,[r14],#4
; Right column = bbox_right / grid_x_spacing
DivRem r10,r8,r4,r0
DivRem r10,r8,r4,r0,norem
STR r10,[r14],#4
; Bottom row = (screen_y - bbox_bottom) / grid_y_spacing
LDR r10,Screen_y1
SUB r7,r10,r7
DivRem r10,r7,r5,r0
DivRem r10,r7,r5,r0,norem
STR r10,[r14],#4
MOV r0,#0
......
......@@ -781,7 +781,7 @@ FindNearestGridXY Entry "r0-r4, r7-r11"
; If tidy to left
MOV r10, #grid_x_spacing
DivRem r1, r5, r10, r2
CMP r5, r10, LSR #2
CMP r5, r10, LSR #1
ADDGT r1, r1, #1
MUL r5, r1, r10 ; x = (mouse_x DIV x_spacing) * x_spacing
B %FT04
......
......@@ -512,7 +512,7 @@ OpenFiles Entry
LDR r7, [r7, #ic_next]
B %BT02
FilerRunCom DCB "Filer_Run ",0
FilerRunCom DCB "Filer_Run -Shift ",0
ALIGN
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
......@@ -87,9 +87,6 @@ message_received
TEQ r0, r14
BEQ close_task
TEQ r0, #Message_SaveDesktop
BEQ DesktopSave
LDR r14, =Message_HelpRequest
TEQ r0, r14
BEQ HelpRequest
......@@ -266,7 +263,7 @@ FilerSelection ROUT
; icon) appears underneath the pointer on the pinboard.
LDR r7, [r14, #44] ; r7 = mouse x
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
MUL r8, r9, r4
SUB r0, r7, r8 ; new x1 (nearly!)
......
......@@ -238,6 +238,8 @@ Screen_y1 # 4
XEig # 4 ; X and Y Eig factors for
YEig # 4 ; current mode.
CachedBackdropMode # 4 ; Mode for which the backdrop sprite was cached.
CachedBackdrop_x1 # 4 ;
CachedBackdrop_y1 # 4 ;
Buffered_list # 4 ; Buffered list of icons.
Icon_list # 4 ; List of active icons.
MonotonicID # 4 ; Monotonic ID for icons.
......@@ -279,6 +281,8 @@ drag_start # 8 ; x,y of iconized drag start
drag_window # 4
drag_icon # 4
save_filename_address # 4
save_boot_length # 4
save_boothat_length # 4
icon_bar_height # 4
;EventV_Claimed # 4 ; non-zero when we have EventV claimed
CaretPos # 4*6 ; stored caret position (e.g. who we took it from)
......
......@@ -14,7 +14,7 @@
;
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; s.Save
; Save and Desktop save handling.
; Save pinboard menu handling.
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -218,17 +218,8 @@ Save_DataSaveAck ROUT
DebugS sa,"Filename is ",r14
;MOV r0,#&8F
ADD r1,r1,#44
;DebugS sa,"Filename is ",r1
;SWI XOS_Find
;Pull "PC",VS
;Push "r0" ; SMC: save file handle for CloseFile
BL DoSave
;BL CloseFile
;ADD sp, sp, #4 ; SMC: don't need file handle now
;Pull "PC",VS ; SMC: return error from DoSave or CloseFile
ADR r1,dataarea
LDR r0,[r1,#8]
......@@ -253,12 +244,6 @@ Save_DataSaveAck ROUT
Pull "PC"
DesktopSave
;LDR r0, [r1, #msSaveDesktop_handle]
;BL DoSave
Pull "PC"
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; DoSave
;
......@@ -272,6 +257,36 @@ DoSave ROUT
MOV r8, r1 ; r8 -> filename
; Get substrings of Boot:
ADR r0, BootPathVar
ADR r1, dest_directory
MOV r2, #?dest_directory
MOV r3, #0
MOV r4, #VarType_Expanded
SWI XOS_ReadVarVal
MOV r0, #0
STRVCB r0, [r1, r2] ; FSName::Drive.$.![Arm]Boot.[,OtherStuff]...
BVS %FT20
10
LDRB lr, [r1, r0]
CMP lr, #','
BEQ %FT20
CMP lr, #' '
ADDHI r0, r0, #1
BHI %BT10
20
STR r0, save_boot_length ; FSName::Drive.$.![Arm]Boot.
STR r0, save_boothat_length
SUBS r0, r0, #2
BMI %FT40
30
LDRB lr, [r1, r0]
CMP lr, #'.'
BEQ %FT40
STR r0, save_boothat_length ; FSName::Drive.$.
SUBS r0, r0, #1
BPL %BT30
40
; Open file to write
MOV r0, #open_write :OR: open_pathbits :OR: open_mustopen :OR: open_nodir
MOV r1, r8
......@@ -304,9 +319,57 @@ DoSave ROUT
PinboardCommand DCB "Pinboard",0
TinyDirsCommand DCB "X AddTinyDir ", 0 ; ignore errors so that entering the desktop
PinCommand DCB "X Pin ", 0 ; doesn't result in scores of error boxes
BootPathVar DCB "Boot$$Path", 0
BootSubst DCB "Boot:", 0
BootHatSubst DCB "Boot:^.", 0
Space DCB " ", 0
NL DCB 10, 0
ALIGN
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; TryMatchBoot[Hat]
;
; Look for a match in the first <n> characters of a pin or addtinydir name
;
; In: r0 = filehandle of output
; r1 = null terminated string to try for a match
;
; Out: r1 = adjusted if match made, and prefix string written to filehandle
; all other regs preserved
TryMatchBoot Entry "r2-r5"
LDR r3, save_boot_length
ADR r4, BootSubst
B %FT10
TryMatchBootHat ALTENTRY
LDR r3, save_boothat_length
ADR r4, BootHatSubst
10
TEQ r3, #0
EXIT EQ ; Boot$Path unset, no match
ADR r2, dest_directory
LDRB r5, [r1, r3]
LDRB lr, [r2, r3]
Push "r0, r3, r5, lr"
MOV r5, #0
STRB r5, [r1, r3] ; Trim string for compare
STRB r5, [r2, r3] ; Trim Boot$Path for compare
MOV r0, #-1
MOV r3, #Collate_IgnoreCase
SWI XTerritory_Collate
CMP r0, #0
Pull "r0, r3, r5, lr"
STRB r5, [r1, r3] ; Restore
STRB lr, [r2, r3] ; Restore
EXIT NE ; No match (or error)
MOV r2, r1
MOV r1, r4
BL PutString
ADD r1, r2, r3 ; Adjust to string remainder
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; write_pin_commands
......@@ -325,20 +388,23 @@ write_pin_commands Entry "r1-r3"
CMP r2,#0
EXIT EQ
LDR r3,[r2,#ic_window]
CMP r3,#-2
CMP r3,#iconbar_whandle
ADREQ r1,TinyDirsCommand
ADRNE r1,PinCommand
BL PutString
EXIT VS
ADD r1,r2,#ic_path
BL TryMatchBoot
ADD lr,r2,#ic_path
TEQ lr,r1 ; Was there a substitution?
BLEQ TryMatchBootHat ; No, so try the smaller substring
BL PutString
EXIT VS
ADREQ r1,NL
BLEQ PutString
EXIT VS
BEQ %BT02
CMP r3,#iconbar_whandle
BEQ %FT03 ; AddTinyDir has no x,y
ADR r1,Space
BL PutString
EXIT VS
......@@ -346,9 +412,6 @@ write_pin_commands Entry "r1-r3"
Push "r0-r2"
ADR r1,ConversionSpace
LDR r0,[r2,#ic_x]
CMP r0,#0
MOVLT r2,#"0"
STRLTB r2,[r1],#1
MOV r2,#256
SWI XOS_ConvertInteger4
STRVS r0,[sp]
......@@ -357,6 +420,7 @@ write_pin_commands Entry "r1-r3"
ADR r1,ConversionSpace
BL PutString
EXIT VS
ADRL r1,Space
BL PutString
EXIT VS
......@@ -372,6 +436,7 @@ write_pin_commands Entry "r1-r3"
ADR r1,ConversionSpace
BL PutString
EXIT VS
03
ADRL r1,NL
BL PutString
EXIT VS
......
......@@ -73,7 +73,6 @@ MessagesList
[ :LNOT: ursulawimp
DCD Message_PaletteChange
]
DCD Message_SaveDesktop
DCD Message_MenusDeleted
DCD Message_HelpRequest
DCD Message_Iconize
......@@ -153,6 +152,8 @@ Start
STR r0,Windows_Selected
STR r0,Iconbar_Icons
STR r0,soft_selection_window
STR r0,CachedBackdrop_x1
STR r0,CachedBackdrop_y1
SUB r0,r0,#1
STR r0,CachedBackdropMode
......@@ -542,7 +543,7 @@ PlotImageTiled
LDR r14,[r1,#28] ; X0 of current rectangle.
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
Debug bd,"First x ",r6
......@@ -558,7 +559,7 @@ PlotImageTiled
LDR r4,[r1,#32] ; Y0 of current rectangle.
SUB r2,r0,r4 ; r2 = ScrY1 - Y0
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 ;
MUL r5,r3,r14 ; r5 = INT ( (ScrY1-Y0+YSize-1) / YSize ) * YSize
SUB r8,r0,r5 ; r3 = ScrY1 - r5 (Base Y)
......