Commit d75584a7 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Make the banner show the year from *FX0.

To save the effort of the annual change to this module's resources, new option "DateFromKernel" will get the year from OS_Byte 0 and patch the template at time of display. If any part of it fails the banner just shows (C) Owner by default with no year.
Changed 'true' to objasm {TRUE}.
Optimised away a whole word of workspace (WindowHandle) by more cunning stack push and pop before displaying the banner.
Added check that the file passed to Squash is actually a Squash file, otherwise module exploded if soft loaded onto old resources.
Fix problem of oflaofla error if the Squash module was exhausted (ie. status code was non 0), previously this was treated as an error block and passed via R9 to OS_GenerateError - now both duff squash files and failure to decompress give a 'Bad sprite area' error.
Updated comment about Wimp 2.00.
An ADR to Desktop_Title didn't reach for the old banner case.
ExitDisplay2 optimised away.
Tested softloaded on top of 5.17 ROM.

Version 2.72. Tagged as 'Desktop-2_72'
parent 9d132e5b
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.71"
Module_Version SETA 271
Module_MajorVersion SETS "2.72"
Module_Version SETA 272
Module_MinorVersion SETS ""
Module_Date SETS "19 Jul 2010"
Module_ApplicationDate SETS "19-Jul-10"
Module_Date SETS "28 Aug 2010"
Module_ApplicationDate SETS "28-Aug-10"
Module_ComponentName SETS "Desktop"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Desktop"
Module_FullVersion SETS "2.71"
Module_HelpVersion SETS "2.71 (19 Jul 2010)"
Module_FullVersion SETS "2.72"
Module_HelpVersion SETS "2.72 (28 Aug 2010)"
END
/* (2.71)
/* (2.72)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.71
#define Module_MajorVersion_CMHG 2.72
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 19 Jul 2010
#define Module_Date_CMHG 28 Aug 2010
#define Module_MajorVersion "2.71"
#define Module_Version 271
#define Module_MajorVersion "2.72"
#define Module_Version 272
#define Module_MinorVersion ""
#define Module_Date "19 Jul 2010"
#define Module_Date "28 Aug 2010"
#define Module_ApplicationDate "19-Jul-10"
#define Module_ApplicationDate "28-Aug-10"
#define Module_ComponentName "Desktop"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Desktop"
#define Module_FullVersion "2.71"
#define Module_HelpVersion "2.71 (19 Jul 2010)"
#define Module_LibraryVersionInfo "2:71"
#define Module_FullVersion "2.72"
#define Module_HelpVersion "2.72 (28 Aug 2010)"
#define Module_LibraryVersionInfo "2:72"
......@@ -53,6 +53,8 @@ NewBanner SETL {TRUE} :LAND: :LNOT: Embedded_UI
KeepItUp SETL {TRUE} :LAND: NewBanner
GBLL SquashedSprites
SquashedSprites SETL {TRUE} :LAND: NewBanner
GBLL DateFromKernel
DateFromKernel SETL {TRUE} :LAND: NewBanner
GBLL debug
GBLL debugxx
......@@ -62,11 +64,11 @@ SquashedSprites SETL {TRUE} :LAND: NewBanner
GBLL hostvdu
debug SETL {FALSE}
debugxx SETL true :LAND: debug
debugwe SETL true :LAND: debug
debugcr SETL true :LAND: debug
debugtm SETL true :LAND: debug
hostvdu SETL true
debugxx SETL {TRUE} :LAND: debug
debugwe SETL {TRUE} :LAND: debug
debugcr SETL {TRUE} :LAND: debug
debugtm SETL {TRUE} :LAND: debug
hostvdu SETL {TRUE}
......@@ -75,8 +77,6 @@ LF * 10
FF * 12
CR * 13
baseline * 50
^ 0, wp
commandtail # 256
MessageBlock # 16
......@@ -87,7 +87,6 @@ privatesprites # 4 ; our sprites for the banner
BannerCloseTime # 4
NewWelcomeWorkspace # 4
IconHandle # 4
WindowHandle # 4
NextPump # 4
PumpHidden # 4
PumpParams_0 # 4
......@@ -294,6 +293,7 @@ Desktop_Start ROUT
ADRL r1, spritefile
MOV r0, #OSFile_ReadNoPath
SWI XOS_File ; attempting to load them will give an error
[ SquashedSprites
; Allocate block to load squashed file into
MOVVC r0, #ModHandReason_Claim
......@@ -306,24 +306,34 @@ Desktop_Start ROUT
ADRL r1, spritefile
MOV r3, #0
SWI XOS_File
; Allocate the block to decompress into
LDRVC r3, [r10, #4] ; get uncompressed length
LDRVC r3, [r10, #4] ; get uncompressed length
MOVVC r0, #ModHandReason_Claim
ADDVC r3, r3, #4
ADDVC r3, r3, #4 ; make it a sprite area
SWIVC XOS_Module
MOVVS r9, r0
BVS %FT24
STR r2, privatesprites
STR r3, [r2, #saEnd]
; Allocate Squash workspace
LDR r0, =&48535153 ; "SQSH"
LDR r1, [r10, #0]
TEQ r0, r1
BNE %FT21
; Query Squash workspace
MOV r0, #1<<3
MVN r1, #0
SWI XSquash_Decompress
; Allocate Squash workspace
MOVVC r3, r0
MOVVC r0, #ModHandReason_Claim
SWIVC XOS_Module
MOVVS r9, r0
BVS %FT23
; This code will fail if Squash doesn't decompress it all in one go!
MOV r0, #1<<2
MOV r1, r2
ADD r2, r10, #20
......@@ -332,16 +342,28 @@ Desktop_Start ROUT
LDR r5, [r10, #4]
ADD r4, r4, #4
SWI XSquash_Decompress
; This code will fail if Squash doesn't decompress it all in one go!
MOV r9, r0 ; Remember error, if any
MOV r3, r0
; Free the squash workspace
MOV r2, r1
MOV r0, #ModHandReason_Free
SWI XOS_Module
; Report error if necessary
CMP r9, #0
BNE %FT23
; Free file buffer
; Look at status code. Non zero is bad, translate it into a failed sprite.
CMP r3, #0
BEQ %FT22
21
LDR r1, privatesprites
MOV r2, #0 ; will fail
STR r2, [r1, #saEnd]
STR r1, [r1, #saFree]
MOV r0, #SpriteReason_CheckSpriteArea
ORR r0, r0, #256
SWI XOS_SpriteOp
MOVVS r9, r0
BVS %FT23
22
; Free squashed file buffer
MOV r2, r10
MOV r0, #ModHandReason_Free
SWI XOS_Module
......@@ -352,18 +374,10 @@ Desktop_Start ROUT
MOV r0, #ModHandReason_Free
SWI XOS_Module
24
; Free file buffer
; Free squashed file buffer
MOV r2, r10
MOV r0, #ModHandReason_Free
SWI XOS_Module
25
; Free module workspace
MOV r2, r12
MOV r0, #ModHandReason_Free
SWI XOS_Module
; generate original error
MOV r0, r9
SWI OS_GenerateError
|
MOV r0, #ModHandReason_Claim
ADD r3, r4, #16
......@@ -389,6 +403,7 @@ Desktop_Start ROUT
MOV r2, r1
MOV r0, #ModHandReason_Free ; free failed sprite area
SWI XOS_Module
]
25
; something failed to open - free block and generate original error
MOV r2, r12
......@@ -396,7 +411,6 @@ Desktop_Start ROUT
SWI XOS_Module
MOV r0, r9
SWI OS_GenerateError
]
30
; Give ourselves workspace and stack
......@@ -468,7 +482,7 @@ StartAsTask
BL MsgLookup
BVS Exit
MOV r2, r1
MOV R0, #300 ; pretend to know about Wimp 2.00
MOV R0, #300 ; pretend to know about Wimp 3.00
LDR R1, taskid
ADR R3, Desktop_MessagesWanted
SWI XWimp_Initialise
......@@ -539,7 +553,7 @@ StartAsTask
MOV r1, #0
STR r1, [r0] ; Default error number.
MOV r1, #256+2048+512
ADR r2, Desktop_Title
ADRL r2, Desktop_Title
MOV r3, #0
MOV r4, #1
SWI XWimp_ReportError
......@@ -609,14 +623,11 @@ NoBootError
Debug we,"Service not claimed"
[ NewBanner
[ KeepItUp
BL IconbarHack
]
BL DisplayNewWelcome
|
BL DisplayWelcomeScreen
]
SWI XOS_ReadMonotonicTime
MOVVS r0, #0
ADD r0, r0, #400 ; Keep it up for 4 seconds
......@@ -665,7 +676,7 @@ MessageGotten ROUT
]
AllDone
[ KeepItUp
[ KeepItUp
LDR r2, BannerCloseTime
TEQ r2, #0
BEQ Exit ; Nothing to keep up... (no banner)
......@@ -1131,13 +1142,14 @@ PumpOneDesktopCommand ALTENTRY
STR r0, NextPump
EXIT
[ :LNOT:NewBanner
; *****************************************************************************
;
; DisplayWelcomeScreen
;
[ :LNOT: Embedded_UI ; RWB - Remove welcome screen
DisplayWelcomeScreen
[ :LNOT:NewBanner
[ :LNOT: Embedded_UI ; RWB - Remove welcome screen
^ 0,sp
Welcome_font # 4
Welcome_font1 # 4
......@@ -1151,7 +1163,7 @@ Welcome_Count # 4
Welcome_Area # 4
Welcome_WSSize * :INDEX: @
DisplayWelcomeScreen Entry ,Welcome_WSSize
Entry ,Welcome_WSSize
MOV r0,#-1
MOV r1,#11
......@@ -1506,19 +1518,13 @@ WelcomeError_OneFont
WelcomeError_NoFont
EXIT
]
]
[ debug
InsertNDRDebugRoutines
]
| ; NewBanner
templatename DCB "Resources:$.Resources.Desktop.Templates",0
backdropname DCB "backdrop",0
desktopname DCB "desktop",0
ALIGN
DisplayNewWelcome
Push "R1-R7,lr"
ADR R1,templatename
SWI XWimp_OpenTemplate
......@@ -1543,7 +1549,7 @@ DisplayNewWelcome
SWI XOS_ReadModeVariable
MOVVC r6,r2
MOVVC r1,#4
SWIVC XOS_ReadModeVariable ;Get xeig
SWIVC XOS_ReadModeVariable ;Get xeig
SUBVS SP,SP,#12
BVS ExitDisplay
MOV r6,r6,ASL r2
......@@ -1556,41 +1562,96 @@ DisplayNewWelcome
SWI XOS_ReadModeVariable
MOVVC r6,r2
MOVVC r1,#5
SWIVC XOS_ReadModeVariable ;Get yeig
SWIVC XOS_ReadModeVariable ;Get yeig
SUBVS SP,SP,#8
BVS ExitDisplay
MOV r6,r6,ASL r2
SUB R6,R6,#16 ; drop shadow
SUB R6,R6,#16 ; drop shadow
Push R6
MOV R2,R7
ADR R5,backdropname
MOV R0,#0
BL displaywindow
STR R9,WindowHandle
; SWI XWimp_DeleteWindow
Pull "R5,R6"
Push R9
ADD R5,R5,#16
SUB R6,R6,#16
Push "R5,R6"
Push "R5,R6" ; make sure this pair is last on for 'displaywindow' to read
MOV R2,R7
ADR R5,desktopname
BL displaywindow
; SWI XWimp_DeleteWindow
SWI XWimp_CloseTemplate
[ DateFromKernel
; Modify the copyright string " (C) Owner" to
; "(C)YYYY Owner" if possible based on OSByte 0
SUB SP,SP,#gi_size
STR R9,[SP,#gi_handle]
MOV R1,#6 ; copyright string icon number
STR R1,[SP,#gi_iconhandle]
MOV R1,SP
SWI XWimp_GetIconState
BVS %FT30
LDR R0,[SP,#gi_iconblock+i_flags]
TST R0,#if_indirected
BEQ %FT30 ; only deal with indirected case
LDR R4,[SP,#gi_iconblock+i_data+ii_buffer]
ADD SP,SP,#gi_size
; Get the version
MOV R0,#0
MOV R1,#0
SWI XOS_Byte
ADD R0,R0,#4 ; skip error number
10
; Look for closing bracket
LDRB R1,[R0],#1
TEQ R1,#0
BEQ %FT30 ; no bracket, nevermind, template makes sense on its own
TEQ R1,#")"
BNE %BT10
SUB R3,R0,#1
; Check for preceding YYYY digits
SUB R1,R3,#4
MOV R0,#10
SWI XOS_ReadUnsigned
BVS %FT30
TEQ R3,R1
BNE %FT30 ; non decimals, nevermind, template makes sense on its own
; Move the copyright symbol back
LDRB R0,[R4,#5]
STRB R0,[R4,#0]
; Overlay the year then zap the null terminator
MOV R0,R2
ADD R1,R4,#2
MOV R2,#5
SWI XOS_ConvertCardinal2
MOV R0,#" "
STRB R0,[R1]
30
]
MOV R0,R9
BL redrawwindow
LDR R0,WindowHandle
BL redrawwindow
BL redrawwindow ; fore
LDR R0,[SP,#2*4]
BL redrawwindow ; back
B ExitDisplay2
B ExitDisplay
templatename DCB "Resources:$.Resources.Desktop.Templates",0
backdropname DCB "backdrop",0
desktopname DCB "desktop",0
ALIGN
displaywindow
Push "lr"
......@@ -1603,7 +1664,7 @@ displaywindow
BVS ExitDisplay
LDR r0, privatesprites
STR r0, [r1, #64] ; use local sprite pool in the player window
STR r0, [r1, #64] ; use local sprite pool in the 'desktop' window
SWI XWimp_CreateWindow
BVS ExitDisplay
......@@ -1656,9 +1717,7 @@ redrawwindow
ExitDisplay
ADD SP,SP,#4 ; skip lr on stack
ExitDisplay2
ADD SP,SP,#8 ; npix
ADD SP,SP,#12 ; skip 3 * items on stack
[ KeepItUp
Pull "R1-R7,PC"
FreeFontsEtc
......
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