Commit 6f1ca57b authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix for not recalculating pixel translation on backdrop tile going from G256...

Fix for not recalculating pixel translation on backdrop tile going from G256 to C256 (or G16 to C16) mode specifier

The change in Pinboard-0_95 to get eigen factor rescaling right included a quick exit when neither the bpp nor eigen factors had changed.
However, changing from a greyscale to colour 8bpp or 4bpp mode falls fouls of this (since bpp and eigen are the same), so the backdrop sprite was not recached.
There was code to collect Message_PaletteChanged, however the Wimp hasn't sent this round since pre RISC OS 3.60, additionally the mode change code was manually disabling it (not required since Message_ModeChange was never accompanied by Message_PaletteChange according to PRM3-230). This has been switched out.
Now, the 'have I already done this sprite' flag includes the bpp and eigen factors plus a 13 bit hash of the desktop palette.

Version 0.96. Tagged as 'Pinboard-0_96'
parent 4379de0e
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.95"
Module_Version SETA 95
Module_MajorVersion SETS "0.96"
Module_Version SETA 96
Module_MinorVersion SETS ""
Module_Date SETS "23 Aug 2012"
Module_ApplicationDate SETS "23-Aug-12"
Module_Date SETS "11 Sep 2012"
Module_ApplicationDate SETS "11-Sep-12"
Module_ComponentName SETS "Pinboard"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Pinboard"
Module_FullVersion SETS "0.95"
Module_HelpVersion SETS "0.95 (23 Aug 2012)"
Module_FullVersion SETS "0.96"
Module_HelpVersion SETS "0.96 (11 Sep 2012)"
END
/* (0.95)
/* (0.96)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.95
#define Module_MajorVersion_CMHG 0.96
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 23 Aug 2012
#define Module_Date_CMHG 11 Sep 2012
#define Module_MajorVersion "0.95"
#define Module_Version 95
#define Module_MajorVersion "0.96"
#define Module_Version 96
#define Module_MinorVersion ""
#define Module_Date "23 Aug 2012"
#define Module_Date "11 Sep 2012"
#define Module_ApplicationDate "23-Aug-12"
#define Module_ApplicationDate "11-Sep-12"
#define Module_ComponentName "Pinboard"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Pinboard"
#define Module_FullVersion "0.95"
#define Module_HelpVersion "0.95 (23 Aug 2012)"
#define Module_LibraryVersionInfo "0:95"
#define Module_FullVersion "0.96"
#define Module_HelpVersion "0.96 (11 Sep 2012)"
#define Module_LibraryVersionInfo "0:96"
......@@ -20,11 +20,11 @@
[ defaultbackdrop
LCDbackdroptile
DCB "Pinboard:LCDTile",0
ALIGN
LCDbackdroptileEnd
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; CheckLCD
;
; If supporting an LCD use a patterned default backdrop which shimmers less
;
CheckLCD
Push "r0-r3,lr"
......@@ -37,9 +37,8 @@ CheckLCD
CMP r1,#5 ; check for LCD
Pull "r0-r3,pc",NE
ADR r0,LCDbackdroptile ; allocate memory for file name (so *Backdrop works)
ADR r1,LCDbackdroptileEnd
SUB r3,r1,r0
ADR r2,LCDbackdroptile ; allocate memory for file name (so *Backdrop works)
BL strlen
MOV r0,#ModHandReason_Claim
SWI XOS_Module
Pull "r0-r3,pc",VS
......@@ -57,8 +56,62 @@ CheckLCD
STR r0,poll_word
Pull "r0-r3,pc"
LCDbackdroptile
DCB "Pinboard:LCDTile",0
ALIGN
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; MakeCompactModeWord
;
; Formulate a word that expresses bpp, eigen, palette all in one
;
; Out : r0 = compact word
; r2 = sprite mode descriptor
MakeCompactModeWord
Push "r1, lr"
MOV r0, #OsByte_CursorCharacterAndMode
SWI XOS_Byte
Pull "r1, pc",VS
CMP r2, #256 ; Old style mode number limit
MOVCC r0, r2 ; Numbered modes are unique
Pull "r1, pc",CC
SUB sp, sp, #20*4
MOV r1, sp
SWI XWimp_ReadPalette
MOV r0, #0 ; Checksum
MOV r14, #20 ; Index
10
SUBS r14, r14, #1
LDRB r1, [sp, r14, LSL #2]
ADD r0, r0, r1
BPL %BT10
ADD sp, sp, #20*4
; Mix into &Fxybcccc
LDRB r14, [r2, #12] ; Pixel depth
ORR r0, r0, r14, LSL #16
LDRB r14, YEig
ORR r0, r0, r14, LSL #20
LDRB r14, XEig
ORR r0, r0, r14, LSL #24
ORR r0, r0, #&F0000000 ; Make sure a 1bpp EX0 EY0 mode can't be mistaken
; for old style mode 0
CLRV
Pull "r1, pc"
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; [Int_]ModeChange
;
; The mode has changed, recalculate bounds and tiles
;
Int_ModeChange
Push "lr"
ModeChange
......@@ -69,10 +122,6 @@ ModeChange
BL read_font_widths
]
LDR r0,backdrop_options
ORR r0,r0,#bd_OptionIgnorePaletteChange
STR r0,backdrop_options
BL read_mode_variables
LDR r0,backdrop_handle
STR r0,[r1],#4
......@@ -138,28 +187,16 @@ ModeChange
Pull "PC",EQ
TST r0, #bd_OptionJPEG
BEQ %FT02
BL CacheBackdropSprite
Pull "PC"
BNE %FT03
02
MOV r0,#OsByte_CursorCharacterAndMode
SWI XOS_Byte
Pull "PC",VS
CMP r2, #256 ; Old style mode number limit
LDRCSB r2, [r2, #12] ; Pixel depth
LDRCSB r0, YEig
ORRCS r2, r2, r0, LSL #8
LDRCSB r0, XEig
ORRCS r2, r2, r0, LSL #16
ORRCS r2, r2, #&FF000000 ; Make sure a 1bpp EX0 EY0 mode isn't mistaken
; for old style mode 0
LDR r0, CachedBackdropMode
TEQ r0, r2
BL MakeCompactModeWord
LDR r14, CachedBackdropMode
TEQ r0, r14
DebugIf NE, bd,"BackdropMode changed, recacheing sprite",r0,r2
DebugIf NE, bd,"BackdropMode changed, recacheing sprite",r0,r14
03
BLNE CacheBackdropSprite
Pull "PC"
FontChanged
......@@ -220,14 +257,9 @@ fontchanged_end
CLRV
Pull "PC"
[ :LNOT: ursulawimp ; No palette utility
PaletteChange
LDR r0,backdrop_options
TST r0,#bd_OptionIgnorePaletteChange
BIC r0,r0,#bd_OptionIgnorePaletteChange
STR r0,backdrop_options
Pull "PC",NE
Debug bd,"Palette change"
LDR r0,backdrop_options
......@@ -238,13 +270,13 @@ PaletteChange
BL CacheBackdropSprite
Pull "PC"
]
;---------------------------------------------------------------
; CacheBackdropSprite
;
; Cache backdrop sprite fo current mode
; Cache backdrop sprite for current mode
;
; In :
; [backdrop_path] name of sprite file.
......@@ -579,28 +611,17 @@ LoadedOK
STR r2,[r1,#8]
LDR r0,=&100 + SpriteReason_ClearSprites
SWI XOS_SpriteOp
ADDVS sp,sp,#8
Pull "PC",VS
Debug bd,"Sprite area initialised"
MOV r0,#OsByte_CursorCharacterAndMode
SWI XOS_Byte
BLVC MakeCompactModeWord
ADDVS sp,sp,#8
Pull "PC",VS
MOV r6, r2 ; For SpriteReason_CreateSprite
CMP r2, #256 ; Old style mode number limit
LDRCSB r2, [r2, #12] ; Pixel depth
LDRCSB r0, YEig
ORRCS r2, r2, r0, LSL #8
LDRCSB r0, XEig
ORRCS r2, r2, r0, LSL #16
ORRCS r2, r2, #&FF000000 ; Make sure a 1bpp EX0 EY0 mode isn't mistaken
; for old style mode 0
STR r2,CachedBackdropMode
MOV r6, r2 ; For SpriteReason_CreateSprite
STR r0,CachedBackdropMode
Debug bd,"BackdropMode is brought to you by the number ",r2
Debug bd,"BackdropMode is brought to you by the number ",r0
LDR r0,=&100 + SpriteReason_CreateSprite
MOV r1,#&8000
......
......@@ -40,10 +40,11 @@ message_received
TEQ r0, r14
BEQ FontChanged
[ :LNOT: ursulawimp
LDR r14,=Message_PaletteChange
TEQ r0, r14
BEQ PaletteChange
]
LDR r14,=Message_FilerSelection
TEQ r0, r14
BEQ FilerSelection
......
......@@ -172,7 +172,6 @@ bd_OptionCentred * 1 :SHL: 0
bd_OptionTiled * 1 :SHL: 1
bd_OptionScaled * 1 :SHL: 2
bd_OptionRecache * 1 :SHL: 3
bd_OptionIgnorePaletteChange * 1 :SHL: 30
bd_OptionActive * 1 :SHL: 31
bd_OptionJPEG * 1 :SHL: 4
......
......@@ -70,7 +70,9 @@ MessagesList
DCD Message_DataSaveAck
DCD Message_FilerDevicePath
DCD Message_ModeChange
[ :LNOT: ursulawimp
DCD Message_PaletteChange
]
DCD Message_SaveDesktop
DCD Message_MenusDeleted
DCD Message_HelpRequest
......@@ -279,8 +281,8 @@ repollwimp
; Call Wimp_Poll
Debug sa,"Calling Wimp_Poll"
MOV R0, #&31
ORR R0, R0, #&400000 ; Poll word (low priority)
MOV R0, #null_bit :OR: pointerchange_bits
ORR R0, R0, #pollword_enable
ADR R1,dataarea
ADR r3, poll_word
SWI XWimp_Poll ; can't call non-X form
......
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