Commit 9d132e5b authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Squash the sprites used by the Desktop module

Detail:
  Makefile - Use Squash to compress the startup banner spritefile. Saves about 40k of ROM space.
  s/Desktop - Add code for loading the squashed sprites.
Admin:
  Tested in ROM softload on Iyonix


Version 2.71. Tagged as 'Desktop-2_71'
parent b0cffaa7
......@@ -30,7 +30,7 @@ resources:
${CP} LocalRes:Messages ${RESFSDIR}.Messages ${CPFLAGS}
${CAT} LocalRes:CmdHelp { >> ${RESFSDIR}.Messages }
${CP} LocalRes:Templates ${RESFSDIR}.Templates ${CPFLAGS}
${CP} LocalRes:<UserIF>.Sprites ${RESFSDIR}.Sprites ${CPFLAGS}
${SQUASH} LocalRes:<UserIF>.Sprites ${RESFSDIR}.Sprites
include StdTools
include AAsmModule
......
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.70"
Module_Version SETA 270
Module_MajorVersion SETS "2.71"
Module_Version SETA 271
Module_MinorVersion SETS ""
Module_Date SETS "18 Jan 2010"
Module_ApplicationDate SETS "18-Jan-10"
Module_Date SETS "19 Jul 2010"
Module_ApplicationDate SETS "19-Jul-10"
Module_ComponentName SETS "Desktop"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Desktop"
Module_FullVersion SETS "2.70"
Module_HelpVersion SETS "2.70 (18 Jan 2010)"
Module_FullVersion SETS "2.71"
Module_HelpVersion SETS "2.71 (19 Jul 2010)"
END
/* (2.70)
/* (2.71)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.70
#define Module_MajorVersion_CMHG 2.71
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Jan 2010
#define Module_Date_CMHG 19 Jul 2010
#define Module_MajorVersion "2.70"
#define Module_Version 270
#define Module_MajorVersion "2.71"
#define Module_Version 271
#define Module_MinorVersion ""
#define Module_Date "18 Jan 2010"
#define Module_Date "19 Jul 2010"
#define Module_ApplicationDate "18-Jan-10"
#define Module_ApplicationDate "19-Jul-10"
#define Module_ComponentName "Desktop"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Desktop"
#define Module_FullVersion "2.70"
#define Module_HelpVersion "2.70 (18 Jan 2010)"
#define Module_LibraryVersionInfo "2:70"
#define Module_FullVersion "2.71"
#define Module_HelpVersion "2.71 (19 Jul 2010)"
#define Module_LibraryVersionInfo "2:71"
......@@ -43,6 +43,7 @@ Module_BaseAddr
GET VersionASM
GET Hdr:NDRDebug
GET Hdr:Sprite
GET Hdr:Squash
GBLL DesktopAllAtOnce
DesktopAllAtOnce SETL {TRUE}
......@@ -50,6 +51,8 @@ DesktopAllAtOnce SETL {TRUE}
NewBanner SETL {TRUE} :LAND: :LNOT: Embedded_UI
GBLL KeepItUp
KeepItUp SETL {TRUE} :LAND: NewBanner
GBLL SquashedSprites
SquashedSprites SETL {TRUE} :LAND: NewBanner
GBLL debug
GBLL debugxx
......@@ -291,9 +294,81 @@ 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
MOVVC r3, r4
SWIVC XOS_Module
MOVVS r9, r0
BVS %FT25
MOV r10, r2
MOV r0, #OSFile_LoadNoPath
ADRL r1, spritefile
MOV r3, #0
SWI XOS_File
; Allocate the block to decompress into
LDRVC r3, [r10, #4] ; get uncompressed length
MOVVC r0, #ModHandReason_Claim
ADDVC r3, r3, #4
SWIVC XOS_Module
MOVVS r9, r0
BVS %FT24
STR r2, privatesprites
STR r3, [r2, #saEnd]
; Allocate Squash workspace
MOV r0, #1<<3
MVN r1, #0
SWI XSquash_Decompress
MOVVC r3, r0
MOVVC r0, #ModHandReason_Claim
SWIVC XOS_Module
MOVVS r9, r0
BVS %FT23
MOV r0, #1<<2
MOV r1, r2
ADD r2, r10, #20
SUB r3, r4, #20
LDR r4, privatesprites
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
; 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
MOV r2, r10
MOV r0, #ModHandReason_Free
SWI XOS_Module
B %FT30
23
; Free sprite area
LDR r2, privatesprites
MOV r0, #ModHandReason_Free
SWI XOS_Module
24
; Free 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
SWI XOS_Module
MOVVS r9, r0
BVS %FT25
STR r2, privatesprites
STR r3, [r2, #saEnd]
......@@ -314,15 +389,14 @@ Desktop_Start ROUT
MOV r2, r1
MOV r0, #ModHandReason_Free ; free failed sprite area
SWI XOS_Module
MOV r0, r9
25
; something failed to open - free block and generate original error
MOV r9, r0
MOV r2, r12
MOV r0, #ModHandReason_Free
SWI XOS_Module
MOV r0, r9
SWI OS_GenerateError
]
30
; Give ourselves workspace and stack
......
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