Commit f462c775 authored by ROOL's avatar ROOL :robot:
Browse files

Fixes for pinboard backdrop sprite changing

Detail:
  Fix out-by-1 error in MakeCompactModeWord, the palette checksum read from array index -1 due to the loop construction.
  Consider the x/y size as well as the compact mode word when deciding whether to recache the backdrop sprite.
  Don't assume the screen byte size is equivalent to working out the sprite byte size, due to word rounding at the end of each line. Calculate it properly.
  Allow the Wimp_SlotSize to exactly equal the required memory (previously, had to be larger).
Admin:
  Submission from Timothy Baldwin, with minor refactoring.

Version 1.03. Tagged as 'Pinboard-1_03'
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.02"
Module_Version SETA 102
Module_MajorVersion SETS "1.03"
Module_Version SETA 103
Module_MinorVersion SETS ""
Module_Date SETS "29 May 2016"
Module_ApplicationDate SETS "29-May-16"
Module_Date SETS "06 May 2017"
Module_ApplicationDate SETS "06-May-17"
Module_ComponentName SETS "Pinboard"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Pinboard"
Module_FullVersion SETS "1.02"
Module_HelpVersion SETS "1.02 (29 May 2016)"
Module_FullVersion SETS "1.03"
Module_HelpVersion SETS "1.03 (06 May 2017)"
END
/* (1.02)
/* (1.03)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.02
#define Module_MajorVersion_CMHG 1.03
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 29 May 2016
#define Module_Date_CMHG 06 May 2017
#define Module_MajorVersion "1.02"
#define Module_Version 102
#define Module_MajorVersion "1.03"
#define Module_Version 103
#define Module_MinorVersion ""
#define Module_Date "29 May 2016"
#define Module_Date "06 May 2017"
#define Module_ApplicationDate "29-May-16"
#define Module_ApplicationDate "06-May-17"
#define Module_ComponentName "Pinboard"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Pinboard"
#define Module_FullVersion "1.02"
#define Module_HelpVersion "1.02 (29 May 2016)"
#define Module_LibraryVersionInfo "1:2"
#define Module_FullVersion "1.03"
#define Module_HelpVersion "1.03 (06 May 2017)"
#define Module_LibraryVersionInfo "1:3"
......@@ -90,7 +90,7 @@ MakeCompactModeWord
SUBS r14, r14, #1
LDRB r1, [sp, r14, LSL #2]
ADD r0, r0, r1
BPL %BT10
BNE %BT10
ADD sp, sp, #20*4
......@@ -193,8 +193,16 @@ ModeChange
LDR r14, CachedBackdropMode
TEQ r0, r14
DebugIf NE, bd,"BackdropMode changed, recacheing sprite",r0,r14
DebugIf NE, bd,"BackdropMode changed",r0,r14
LDREQ r0, CachedBackdrop_x1
LDREQ r14, Screen_x1
TEQEQ r0, r14
LDREQ r0, CachedBackdrop_y1
LDREQ r14, Screen_y1
TEQEQ r0, r14
DebugIf NE, bd,"Backdrop mode changed, recacheing sprite"
03
BLNE CacheBackdropSprite
Pull "PC"
......@@ -395,7 +403,7 @@ Int_CacheBackdropSprite ROUT
TST r0,#bd_OptionScaled ; Scaled ?
BEQ %FT01
; Sprite is scaled, get screen size (r4 = width, r5 = height, r2 = memory req.)
; Sprite is scaled, get screen size (r4 = width, r5 = height)
MOV r0,#-1 ; Use current mode
......@@ -407,8 +415,6 @@ Int_CacheBackdropSprite ROUT
SWIVC XOS_ReadModeVariable
ADDVC r5,r2,#1
STRVC r5,scale_y1
MOVVC r1,#VduExt_ScreenSize
SWIVC XOS_ReadModeVariable ; R2= screen size in bytes
Pull "PC",VS
B %FT10 ; Go allocate memory etc.
......@@ -501,6 +507,7 @@ Int_CacheBackdropSprite ROUT
STR r2,scale_x1
Debug bd,"Width in OS units is ",r4
10
MOV r0,#-1
MOV r1,#VduExt_Log2BPP
SWI XOS_ReadModeVariable ; Get Log2BPP for current mode
......@@ -513,7 +520,6 @@ Int_CacheBackdropSprite ROUT
MUL r2,r3,r5 ; r2 = size in bytes
10
Debug bd,"Destination sprite width = ",r4
Debug bd,"Destination sprite height = ",r5
Debug bd,"Sprite size would be ",r2
......@@ -538,7 +544,7 @@ Int_CacheBackdropSprite ROUT
Debug bd,"actual Slot size is ",r0
CMP r3,r0
BLT got_memory
BLS got_memory
LDR r0,backdrop_handle
MOV r1,#0
......@@ -623,6 +629,11 @@ LoadedOK
Debug bd,"BackdropMode is brought to you by the number ",r0
LDR r0,Screen_x1
LDR r1,Screen_y1
STR r0,CachedBackdrop_x1
STR r1,CachedBackdrop_y1
LDR r0,=&100 + SpriteReason_CreateSprite
MOV r1,#&8000
ADRL r2,BackdropSpriteName ; Create new sprite in current mode
......
......@@ -238,6 +238,8 @@ Screen_y1 # 4
XEig # 4 ; X and Y Eig factors for
YEig # 4 ; current mode.
CachedBackdropMode # 4 ; Mode for which the backdrop sprite was cached.
CachedBackdrop_x1 # 4 ;
CachedBackdrop_y1 # 4 ;
Buffered_list # 4 ; Buffered list of icons.
Icon_list # 4 ; List of active icons.
MonotonicID # 4 ; Monotonic ID for icons.
......
......@@ -152,6 +152,8 @@ Start
STR r0,Windows_Selected
STR r0,Iconbar_Icons
STR r0,soft_selection_window
STR r0,CachedBackdrop_x1
STR r0,CachedBackdrop_y1
SUB r0,r0,#1
STR r0,CachedBackdropMode
......
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