Commit 538ca7ac authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Free tweaked to round to nearest.

Fix for desktop free blowing up on 32 bit systems when the filing
system vanishes (eg.a RAM disc going to 0 size).

Version 0.38. Tagged as 'Free-0_38'
parent b86682cd
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.68.
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
GBLS Module_ApplicationDate2
GBLS Module_ApplicationDate4
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.37"
Module_Version SETA 37
Module_MajorVersion SETS "0.38"
Module_Version SETA 38
Module_MinorVersion SETS ""
Module_Date SETS "18 Jun 2001"
Module_ApplicationDate2 SETS "18-Jun-01"
Module_ApplicationDate4 SETS "18-Jun-2001"
Module_Date SETS "22 Nov 2002"
Module_ApplicationDate SETS "22-Nov-02"
Module_ComponentName SETS "Free"
Module_ComponentPath SETS "RiscOS/Sources/Desktop/Free"
Module_FullVersion SETS "0.37"
Module_HelpVersion SETS "0.37 (18 Jun 2001)"
Module_FullVersion SETS "0.38"
Module_HelpVersion SETS "0.38 (22 Nov 2002)"
END
/* (0.37)
/* (0.38)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 0.37
#define Module_MajorVersion_CMHG 0.38
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Jun 2001
#define Module_Date_CMHG 22 Nov 2002
#define Module_MajorVersion "0.37"
#define Module_Version 37
#define Module_MajorVersion "0.38"
#define Module_Version 38
#define Module_MinorVersion ""
#define Module_Date "18 Jun 2001"
#define Module_Date "22 Nov 2002"
#define Module_ApplicationDate2 "18-Jun-01"
#define Module_ApplicationDate4 "18-Jun-2001"
#define Module_ApplicationDate "22-Nov-02"
#define Module_ComponentName "Free"
#define Module_ComponentPath "RiscOS/Sources/Desktop/Free"
#define Module_FullVersion "0.37"
#define Module_HelpVersion "0.37 (18 Jun 2001)"
#define Module_FullVersion "0.38"
#define Module_HelpVersion "0.38 (22 Nov 2002)"
#define Module_LibraryVersionInfo "0:38"
......@@ -358,15 +358,16 @@ just_update ; Window has changed, update it.
LDR r0,[r5,#window_update]
TST r0,#1 :SHL: 30
BEQ %FT01
ADRNE r1,dataarea
LDRNE r0,[r5,#window_handle]
STRNE r0,[r1]
LDRNE r5,[r5,#next_ptr]
BLNE close_window
BNE updatelp1
ADR r1,dataarea
LDR r0,[r5,#window_handle]
STR r0,[r1]
LDR r5,[r5,#next_ptr]
BL close_window
B updatelp1
TST r0,#1 :SHL: 31
01 TST r0,#1 :SHL: 31
MOV r0,#0
STR r0,[r5,#window_update]
BEQ %FT01
......@@ -421,10 +422,9 @@ just_update ; Window has changed, update it.
;move the data returned into the new layout
LDR r0,[r2,#8]
STR r0,[r2,#16] ; move used to used_low
LDR r0,[r2,#4]
STR r0,[r2,#8] ; move free to free_low
LDMIB r2,{r1,r6}
STR r1,[r2,#8] ; move free to free_low
STR r6,[r2,#16] ; move used to used_low
MOV r0,#0
STR r0,[r2,#4]
STR r0,[r2,#12]
......@@ -433,48 +433,31 @@ just_update ; Window has changed, update it.
09
[ fix_silly_sizes
; R0, R1, R6, R7 Corruptable
LDR r0,[r2,#4] ; Size high
LDR r1,[r2,#0] ; Size low
LDMIA r2, {r0,r1,r6,r7} ; r0=size.l, r1=size.h, r6=free.l, r7=free.h
; check free size
LDR r6,[r2,#12] ; Free high
LDR r7,[r2,#8] ; Free low
CMP r6,r0
BLO %FT03 ; Free < Size ::= ok
BHI %FT04 ; Free > Size ::= fault
CMP r7,r1
BLS %FT03 ; Free >= Size ::= ok
04 ; free fault
MOV r7,#-1
STR r7,[r2,#12]
STR r7,[r2,#8]
03 ; free ok
CMPEQ r6,r0 ; Free > Size ::= fault
MOVHI r7,#-1
STRHI r7,[r2,#12]
STRHI r7,[r2,#8]
; check used size
LDR r6,[r2,#20] ; Used high
LDR r7,[r2,#16] ; Used low
TEQ r7,#0
TEQEQ r6,#0
BEQ %FT04
CMP r6,r0
BLO %FT03 ; Used < Size ::= ok
BHI %FT04 ; Used > Size ::= fault
ADD r6,r2,#16
LDMIA r6, {r6,r7} ; r6=used.l, r6=used.h
CMP r7,r1
BLS %FT03 ; Used >= Size ::= ok
04 ; used fault
MOV r7,#-1
STR r7,[r2,#20]
STR r7,[r2,#16]
03 ; used ok
CMPEQ r6,r0 ; Used > Size ::= fault
MOVHI r7,#-1
STRHI r7,[r2,#20]
STRHI r7,[r2,#16]
|
LDMIA r2, {r0,r1} ; r0=size.l, r1=size.h
]
LDR r0,[r2,#0] ; Size low
LDR r1,[r5,#window_size_lo]
CMP r0,r1
BNE %FT02
LDR r0,[r2,#4] ; Size high
LDR r1,[r5,#window_size_hi]
CMP r0,r1
BEQ %FT01 ; Size Unchanged.
02
ADD lr,r5,#window_size_lo
LDMIA lr,{r6,r7}
CMP r7,r1
CMPEQ r6,r0
BEQ %FT01 ; Size unchanged
STR r13,[r5,#no_change] ; set the flag to indicate that the textual fields need rewriting
LDR r0,[r2,#4] ; Size high
......@@ -624,8 +607,7 @@ just_update ; Window has changed, update it.
MOV lr,r0,LSR #24
CMP lr,r1,LSR #24
BNE %FT02
CMP lr,r2,LSR #24
CMPEQ lr,r2,LSR #24
BNE %FT02
;ok, same units, replace free with size-used
......@@ -666,49 +648,53 @@ create_size_word
[ fix_silly_sizes
CMP r0,#-1
CMPEQ r1,#-1
MOVEQ r0,#0
MOVEQ lr,#"?"
BEQ %FT02 ; it's a silly size, mark as such
MOVEQ r0,#"?":SHL:24
BEQ %FT04 ; it's a silly size, mark as such
]
TEQ r1,#0
BNE %FT01 ;value is M, G or TBytes
MOV lr,#" "
CMP r0,#&1000
MOVHI r0,r0,LSR #10
MOVHI lr,#"K"
MOVCS lr,#"K"
MOVCSS r0,r0,LSR #10
ADC r0,r0,#0
CMP r0,#&1000
MOVHI r0,r0,LSR #10
MOVHI lr,#"M"
MOVCS lr,#"M"
MOVCSS r0,r0,LSR #10
ADC r0,r0,#0
B %FT02
01
MOV lr,#"G"
;gigabytes are messy cos they're split across the two words...
CMP r1,#&100
BHI %FT03
BCS %FT03
MOV r0,r0,LSR #30
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"
MOV r0,r1,LSR #8
MOVS r0,r1,LSR #8
ADC r0,r0,#0
CMP r0,#&1000
MOVGT r0,r0,LSR #10
MOVGT lr,#"P"
MOVCS lr,#"P"
MOVCSS r0,r0,LSR #10
ADC r0,r0,#0
CMP r0,#&1000
MOVGT r0,r0,LSR #10
MOVGT lr,#"E"
02 BIC r0,r0,#255<<24
ORR r0,r0,r14,LSL #24
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}
;--------------------------------------------------------------------------------------------------------------
......
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