Source
...
Target
Commits (1)
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
| See the License for the specific language governing permissions and | See the License for the specific language governing permissions and
| limitations under the License. | limitations under the License.
| |
RMLoad <Obey$Dir>.RM.Free RMLoad <Obey$Dir>.RM.<Machine>.Free
RMreinit sharefs RMreinit sharefs
RMreinit Filer RMreinit Filer
WimpTask Desktop WimpTask Desktop
File deleted
No preview for this file type
; ;
; 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.68. ; Last processed by srccommit version: 1.1.
; ;
GBLS Module_MajorVersion GBLS Module_MajorVersion
GBLA Module_Version GBLA Module_Version
...@@ -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.39" Module_MajorVersion SETS "0.40"
Module_Version SETA 39 Module_Version SETA 40
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "26 Nov 2002" Module_Date SETS "28 Nov 2011"
Module_ApplicationDate SETS "26-Nov-02" Module_ApplicationDate SETS "28-Nov-11"
Module_ComponentName SETS "Free" Module_ComponentName SETS "Free"
Module_ComponentPath SETS "RiscOS/Sources/Desktop/Free" Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Free"
Module_FullVersion SETS "0.39" Module_FullVersion SETS "0.40"
Module_HelpVersion SETS "0.39 (26 Nov 2002)" Module_HelpVersion SETS "0.40 (28 Nov 2011)"
END END
/* (0.39) /* (0.40)
* *
* 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.68. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.39 #define Module_MajorVersion_CMHG 0.40
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 26 Nov 2002 #define Module_Date_CMHG 28 Nov 2011
#define Module_MajorVersion "0.39" #define Module_MajorVersion "0.40"
#define Module_Version 39 #define Module_Version 40
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "26 Nov 2002" #define Module_Date "28 Nov 2011"
#define Module_ApplicationDate "26-Nov-02" #define Module_ApplicationDate "28-Nov-11"
#define Module_ComponentName "Free" #define Module_ComponentName "Free"
#define Module_ComponentPath "RiscOS/Sources/Desktop/Free" #define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Free"
#define Module_FullVersion "0.39" #define Module_FullVersion "0.40"
#define Module_HelpVersion "0.39 (26 Nov 2002)" #define Module_HelpVersion "0.40 (28 Nov 2011)"
#define Module_LibraryVersionInfo "0:39" #define Module_LibraryVersionInfo "0:40"
...@@ -58,29 +58,22 @@ Module_BaseAddr ...@@ -58,29 +58,22 @@ Module_BaseAddr
GET Hdr:System GET Hdr:System
GET Hdr:ModHand GET Hdr:ModHand
GET Hdr:Services GET Hdr:Services
GET Hdr:VduExt
GET Hdr:FSNumbers GET Hdr:FSNumbers
GET Hdr:HighFSI GET Hdr:HighFSI
GET Hdr:NewErrors GET Hdr:NewErrors
GET Hdr:Variables GET Hdr:Variables
GET Hdr:Proc GET Hdr:Proc
GET Hdr:Sprite
GET Hdr:Wimp GET Hdr:Wimp
GET Hdr:WimpSpace GET Hdr:WimpSpace
GET Hdr:Messages GET Hdr:Messages
GET Hdr:FilerAct
GET Hdr:Machine.<Machine>
GET Hdr:CMOS GET Hdr:CMOS
GET Hdr:MsgTrans GET Hdr:MsgTrans
GET Hdr:MsgMenus
GET Hdr:ResourceFS GET Hdr:ResourceFS
GET Hdr:ColourTran
GET Hdr:Hourglass
GET Hdr:ADFS GET Hdr:ADFS
GET Hdr:RamFS GET Hdr:RamFS
GET Hdr:SCSIFS GET Hdr:SCSIFS
GET Hdr:Econet GET Hdr:Econet
GET Hdr:PCCardFS ;PCMCIA Support GET Hdr:PCCardFS
GET Hdr:UpCall GET Hdr:UpCall
GET Hdr:HostFS GET Hdr:HostFS
GET Hdr:NdrDebug GET Hdr:NdrDebug
...@@ -93,34 +86,24 @@ Module_BaseAddr ...@@ -93,34 +86,24 @@ Module_BaseAddr
standalone SETL {FALSE} standalone SETL {FALSE}
] ]
; General tracing
GBLL debugxx GBLL debugxx
GBLL hostvdu GBLL hostvdu
debug SETL {FALSE}
debugxx SETL {FALSE}
hostvdu SETL {TRUE}
debug SETL false ; Options switches
debugxx SETL false ; General tracing.
hostvdu SETL true
; options switches
GBLL fix_silly_sizes GBLL fix_silly_sizes
fix_silly_sizes SETL true ; checks for free > size fix_silly_sizes SETL {TRUE} ; checks for free > size
; ---------------------------------------------------------------------------------------------------------------------- ; Local macros
MACRO
$label ALIGNHASH $o,$m
[ ((@-$o):AND:($m-1))<>0
$label # $m-((@-$o):AND:($m-1))
|
$label # 0
]
MEND
;-----------------------------------------------------------------------------------------------------------------------
MACRO MACRO
CMPSTR $a,$b CMPSTR $a,$b
Push "r0,r1,LR" Push "r0,r1,LR"
MOV r0,$a MOV r0,$a
MOV r1,$b MOV r1,$b
BL cmpstr BL stricmp
Pull "r0,r1,LR" Pull "r0,r1,LR"
MEND MEND
...@@ -159,10 +142,7 @@ fs_block_size * (@-fs_next) ...@@ -159,10 +142,7 @@ fs_block_size * (@-fs_next)
; Workspace layout ; Workspace layout
indirected_space * 512 ^ 0, R12
workspace RN R12
^ 0,workspace
wsorigin # 0 wsorigin # 0
mytaskhandle # 4 ; put here so we know where it is mytaskhandle # 4 ; put here so we know where it is
...@@ -174,11 +154,12 @@ disc_name # 4 ; Disc name for filecore ...@@ -174,11 +154,12 @@ disc_name # 4 ; Disc name for filecore
disc_desc # 64 ; Disc descriptor for filecore disc_desc # 64 ; Disc descriptor for filecore
message_fblock # 16 ; MessageTrans file descriptor block message_fblock # 16 ; MessageTrans file descriptor block
message_fopen # 4 ; Message file open flag message_fopen # 4 ; Message file open flag
message_bytes # 16 ; Lookup of international 'bytes'
indirected_data_offset * (@-wsorigin) indirected_data_offset * (@-wsorigin)
indirected_data # indirected_space ; Data area for indirected data from the template file indirected_data # 512 ; Data area for indirected data from the template file
ALIGNHASH wsorigin,16 AlignSpace 16
dataarea # &100 ; wimp data block dataarea # &100 ; wimp data block
windowarea # &300 ; Place to store window template. windowarea # &300 ; Place to store window template.
...@@ -186,14 +167,14 @@ stackbot # &200 ; stack at most 512 bytes long ...@@ -186,14 +167,14 @@ stackbot # &200 ; stack at most 512 bytes long
stacktop # 0 stacktop # 0
max_running_work * (@-wsorigin) max_running_work * (@-wsorigin)
; --------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; Icon values in template ; Icon values in template
icon_Size * 8 icon_Free * 2
icon_SizeBar * 5 icon_FreeBar * 4
icon_Free * 7 icon_Used * 6
icon_FreeBar * 6 icon_UsedBar * 8
icon_Used * 1 icon_Size * 10
icon_UsedBar * 4 icon_SizeBar * 12
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
LNK ModHead.s LNK ModHead.s
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
; ;
; > s.Messages ; > s.Messages
; ----------------------------------------------------------------------------------------------------------------------
; Received a recorded message ; Received a recorded message
message_received_ack message_received_ack
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
...@@ -25,31 +26,19 @@ message_received ...@@ -25,31 +26,19 @@ message_received
BEQ quit_routine BEQ quit_routine
Pull "PC" Pull "PC"
LTORG
; ----------------------------------------------------------------------------------------------------------------------
copy_r0r4_null
01
LDRB r6, [r4], #1
STRB r6, [r0], #1
CMP r6, #0
BNE %BT01
SUB r0, r0, #1
MOV PC, LR
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
; CLose all icons windows ; CLose all icons windows
quit_routine quit_routine
ADR r2, windows_ptr ADR r2, windows_ptr
BL free_list BL free_list
LDR r1, task_storev2 LDR r1, taskidentifier
LDR r0, mytaskhandle LDR r0, mytaskhandle
SWI XWimp_CloseDown SWI XWimp_CloseDown
MOV r0, #0 MOV r0, #0
STR r0, mytaskhandle STR r0, mytaskhandle
SWI OS_Exit SWI OS_Exit
task_storev2
DCB "TASK"
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
LNK s.ADFS LNK s.ADFS
...@@ -146,7 +146,7 @@ ShowFree_Code ...@@ -146,7 +146,7 @@ ShowFree_Code
LDR r1,[r2] ; Pointer to FS name. LDR r1,[r2] ; Pointer to FS name.
DebugS xx,"FSName is ",r1 DebugS xx,"FSName is ",r1
MOV r2,#0 MOV r2,#0
MOV r0,#13 MOV r0,#FSControl_LookupFS
SWI XOS_FSControl ; Get filing system number. SWI XOS_FSControl ; Get filing system number.
CMP r2,#0 CMP r2,#0
...@@ -192,7 +192,7 @@ create_window ; Window not found, create new window bl ...@@ -192,7 +192,7 @@ create_window ; Window not found, create new window bl
MOV r3,#window_block_size MOV r3,#window_block_size
ADD r3,r3,r5 ; Plus length of name. ADD r3,r3,r5 ; Plus length of name.
MOV r0,#6 MOV r0,#ModHandReason_Claim
SWI XOS_Module ; Claim block. SWI XOS_Module ; Claim block.
Pull "PC",VS Pull "PC",VS
...@@ -234,7 +234,7 @@ Init Entry ...@@ -234,7 +234,7 @@ Init Entry
CMP r2, #0 ; clears V CMP r2, #0 ; clears V
BNE %FT01 BNE %FT01
MOV r0, #6 MOV r0, #ModHandReason_Claim
MOV r3, #max_running_work MOV r3, #max_running_work
SWI XOS_Module SWI XOS_Module
EXIT VS EXIT VS
......
...@@ -105,26 +105,26 @@ NFS_GetSpace64 ...@@ -105,26 +105,26 @@ NFS_GetSpace64
NFS_ComparePath NFS_ComparePath
Push "r0-r9" Push "r0-r9"
Debug xx,"NFS compare path" Debug xx,"NFS compare path"
ADD r2,r2,#1 ADD r2,r2,#1
ADR r1,dataarea ADR r1,dataarea
01 01
LDRB r0,[r2],#1 LDRB r0,[r2],#1
CMP r0,#"." CMP r0,#"."
Debug xx,"Copy ",r0 Debug xx,"Copy ",r0
MOVEQ r0,#0 MOVEQ r0,#0
STRB r0,[r1],#1 STRB r0,[r1],#1
CMP r0,#0 CMP r0,#0
BNE %BT01 ; Copy to first "." BNE %BT01 ; Copy to first "."
ADR r2,dataarea ADR r2,dataarea
CMPSTR r2,r3 CMPSTR r2,r3
Pull "r0-r9,PC" Pull "r0-r9,PC"
LNK PCCardFS.s LNK PCCardFS.s
...@@ -23,8 +23,8 @@ Free_SWIdecode ...@@ -23,8 +23,8 @@ Free_SWIdecode
WritePSRc SVC_mode,R10,,R9 ; re-enable interrupts WritePSRc SVC_mode,R10,,R9 ; re-enable interrupts
CMP R11,#1 CMP R11,#1
BNE SWIFree_Register BNE SWIFree_Register ; Free_Register
BL RemoveEntry BL RemoveEntry ; Free_DeRegister
swireturn swireturn
STRVS r0, [sp] STRVS r0, [sp]
ORRVS r9, r9, #V_bit ORRVS r9, r9, #V_bit
...@@ -32,15 +32,12 @@ swireturn ...@@ -32,15 +32,12 @@ swireturn
Pull "R0-R2,R9,PC" Pull "R0-R2,R9,PC"
badswi badswi
ADD sp, sp, #4 ADD sp, sp, #4
ADR R0,ErrorBlock_BadSWI ADR R0,ErrorBlock_ModuleBadSWI
ADRL R1, Title ADRL R1, Title
BL LookupError BL LookupError
Pull "R1-R2,R9,PC" Pull "R1-R2,R9,PC"
ErrorBlock_BadSWI MakeErrorBlock ModuleBadSWI
DCD 0
DCB "BadSWI", 0
ALIGN
;;Free_Register ;;Free_Register
;;In: ;;In:
...@@ -48,17 +45,13 @@ ErrorBlock_BadSWI ...@@ -48,17 +45,13 @@ ErrorBlock_BadSWI
;; R1 = Address to call ;; R1 = Address to call
;; R2 = R12 value. ;; R2 = R12 value.
;; ;;
;;
;;
SWIFree_Register ROUT SWIFree_Register ROUT
MOV r1,r0 MOV r1,r0
LDR r0,[sp,#1*4] LDR r0,[sp,#1*4]
BL AddEntry BL AddEntry
B swireturn B swireturn
LNK s.Tail LNK s.Tail
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
; ;
; > s.StartLoop ; > s.StartLoop
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; Application title and 'TASK' word store ; Application title and 'TASK' word store
taskidentifier DCB "TASK" taskidentifier DCB "TASK"
tasktitle DCB "Title",0
ALIGN ALIGN
; ----------------------------------------------------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; Set up error blocks ; Set up error blocks
MakeInternatErrorBlock WimpNotPresent,,NoWimp ; "Window Manager not present" MakeInternatErrorBlock WimpNotPresent,,NoWimp ; "Window Manager not present"
...@@ -42,24 +42,21 @@ CloseWimp ...@@ -42,24 +42,21 @@ CloseWimp
SWI XWimp_CloseDown SWI XWimp_CloseDown
EXITS EXITS
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
template_filename template_file DCB "Free:Templates",0
DCB "Free:Templates",0 ALIGN
ALIGN window_name DCB "Free",0
window_name ALIGN
DCB "Free",0 task_token DCB "Title",0
ALIGN ALIGN
title_prefix DCB "FSP",0 title_prefix DCB "FSP",0
ALIGN ALIGN
ADFSFree DCB "Alias$ADFS_Free" units_token DCB "bytes",0
DCB 0
FreeString DCB "ShowFree -FS ADFS %*0"
DCB 0
ALIGN ALIGN
MessagesList DCD Message_Quit MessagesList DCD Message_Quit
DCD 0 DCD 0
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; Start up the wimp task for Free ; Start up the wimp task for Free
Start Start
LDR r12, [r12] ; get workspace pointer LDR r12, [r12] ; get workspace pointer
...@@ -79,7 +76,15 @@ Start ...@@ -79,7 +76,15 @@ Start
ADRL sp, stacktop ; STACK IS NOW VALID! ADRL sp, stacktop ; STACK IS NOW VALID!
ADRL r0,tasktitle ADR r0, units_token
BL Lookup_InPlace
MOVVC r4, r0
ADRVS r4, units_token ; the token happens to be the english default too
ADR r0, message_bytes
MOV r3, #?message_bytes-1
BL copy_r0r4r3_space ; cache the 'bytes' suffix
ADR r0,task_token
BL Lookup_InPlace BL Lookup_InPlace
SWIVS OS_GenerateError SWIVS OS_GenerateError
MOV r2,r0 MOV r2,r0
...@@ -95,7 +100,7 @@ Start ...@@ -95,7 +100,7 @@ Start
STR r1, mytaskhandle ; Store task handle STR r1, mytaskhandle ; Store task handle
ADR r1, template_filename ; Load in the templates ADR r1, template_file ; Load in the templates
SWI XWimp_OpenTemplate SWI XWimp_OpenTemplate
BLVS CloseWimp BLVS CloseWimp
SWIVS OS_GenerateError SWIVS OS_GenerateError
...@@ -103,7 +108,7 @@ Start ...@@ -103,7 +108,7 @@ Start
ADR r1, windowarea ; Get template for window into memory. ADR r1, windowarea ; Get template for window into memory.
LDR r2, =indirected_data_offset LDR r2, =indirected_data_offset
ADD r2,r2,r12 ADD r2,r2,r12
ADD r3, r2, #indirected_space ADD r3, r2, #?indirected_data
MOV r4, #-1 ; No font array MOV r4, #-1 ; No font array
ADR r5, window_name ; Name of window. ADR r5, window_name ; Name of window.
MOV r6, #0 ; Search from first template. MOV r6, #0 ; Search from first template.
...@@ -129,12 +134,12 @@ Start ...@@ -129,12 +134,12 @@ Start
MOV r0,#0 MOV r0,#0
STR r0,poll_word STR r0,poll_word
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; Wimp polling routine ; Wimp polling routine
repollwimp repollwimp
BVC %FT01 BVC %FT01
Push "r0" Push "r0"
ADRL R0,tasktitle ADRL R0,task_token
MOV r2,r0 ; Just in case ! MOV r2,r0 ; Just in case !
BL Lookup_InPlace BL Lookup_InPlace
ADDVS sp,sp,#4 ADDVS sp,sp,#4
...@@ -172,7 +177,7 @@ jptable ...@@ -172,7 +177,7 @@ jptable
MOV PC,LR ; 10 MOV PC,LR ; 10
MOV PC,LR ; 11 MOV PC,LR ; 11
MOV PC,LR ; 12 MOV PC,LR ; 12
B update_windows ; 13 poll word non-zero B update_windows ; 13 poll word non-zero
MOV PC,LR ; 14 MOV PC,LR ; 14
MOV PC,LR ; 15 MOV PC,LR ; 15
MOV PC,LR ; 16 MOV PC,LR ; 16
...@@ -181,12 +186,12 @@ jptable ...@@ -181,12 +186,12 @@ jptable
MOV PC,LR ; 19 MOV PC,LR ; 19
endjptable endjptable
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
open_window open_window
SWI Wimp_OpenWindow SWI Wimp_OpenWindow
MOV PC,LR MOV PC,LR
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
close_window_from_block close_window_from_block
EntryS "r1-r5" EntryS "r1-r5"
...@@ -222,25 +227,26 @@ int_close_window ...@@ -222,25 +227,26 @@ int_close_window
MOV r5,r0 MOV r5,r0
LDR r2,[r0,#window_discname] LDR r2,[r0,#window_discname]
MOV r0,#7 MOV r0,#ModHandReason_Free
SWI XOS_Module SWI XOS_Module
EXIT VS EXIT VS
Debug xx,"Freed space" Debug xx,"Freed space"
MOV r0,#7 MOV r0,#ModHandReason_Free
MOV r2,r5 MOV r2,r5
SWI XOS_Module SWI XOS_Module
EXIT EXIT VS
Debug xx,"Freed block." Debug xx,"Freed block."
EXITS EXITS
; ---------------------------------------------------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; This is called when the poll word is non-zero, it scans the window list to find out which windows ; This is called when the poll word is non-zero, it scans the window list
; are to be updated, and updates them. ; to find out which windows are to be updated, and updates them.
; ;
FreeReason_Noop * 0
FreeReason_GetName * 1 FreeReason_GetName * 1
FreeReason_GetSpace * 2 FreeReason_GetSpace * 2
FreeReason_ComparePath * 3 FreeReason_ComparePath * 3
...@@ -280,7 +286,7 @@ updatelp1 ...@@ -280,7 +286,7 @@ updatelp1
ADD r3,r0,#60 ; Get length ADD r3,r0,#60 ; Get length
ADD r3,r3,#&100 ADD r3,r3,#&100
MOV r0,#6 MOV r0,#ModHandReason_Claim
SWI XOS_Module ; Claim space to hold name. + 3 sizes. SWI XOS_Module ; Claim space to hold name. + 3 sizes.
Pull "PC",VS Pull "PC",VS
...@@ -315,7 +321,7 @@ updatelp1 ...@@ -315,7 +321,7 @@ updatelp1
STR r0,[r5,#window_free_hi] STR r0,[r5,#window_free_hi]
STR r0,[r5,#window_used_hi] STR r0,[r5,#window_used_hi]
[ fix_silly_sizes [ fix_silly_sizes
MOV r0,#"?" << 24 MOV r0,#'?' :SHL: 24
STR r0,[r5,#used_ascii] STR r0,[r5,#used_ascii]
STR r0,[r5,#free_ascii] STR r0,[r5,#free_ascii]
STR r0,[r5,#size_ascii] STR r0,[r5,#size_ascii]
...@@ -441,16 +447,16 @@ just_update ; Window has changed, update it. ...@@ -441,16 +447,16 @@ just_update ; Window has changed, update it.
09 09
[ fix_silly_sizes [ fix_silly_sizes
; R0, R1, R6, R7 Corruptable ; R0, R1, R6, R7 Corruptable
LDMIA r2, {r0,r1,r6,r7} ; r0=size.l, r1=size.h, r6=free.l, r7=free.h LDMIA r2, {r0,r1,r6,r7} ; r0=size.l, r1=size.h, r6=free.l, r7=free.h
; check free size ; check free size
CMP r7,r1 CMP r7,r1
CMPEQ r6,r0 ; Free > Size ::= fault CMPEQ r6,r0 ; Free > Size ::= fault
MOVHI r7,#-1 MOVHI r7,#-1
STRHI r7,[r2,#12] STRHI r7,[r2,#12]
STRHI r7,[r2,#8] STRHI r7,[r2,#8]
; check used size ; check used size
ADD r6,r2,#16 ADD r6,r2,#16
LDMIA r6, {r6,r7} ; r6=used.l, r6=used.h LDMIA r6, {r6,r7} ; r6=used.l, r6=used.h
CMP r7,r1 CMP r7,r1
...@@ -603,13 +609,13 @@ just_update ; Window has changed, update it. ...@@ -603,13 +609,13 @@ just_update ; Window has changed, update it.
TEQ r0,#0 TEQ r0,#0
BEQ %FT02 BEQ %FT02
;we do need to check, round, and then update the ascii fields ; we do need to check, round, and then update the ascii fields
;(check the three values are all of the same magnitude, if so, apply rounding) ; (check the three values are all of the same magnitude, if so, apply rounding)
;then call modified set_text for each one... ; then call modified set_text for each one...
;check whether all three are the same units ; check whether all three are the same units
LDR r0,[r5,#used_ascii] LDR r0,[r5,#used_ascii]
LDR r1,[r5,#free_ascii] LDR r1,[r5,#free_ascii]
LDR r2,[r5,#size_ascii] LDR r2,[r5,#size_ascii]
...@@ -619,16 +625,16 @@ just_update ; Window has changed, update it. ...@@ -619,16 +625,16 @@ just_update ; Window has changed, update it.
CMPEQ lr,r2,LSR #24 CMPEQ lr,r2,LSR #24
BNE %FT02 BNE %FT02
;ok, same units, replace free with size-used ; When all the same units, include a safety check in case it doesn't
; add up due to rounding errors, most notably when used+free=size-1
; Errors of >1 of the unit are assumed to be deliberate (eg user free space
; being less than available free space on whole disc etc)
SUB r1,r2,r0 SUB r1,r2,r0
ORR r1,r1,lr,LSL #24 ORR r1,r1,lr,LSL #24
;and include a safety check in case it doesn't add up for a reason
;errors of >1 of the unit are assumed to be deliberate (eg user free space
;being less than available free space on whole disc etc)
LDR r0,[r5,#free_ascii] LDR r0,[r5,#free_ascii]
SUB r0,r1,r0 ; classic error is that used+free = size - 1 due to rounding error SUB r0,r1,r0 ; r0 := size-used-free
CMP r0,#2 CMP r0,#2
STRLT r1,[r5,#free_ascii] STRLT r1,[r5,#free_ascii] ; out by one so override
02 02
LDR r0,[r5,#used_ascii] LDR r0,[r5,#used_ascii]
MOV r3,#icon_Used MOV r3,#icon_Used
...@@ -644,7 +650,7 @@ just_update ; Window has changed, update it. ...@@ -644,7 +650,7 @@ just_update ; Window has changed, update it.
02 02
B updatelp B updatelp
;-------------------------------------------------------------------------------------------------------------- ;------------------------------------------------------------------------------
; Entry r0 = value (low) ; Entry r0 = value (low)
; r1 = value (high) ; r1 = value (high)
; ;
...@@ -652,61 +658,40 @@ just_update ; Window has changed, update it. ...@@ -652,61 +658,40 @@ just_update ; Window has changed, update it.
; the size in those units. ; the size in those units.
; r1 = corrupted ; r1 = corrupted
create_size_word create_size_word ROUT
STMFD r13!,{lr}
[ fix_silly_sizes [ fix_silly_sizes
CMP r0,#-1 CMP r0,#-1
CMPEQ r1,#-1 CMPEQ r1,#-1
MOVEQ r0,#"?":SHL:24 MOVEQ r0,#"?":SHL:24
BEQ %FT04 ; it's a silly size, mark as such MOVEQ pc, lr ; it's a silly size, mark as such
] ]
TEQ r1,#0 Push "r10,lr"
BNE %FT01 ;value is M, G or TBytes
MOV r10, #0 ; SI unit index
MOV lr,#" " 20
CMP r0,#&1000 CMP r1, #1
MOVCS lr,#"K" CMPCC r0, #4096 ; Keep dividing until < 4096
MOVCSS r0,r0,LSR #10 BCC %FT30
ADC r0,r0,#0 MOV r14, r1, LSL #22
CMP r0,#&1000 MOV r1, r1, LSR #10
MOVCS lr,#"M" MOVS r0, r0, LSR #10
MOVCSS r0,r0,LSR #10 ORR r0, r14, r0
ADC r0,r0,#0 ADCS r0, r0, #0 ; Round up lost bit
B %FT02 ADC r1, r1, #0
ADD r10, r10, #1 ; Next 10^3 up
B %BT20
30
ADR r14,create_prefixes
LDRB r14,[r14,r10]
ORR r0,r0,r14,LSL #24 ; Compact representation
Pull "r10,pc"
create_prefixes
DCB " kMGTPE" ; units/kilo/mega/giga/tera/peta/exa
ALIGN
01 ;------------------------------------------------------------------------------
;gigabytes are messy cos they're split across the two words...
CMP r1,#&100
BCS %FT03
MOV lr,#"G"
MOVS r0,r0,LSR #30
ORR r0,r0,r1,LSL #2
ADC r0,r0,#0
B %FT02
03 ;it is a T/Q byte value
MOV lr,#"T"
MOVS r0,r1,LSR #8
ADC r0,r0,#0
CMP r0,#&1000
MOVCS lr,#"P"
MOVCSS r0,r0,LSR #10
ADC r0,r0,#0
CMP r0,#&1000
MOVCS lr,#"E"
MOVCSS r0,r0,LSR #10
ADC r0,r0,#0
02 BIC r0,r0,#255:SHL:24
ORR r0,r0,lr,LSL #24
04
LDMFD r13!,{pc}
;--------------------------------------------------------------------------------------------------------------
; set_bar ; set_bar
; set bar size. ; set bar size.
; Entry: ; Entry:
...@@ -753,7 +738,7 @@ set_bar ROUT ...@@ -753,7 +738,7 @@ set_bar ROUT
STR r3,[r1,#4] STR r3,[r1,#4]
SWI XWimp_GetIconState SWI XWimp_GetIconState
ADDVS sp,sp,#4 ADDVS sp,sp,#4
Pull "r1-r8,PC",VS Pull "r1-r11,PC",VS
ADR r1,dataarea+40 ADR r1,dataarea+40
LDR r6,[r1,#8+8] ; Old x1. LDR r6,[r1,#8+8] ; Old x1.
...@@ -796,67 +781,66 @@ set_bar ROUT ...@@ -796,67 +781,66 @@ set_bar ROUT
Pull "r0-r11,PC" Pull "r0-r11,PC"
;-------------------------------------------------------------------------------------------------------- ;------------------------------------------------------------------------------
; set_text ; set_text
; ;
; r0 - Size in coded form (top byte = ascii character for power, rest is value at that exponent) ; r0 - Size in coded form (top byte = ascii character for power, rest is value at that exponent)
; r3 - Icon number ; r3 - Icon number
; [r5] - window block. ; [r5] - window block.
set_text set_text
Push "r0-r5,LR" Push "r0-r4,r6,LR"
MOV r4,r0,LSR #24
BIC r0,r0,#&FF000000
Push "r0"
ADR r1,dataarea+20 ADR r1,dataarea+20
LDR r14,[r5,#window_handle] LDR r14,[r5,#window_handle]
STR r14,[r1] STR r14,[r1,#gi_handle]
STR r3,[r1,#4] STR r3,[r1,#gi_iconhandle]
SWI XWimp_GetIconState SWI XWimp_GetIconState
Pull "r0" ADDVS sp,sp,#4
ADDVS sp,sp,#4 Pull "r1-r4,r6,PC",VS
Pull "r1-r5,PC",VS
Debug xx,"Got state"
Debug xx,"New size ",r0 LDR r1,[r1,#gi_iconblock+i_data+ii_buffer] ; Get pointer to buffer
Debug xx,"Got state"
LDR r1,[r1,#28] ; Get pointer to buffer LDR r0, [sp] ; recover r0 after Wimp corrupted it
MOV r4,r0,LSR #24
[ fix_silly_sizes [ fix_silly_sizes
TEQ r4,#"?" TEQ r4,#"?"
STREQB r4,[r1],#1 STREQB r4,[r1],#1
MOVEQ r4,#" " MOVEQ r4,#" "
STREQB r4,[r1],#1 STREQB r4,[r1],#1
BEQ %33 BEQ %FT33
] ]
MOV r2,#20 MOV r2,#20
SWI XOS_ConvertCardinal4 SWI XOS_ConvertCardinal2
ADDVS sp,sp,#4 ADDVS sp,sp,#4
Pull "r1-r5,PC",VS Pull "r1-r4,r6,PC",VS
Debug xx,"Converted number" Debug xx,"Converted number"
STRB r4,[r1],#1 MOV r2,#' '
STRB r2,[r1],#1 ; Space
TEQ r4,#' '
STRNEB r4,[r1],#1 ; Power of 10
33 33
MOV r0,#0 ADR r4,message_bytes ; 'bytes' and a null
STRB r0,[r1] MOV r0,r1
BL copy_r0r4_null
ADR r1,dataarea+20 ADR r1,dataarea+20
STR r0,[r1,#8] ASSERT (si_handle=gi_handle):LAND:(si_iconhandle=gi_iconhandle)
STR r0,[r1,#12] MOV r0,#0
SWI XWimp_SetIconState STR r0,[r1,#si_eorword]
STR r0,[r1,#si_clearword]
SWI XWimp_SetIconState
Debug xx,"Set state, returning." Debug xx,"Set state, returning."
Pull "r0-r5,PC" Pull "r0-r4,r6,PC"
;-------------------------------------------------------------------------------------------------------- ;------------------------------------------------------------------------------
; CallEntry - Call th FS entry by the FS number in r1. ; CallEntry - Call the FS entry by the FS number in r1.
; ;
CallEntry CallEntry
Push "r5,LR" Push "r5,LR"
...@@ -887,7 +871,7 @@ CallEntry ...@@ -887,7 +871,7 @@ CallEntry
NOP NOP
Pull "r12" Pull "r12"
Pull "PC" Pull "PC"
;-------------------------------------------------------------------------------------------------------- ;------------------------------------------------------------------------------
; AddEntry - Add the FS entry in r0 for the FS number in r1 to the list. ; AddEntry - Add the FS entry in r0 for the FS number in r1 to the list.
; ;
AddEntry AddEntry
...@@ -898,7 +882,7 @@ AddEntry ...@@ -898,7 +882,7 @@ AddEntry
MOV r6,r2 MOV r6,r2
MOV r3,#fs_block_size MOV r3,#fs_block_size
MOV r0,#6 MOV r0,#ModHandReason_Claim
SWI XOS_Module ; Claim block. SWI XOS_Module ; Claim block.
ADDVS sp,sp,#4 ADDVS sp,sp,#4
Pull "r1-r5,PC",VS Pull "r1-r5,PC",VS
......
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
; > s.Tail ; > s.Tail
;----------------------------------------------------------------------------------------- ;-----------------------------------------------------------------------------------------
; cmpstr. ; stricmp(char *r0, char *r1) returning Z=1 if equal
; ;
; compare the strings pointed to by r0 and r1 (case insensitive). ; compare the null terminated strings pointed to by r0 and r1 (case insensitive).
cmpstr stricmp
Push "r0-r2,LR" Push "r0-r2,LR"
01 01
LDRB r14,[r0],#1 LDRB r14,[r0],#1
BIC r14,r14,#&20 BIC r14,r14,#&20 ; Uppercasify
LDRB r2,[r1],#1 LDRB r2,[r1],#1
BIC r2,r2,#&20 BIC r2,r2,#&20 ; Uppercasify
CMP r14,r2 CMP r14,r2
Pull "r0-r2,PC",NE Pull "r0-r2,PC",NE
CMP r14,#0 CMP r14,#0
...@@ -33,55 +33,6 @@ cmpstr ...@@ -33,55 +33,6 @@ cmpstr
Pull "r0-r2,PC" Pull "r0-r2,PC"
; [ :LNOT: usefp
;;-----------------------------------------------------------------------------------------
;; divrem.
;;
;; divides r9 by r10. result in r9, reminder in r10.
;divrem
; Push "LR"
; Debuga xx,"Div ",r9,r10
; CMP r10,#0
; MOVEQ r9,#0
; Pull "PC",EQ
;
; MOV r14,#0
;01
; SUBS r9,r9,r10
; BCC %FT02
; ADD r14,r14,#1
; B %BT01
;02
; ADD r10,r9,r10
; MOV r9,r14
; Debug xx," = ",r9,r10
; Pull "PC"
; ]
[ {FALSE} ; no longer used
;-----------------------------------------------------------------------------------------
; round.
;
; Rounds r0 to the nearest whole multiple of r1.
round
Push "LR"
ADD r0,r0,r1,LSR #1 ; Add half of R1
MOV r14,#0
01
SUBS r0,r0,r1
BMI %FT02
ADD r14,r14,#1
B %BT01
02
MUL r0,r1,r14
Pull "PC"
]
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
; Release linked lists of files/icons. Note - may be in USER mode or SVC mode - can't use USER stack, ; Release linked lists of files/icons. Note - may be in USER mode or SVC mode - can't use USER stack,
; though, as it may not be okay. Hence not allowed to use the stack at all. ; though, as it may not be okay. Hence not allowed to use the stack at all.
...@@ -121,6 +72,16 @@ copy_r0r4r3_space ...@@ -121,6 +72,16 @@ copy_r0r4r3_space
Pull "r3,r4,PC" Pull "r3,r4,PC"
; ----------------------------------------------------------------------------------------------------------------------
copy_r0r4_null
01
LDRB r6, [r4], #1
STRB r6, [r0], #1
CMP r6, #0
BNE %BT01
SUB r0, r0, #1
MOV PC, LR
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
; MessageTrans routines ; MessageTrans routines
...@@ -170,7 +131,7 @@ Lookup_InPlace ROUT ...@@ -170,7 +131,7 @@ Lookup_InPlace ROUT
MOVVC r0,r2 MOVVC r0,r2
Pull "r1-r7,PC" Pull "r1-r7,PC"
Lookup ROUT ; r0 -> token, r2 -> buffer , r3 = buf length ,r4 -> arg Lookup ROUT ; r0 -> token, r2 -> buffer , r3 = buf length ,r4 -> arg
Push "r1-r7,LR" Push "r1-r7,LR"
BL open_messages BL open_messages
Pull "r1-r7,PC",VS Pull "r1-r7,PC",VS
......