Commit 4379de0e authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix for patchy tiled backdrops on changing to non EX1/EY1 mode

Pinboard keeps a note of the mode (from OS_Byte 135) that the backdrop sprite tile was last cached in, to avoid having to recache it all the time. However, the comparison fails when the mode specifier block (ie. when OS_Byte 135 is not reporting a numeric screen mode) is static since although the mode might have changed Pinboard would not think it had and hence not recache the sprite.
The result is a patchy desktop, for example changing from EX1/EY1 to EX0/EY0 would leave a quadrant arrangement of 1 redrawn patch and 3 not redrawn.
Backdrop.s:
Line 151 onwards, when a mode specifier is used, build a magic mode word combining EX EY and BPP (the 3 parameters the cache sprite function cares about), as a stronger check.
Tail.s:
Line 130 onwards, calculate the iconbar height properly (previously used 134 pixels for EY0 modes, 1 too high, leading to a thin strip of background colour above the iconbar.
Other changes
 - Use sprite area offset names from Hdr:Sprites rather than magic numbers
 - Use OS_Byte reasons from Hdr:OsBytes
 - Use "file.s" style names in LNK commands
 - Move BadOptions/NotASprite error blocks to avoid range error when assembling debug versions
 - true and false for objasm {TRUE} and {FALSE}

Version 0.95. Tagged as 'Pinboard-0_95'
parent 77e35785
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.94"
Module_Version SETA 94
Module_MajorVersion SETS "0.95"
Module_Version SETA 95
Module_MinorVersion SETS ""
Module_Date SETS "28 Sep 2011"
Module_ApplicationDate SETS "28-Sep-11"
Module_Date SETS "23 Aug 2012"
Module_ApplicationDate SETS "23-Aug-12"
Module_ComponentName SETS "Pinboard"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Pinboard"
Module_FullVersion SETS "0.94"
Module_HelpVersion SETS "0.94 (28 Sep 2011)"
Module_FullVersion SETS "0.95"
Module_HelpVersion SETS "0.95 (23 Aug 2012)"
END
/* (0.94)
/* (0.95)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.94
#define Module_MajorVersion_CMHG 0.95
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Sep 2011
#define Module_Date_CMHG 23 Aug 2012
#define Module_MajorVersion "0.94"
#define Module_Version 94
#define Module_MajorVersion "0.95"
#define Module_Version 95
#define Module_MinorVersion ""
#define Module_Date "28 Sep 2011"
#define Module_Date "23 Aug 2012"
#define Module_ApplicationDate "28-Sep-11"
#define Module_ApplicationDate "23-Aug-12"
#define Module_ComponentName "Pinboard"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Pinboard"
#define Module_FullVersion "0.94"
#define Module_HelpVersion "0.94 (28 Sep 2011)"
#define Module_LibraryVersionInfo "0:94"
#define Module_FullVersion "0.95"
#define Module_HelpVersion "0.95 (23 Aug 2012)"
#define Module_LibraryVersionInfo "0:95"
......@@ -142,18 +142,23 @@ ModeChange
BL CacheBackdropSprite
Pull "PC"
02
MOV r0,#135
MOV r0,#OsByte_CursorCharacterAndMode
SWI XOS_Byte
Pull "PC",VS
LDR r0,CachedBackdropMode
TEQ r0,r2
Pull "PC",EQ
Debug bd,"Cached mode ",r0
Debug bd,"Current mode ",r2
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
DebugIf NE, bd,"BackdropMode changed, recacheing sprite",r0,r2
BL CacheBackdropSprite
BLNE CacheBackdropSprite
Pull "PC"
......@@ -388,17 +393,17 @@ Int_CacheBackdropSprite ROUT
MOV r1,r0
MOV r0,#OSGBPB_ReadFromGiven ; Read bytes from file
ADR r2,dataarea
MOV r3,#4
MOV r4,#4 ; Read offsets to first sprite and end of area
MOV r3,#?saFirst
MOV r4,#saFirst - 4 ; Sprite files are sprite areas with saEnd missing
SWI XOS_GBPB
BVS %FT05
ADR r2,dataarea
LDR r0,[r2]
LDR r0,dataarea
SUB r4,r0,#4
Debug bd,"Offset to sprite is ",r4
MOV r0,#OSGBPB_ReadFromGiven
MOV r3,#48
ADR r2,dataarea
MOV r3,#SpriteCBsize
SWI XOS_GBPB ; Read sprite header
BVC %FT06
05
......@@ -410,24 +415,26 @@ Int_CacheBackdropSprite ROUT
SETV
Pull "PC"
LTORG
06
MOV r0,#0
SWI XOS_Find
ADR r2,dataarea
LDR r0,[r2,#40]
LDR r0,[r2,#spMode]
Debug bd,"Sprite mode is ",r0
LDR r5,[r2,#20] ; Get height of sprite
LDR r5,[r2,#spHeight] ; Get height of sprite
ADD r5,r5,#1
Debug bd,"Sprite height is ",r5
LDR r4,[r2,#16] ; Get width in words
LDR r4,[r2,#spWidth] ; Get width in words
MOV r4,r4,LSL #5 ; Max width in bits
LDR r3,[r2,#28] ; Get last bit used
LDR r3,[r2,#spRBit] ; Get last bit used
Debug bd,"Last bit = ",r3
ADD r4,r4,r3 ; Adjust width
LDR r3,[r2,#24] ; Get first bit used
LDR r3,[r2,#spLBit] ; Get first bit used
Debug bd,"First bit = ",r3
SUB r4,r4,r3 ; Adjust width
ADD r4,r4,#1 ; Real width in bits
......@@ -480,7 +487,7 @@ Int_CacheBackdropSprite ROUT
Debug bd,"Sprite size would be ",r2
ADD r2,r2,#&100
STR r2,slot_size ; Amount for actual sprite.
STR r2,slot_size ; Amount for actual sprite.
; Now get size of sprite in file
......@@ -509,9 +516,8 @@ Int_CacheBackdropSprite ROUT
SWI XWimp_ForceRedraw
ADRL r0,ErrorBlock_Pinboard_NoRoom
BL msgtrans_errorlookup
BL msgtrans_errorlookup ; V set on exit
SETV
Pull "PC"
got_memory
......@@ -578,16 +584,24 @@ LoadedOK
Debug bd,"Sprite area initialised"
MOV r0,#135
MOV r0,#OsByte_CursorCharacterAndMode
SWI XOS_Byte
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
Debug bd,"Screen mode is ",r2
Debug bd,"BackdropMode is brought to you by the number ",r2
MOV r6,r2
LDR r0,=&100 + SpriteReason_CreateSprite
MOV r1,#&8000
ADRL r2,BackdropSpriteName ; Create new sprite in current mode
......@@ -855,9 +869,8 @@ Int_CacheJPEG Entry
SWI XWimp_ForceRedraw
ADRL r0,ErrorBlock_Pinboard_NoRoom
BL msgtrans_errorlookup
BL msgtrans_errorlookup ; V set on exit
SETV
Pull "PC"
20 ; Load JPEG
......
......@@ -47,8 +47,8 @@ next_buffer_slot
LDRGT r0, [r0,#icon_handle]
Debug pi,"next icon's handle ",r0
; Find position in active list to place it
MOV r0, #&81
MOV r1, #&ff
MOV r0, #OsByte_INKEY
MOV r1, #&ff ; Shift key
MOV r2, #&ff
SWI XOS_Byte
ADR r0, active_ptr
......
......@@ -144,16 +144,16 @@ reopen_window
iconized_click
; Reopen the window
ADR r1,dataarea
ADD r0,r7,#w_window_handle
LDMIA r0,{r2,r3,r4,r5,r6,r8,r9,r10}
MOV r10,#-1
STMIA r1,{r2,r3,r4,r5,r6,r8,r9,r10}
MOV r0,#2
LDR r2,[r7,#w_task]
Debug ic,"Task is ",r2
SWI XWimp_SendMessage
ADR r1,dataarea
ADD r0,r7,#w_window_handle
LDMIA r0,{r2,r3,r4,r5,r6,r8,r9,r10}
MOV r10,#-1
STMIA r1,{r2,r3,r4,r5,r6,r8,r9,r10}
MOV r0,#2
LDR r2,[r7,#w_task]
Debug ic,"Task is ",r2
SWI XWimp_SendMessage
; Entry point to delete the icon.
delete_window_entry ; Must preserve r5 from here down.
......
......@@ -989,4 +989,4 @@ read_font_widths Entry "r0-r6"
ellipsis_str DCB "",0
]
LNK s.Buffered
LNK Buffered.s
......@@ -268,7 +268,7 @@ create_pinboard_menu ROUT
BEQ %FT01
Push "r1,r2" ; (FG) preserve these registers
MOV r0,#&79 ; If an iconized window check for Shift to produce app. menu.
MOV r0,#OsByte_ScanKeyboard ; If an iconized window check for Shift to produce app. menu.
MOV r1,#&80
SWI XOS_Byte
CMP r1,#&FF
......@@ -545,4 +545,4 @@ app_menu
remove_selection_token DCB "M34s",0
ALIGN
LNK s.MenuSelect
LNK MenuSelect.s
......@@ -435,7 +435,7 @@ Int_DataSaveAck
Debug pi,"Enough memory"
; Check configuration bit, do * copy if no interactive filer copy.
MOV r0,#ReadCMOS
MOV r0,#OsByte_ReadCMOS
MOV r1,#FileSwitchCMOS
SWI XOS_Byte
TST R2,#4
......
......@@ -779,7 +779,7 @@ Pin_Code ROUT
Debug sa,"*Pin called."
MOV r1,r0
ADR r0,pin_args
ADRL r0,pin_args
ADR r2,dataarea
MOV r3,#&100
SWI XOS_ReadArgs ; Read command line args.
......@@ -843,7 +843,7 @@ BackDrop_Code
Debug bd,"*BackDrop called."
MOV r1,r0
ADR r0,backdrop_args
ADRL r0,backdrop_args
ADR r2,dataarea
MOV r3,#&100
SWI XOS_ReadArgs
......@@ -1005,6 +1005,9 @@ BackDrop_Code
Pull "PC"
MakeErrorBlock Pinboard_BadOptions
MakeErrorBlock Pinboard_NotASprite
[ technicolour_text
ASSERT :INDEX: w_next_ptr = 0
ASSERT :INDEX: w_icon_handle = 8
......@@ -1117,7 +1120,4 @@ pinboardoptions_args
addtiny_args DCB "path",0
ALIGN
MakeErrorBlock Pinboard_BadOptions
MakeErrorBlock Pinboard_NotASprite
LNK StartLoop.s
......@@ -546,7 +546,7 @@ Select_DragIcon
; Check for DragASprite
Push "r0-r2"
MOV r0,#ReadCMOS
MOV r0,#OsByte_ReadCMOS
MOV r1,#FileSwitchCMOS
SWI XOS_Byte
MOVVS r3,#0
......@@ -611,4 +611,4 @@ Select_DragIcon
Pull "PC"
LNK s.Drag
LNK Drag.s
......@@ -57,6 +57,7 @@ Module_BaseAddr
GET hdr:Switcher
GET Hdr:Font
GET Hdr:SprExtend
GET Hdr:OSBytes
GET VersionASM
GBLS RESPATH
......@@ -66,47 +67,47 @@ RESPATH SETS "Resources:$.Resources.Pinboard."
[ :DEF: standalone
standalonemessages SETL standalone
|
standalonemessages SETL false ; build resources into module?
standalonemessages SETL {FALSE} ; build resources into module?
]
GBLL UseResize
UseResize SETL true ; use Wimp_ResizeIcon
UseResize SETL {TRUE} ; use Wimp_ResizeIcon
GBLL defaultbackdrop
defaultbackdrop SETL false ; use default backdrop for portable?
defaultbackdrop SETL {FALSE} ; use default backdrop for portable?
GBLL useECFforLCD
useECFforLCD SETL false ; use ECF to do LCD background
useECFforLCD SETL {FALSE} ; use ECF to do LCD background
; Service calls are hammered if set to TRUE because an
; OS_ReadSysInfo of monitor type is done EVERY redraw.
[ defaultbackdrop
useECFforLCD SETL false
useECFforLCD SETL {FALSE}
]
GBLL drag_on_iconise
drag_on_iconise SETL false ; pick up window icon immediately on iconise
drag_on_iconise SETL {FALSE} ; pick up window icon immediately on iconise
GBLL iconise_to_iconbar
iconise_to_iconbar SETL true
iconise_to_iconbar SETL {TRUE}
GBLL show_backdrop_options ; does menu show 'Make backdrop', 'Remove backdrop' etc.
show_backdrop_options SETL false
show_backdrop_options SETL {FALSE}
GBLL debug_commands ; provide *commands for debugging
debug_commands SETL false
debug_commands SETL {FALSE}
GBLL truncate_filenames ; truncate filenames and add ellipsis
truncate_filenames SETL true
truncate_filenames SETL {TRUE}
GBLL ursulawimp ; using an Ursula WIMP?
ursulawimp SETL true
ursulawimp SETL {TRUE}
GBLL noiconbar ; If there's no icon bar, then stretch pinboard to bottom of screen.
noiconbar SETL false
noiconbar SETL {FALSE}
GBLL technicolour_text ; The text for the icon can be set with backdrop -textcolour
technicolour_text SETL true
technicolour_text SETL {TRUE}
GBLL hostvdu
GBLL debugbd
......@@ -121,20 +122,19 @@ technicolour_text SETL true
GBLL debugtmp
GBLL debugnk
debug SETL false
debugnk SETL false
debugbd SETL false ; Backdrop picture
debugpi SETL false ; Pinboard icons
debugtd SETL false ; TinyDirs
debugic SETL false ; Iconize
debugsa SETL false ; Save
debugme SETL false ; Menus
debugim SETL false ; Impression bug.
debughe SETL false ; Interactive Help
debugspr SETL false ; Backdrop sprite
debugtmp SETL false ; Temporary debug
hostvdu SETL true
debug SETL {FALSE}
debugnk SETL {FALSE}
debugbd SETL {FALSE} ; Backdrop picture
debugpi SETL {FALSE} ; Pinboard icons
debugtd SETL {FALSE} ; TinyDirs
debugic SETL {FALSE} ; Iconize
debugsa SETL {FALSE} ; Save
debugme SETL {FALSE} ; Menus
debugim SETL {FALSE} ; Impression bug.
debughe SETL {FALSE} ; Interactive Help
debugspr SETL {FALSE} ; Backdrop sprite
debugtmp SETL {FALSE} ; Temporary debug
hostvdu SETL {TRUE}
[ ursulawimp
! 0, ""
......@@ -205,7 +205,7 @@ DragType_Save * 6
grid_x_spacing * 192
grid_y_spacing * 128
default_icon_bar_height * 134
default_icon_bar_height * 132
; ----------------------------------------------------------------------------------------------------------------------
; Workspace layout
......@@ -381,5 +381,5 @@ ic_block_size * @-ic_next
]
; ----------------------------------------------------------------------------------------------------------------------
LNK s.ModHead
LNK ModHead.s
......@@ -109,7 +109,7 @@ save_drag ROUT
ADD r9,r9,r3
Push "R0-R2"
MOV R0,#ReadCMOS
MOV R0,#OsByte_ReadCMOS
MOV R1,#FileSwitchCMOS
SWI XOS_Byte ; R2 = CMOS byte allocated to FileSwitch
MOVVS R2,#0
......
......@@ -602,6 +602,6 @@ PlotSpriteTiled
EXIT
LNK s.Messages
LNK Messages.s
......@@ -76,12 +76,12 @@ msgtrans_closefile
msgtrans_errorlookup
; In: r0->token error block
; r4-r6->parameters
; Out: r0->error block
; Out: r0->error block & V set
Push "LR"
LDR r1,message_file_block
TEQ r1,#0 ; Do Global lookup if message file not open
ADRNE r1,message_file_block+4
MOV r2,#0
MOV r2,#0 ; Use MessageTrans buffer
SWI XMessageTrans_ErrorLookup
Pull "PC"
......@@ -124,21 +124,21 @@ setupECF
; Set icon_bar_height depending on mode
set_icon_bar_height
Push "r0-r3,lr"
MOV r3, #default_icon_bar_height
Push "r0-r2,lr"
[ noiconbar
MOV r0, #0
|
MOV r0, #-1 ; Get YEig for current mode
MOV r1, #VduExt_YEigFactor
SWI XOS_ReadModeVariable
BVS %FT10
Debug bd,"YEig = ",r2
CMP r2, #2
ADDEQ r3, r3, #2
MOV r0, #default_icon_bar_height
MOVVC r1, #1 ; 1 unit top border
ADDVC r0, r0, r1, LSL r2 ; Convert to pixels
10
[ noiconbar
MOV r3, #0
]
STR r3, icon_bar_height
Pull "r0-r3,pc"
Debug bd,"Iconbar height = ",r0
STR r0, icon_bar_height
Pull "r0-r2,pc"
; Read the mode variables
read_mode_variables ROUT
......@@ -218,7 +218,7 @@ strlen ROUT
read_copy_options
Push "R0-R4,LR"
MOV r0, #ReadCMOS
MOV r0, #OsByte_ReadCMOS
MOV r1, #DesktopCMOS
SWI XOS_Byte
ADDVS sp, sp, #4
......
......@@ -624,4 +624,4 @@ find_next_screen_full
EXIT
LNK s.Tail
LNK Tail.s
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