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

3 minor fixes, 2 minor enhancements

Makefile:
* Conditionally copy the disc resources, saving a little build time.
Wimp10.s; hdr/Wimp:
* Issue Service_WimpToolSpritesChanged when the tool sprite area is changed.
Wimp05:
* Fix bug in softloaded versions of the Wimp where menus would randomly lose the keyboard shortcut text. This was caused by use of an LDR to retrieve a byte wide variable. This specifically affected some softloads because the Wimp gets squeezed, and during unsqueezing the Wimp's workspace ends up being allocated from the same bit of RMA that used to contain the squeezed copy of the module (=lots of random numbers).
Wimp09:
* Fix bug where configuring WimpSpritePrecedence to ROM when a theme is loaded would cause redrawing of window textures to fail. This is because the Wimp intersects the ROM and RAM sprite areas and deletes any duplicates from the RAM area when remaking the fast lookup sprite list. So if the RAM sprites include the "tile_1" (etc) sprite on redrawing the desktop the Wimp points to this, then intersects the lists and deletes the sprite, leaving the pointers pointing at junk. Now, on deleting something, the window tile pointers are invalidated. Fixes ticket #346.
Wimp02:
* Fix bug where the title bar text, when the desktop font is the system font, is incorrectly rendered in the colour selected by WimpVisualFlag -WindowOutlineColour. The Wimp now restores the text colour if -WOC has set the graphics colour to something other than black.

Administrative -
In Wimp01, swap a couple of SpriteReasons from magic numbers. In the init of variables use the common reset_all_tiling_sprite function.
In Tiling3D, more SpriteReasons, and rationalise the registers used in reset_all_tiling_sprites.

Version 5.32. Tagged as 'Wimp-5_32'
parent fa42b0ad
......@@ -42,27 +42,22 @@ SA_FLAGS =
ASFLAGS = -NoWarn -PreDefine "Options SETS \"${OPTIONS}\""
ifeq (${TARGET},ThemeDefs)
CUSTOMSA = custom
CUSTOMEXP = custom
install:
${MKDIR} ${INSTDIR}.${USERIF}
| At least give the equivalent ROM ones for that UserIF
${CP} LocalRes:${USERIF}.Sprites ${INSTDIR}.${USERIF}.Sprites ${CPFLAGS}
${CP} LocalRes:${USERIF}.Tools ${INSTDIR}.${USERIF}.Tools ${CPFLAGS}
| Then give the disc ones in preference if they exist
IfThere LocalRes:${USERIF}.DiscSprites.Sprites Then ${CP} LocalRes:${USERIF}.DiscSprites.Sprites ${INSTDIR}.${USERIF}.Sprites ${CPFLAGS}
| Give the disc ones in preference if they exist, else minimalist ROM ones
IfThere LocalRes:${USERIF}.DiscSprites.Sprites Then ${CP} LocalRes:${USERIF}.DiscSprites.Sprites ${INSTDIR}.${USERIF}.Sprites ${CPFLAGS} Else ${CP} LocalRes:${USERIF}.Sprites ${INSTDIR}.${USERIF}.Sprites ${CPFLAGS}
IfThere LocalRes:${USERIF}.DiscSprites.Sprites11 Then ${CP} LocalRes:${USERIF}.DiscSprites.Sprites11 ${INSTDIR}.${USERIF}.Sprites11 ${CPFLAGS}
IfThere LocalRes:${USERIF}.DiscSprites.Sprites22 Then ${CP} LocalRes:${USERIF}.DiscSprites.Sprites22 ${INSTDIR}.${USERIF}.Sprites22 ${CPFLAGS}
IfThere LocalRes:${USERIF}.DiscSprites.Tools Then ${CP} LocalRes:${USERIF}.DiscSprites.Tools ${INSTDIR}.${USERIF}.Tools ${CPFLAGS}
IfThere LocalRes:${USERIF}.DiscSprites.Tools Then ${CP} LocalRes:${USERIF}.DiscSprites.Tools ${INSTDIR}.${USERIF}.Tools ${CPFLAGS} Else ${CP} LocalRes:${USERIF}.Tools ${INSTDIR}.${USERIF}.Tools ${CPFLAGS}
IfThere LocalRes:${USERIF}.DiscSprites.CoFlags Then ${CP} LocalRes:${USERIF}.DiscSprites.CoFlags ${INSTDIR}.${USERIF}.CoFlags ${CPFLAGS}
IfThere LocalRes:${USERIF}.DiscSprites.CoSprite Then ${CP} LocalRes:${USERIF}.DiscSprites.CoSprite ${INSTDIR}.${USERIF}.CoSprite ${CPFLAGS}
@${ECHO} ${COMPONENT}: disc theme resources installed
export:
@${ECHO} ${COMPONENT}: nothing to export when target is ${TARGET}
endif
include StdTools
......
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.31"
Module_Version SETA 531
Module_MajorVersion SETS "5.32"
Module_Version SETA 532
Module_MinorVersion SETS ""
Module_Date SETS "07 Aug 2013"
Module_ApplicationDate SETS "07-Aug-13"
Module_Date SETS "08 Sep 2013"
Module_ApplicationDate SETS "08-Sep-13"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.31"
Module_HelpVersion SETS "5.31 (07 Aug 2013)"
Module_FullVersion SETS "5.32"
Module_HelpVersion SETS "5.32 (08 Sep 2013)"
END
/* (5.31)
/* (5.32)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.31
#define Module_MajorVersion_CMHG 5.32
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Aug 2013
#define Module_Date_CMHG 08 Sep 2013
#define Module_MajorVersion "5.31"
#define Module_Version 531
#define Module_MajorVersion "5.32"
#define Module_Version 532
#define Module_MinorVersion ""
#define Module_Date "07 Aug 2013"
#define Module_Date "08 Sep 2013"
#define Module_ApplicationDate "07-Aug-13"
#define Module_ApplicationDate "08-Sep-13"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.31"
#define Module_HelpVersion "5.31 (07 Aug 2013)"
#define Module_LibraryVersionInfo "5:31"
#define Module_FullVersion "5.32"
#define Module_HelpVersion "5.32 (08 Sep 2013)"
#define Module_LibraryVersionInfo "5:32"
......@@ -137,6 +137,19 @@ SWIClass SETS WimpSWI_Name
AddSWI AutoScroll ; &400FD Wimp 4.00 onwards
; AddSWI MiscOp ; &400FE
; Service calls
[ :LNOT::DEF: WimpService ; While migrating to Hdr:Services
WimpService * &400C0
]
^ WimpService
[ :LNOT::DEF: Service_ErrorStarting ; While migrating from Hdr:Services
Service_ErrorStarting # 1
Service_ErrorButtonPressed # 1
Service_ErrorEnding # 1
]
^ WimpService+3
Service_WimpToolSpritesChanged # 1
; ReadSysInfo reason codes
^ 0
......
......@@ -145,7 +145,7 @@ TileWindowBackground
cmp r1,#2
blo %FT00
teq r5,#1
teq r5,#sc_verylightgrey
bne %FT00
adr r2,tile_1
......@@ -171,8 +171,9 @@ TileWindowBackground
Pull "r6-r11,PC"
00 adrl r8,tile_sprites
ASSERT TileInfo = 36
add r0,r5,r5,LSL #3
mov r0,r0,LSL #2 ; r0 = r5 * sizeof(SpriteInfo)
mov r0,r0,LSL #2 ; r0 = r5 * sizeof(TileInfo)
add r8,r8,r0 ; r8 = ptr to correct sprite info block
bl get_tile_sprite ; r8 = ptr to filled in sprite info block
......@@ -523,7 +524,7 @@ tile_sprite_fill_area
sub x0,x0,r3 ; move it back over the left edge of the window
mov r0,#52+512
mov r0,#SpriteReason_PutSpriteScaled+512
ldr r1,[r11,#TileInfo_SpriteAreaPtr]
ldr r2,[r11,#TileInfo_SpritePtr]
mov r5,#0
......@@ -558,32 +559,31 @@ plot_tile ROUT
swi XOS_SpriteOp
Pull "r6,r7,pc"
reset_all_tiling_sprites
reset_all_tiling_sprites ROUT
; on entry R0 = the value to write to all tile sprite pointers
; all tile sprite pointers are updated and all translation tables freed
ROUT
Push "r0-r6,lr"
Push "r0-r4,lr"
mov r6,r0
mov r1,r0
Debug tiling, "Reset tiling to", r1
adrl r5,tile_sprites
add r4,r5,#TileInfo * 18 ; 16 background tiles + menu tile + temp tile
adrl r3,tile_sprites
add r4,r3,#TileInfo * 18 ; 16 background tiles + menu tile + temp tile
00 str r6,[r5,#TileInfo_SpritePtr] ; set the sprite pointer
00 str r1,[r3,#TileInfo_SpritePtr] ; set the sprite pointer
ldr r2,[r5,#TileInfo_TranslationTablePtr]
ldr r2,[r3,#TileInfo_TranslationTablePtr]
teq r2,#0 ; if the table is non zero then free it
movne r0,#ModHandReason_Free
blne XROS_Module
mov r2,#0
str r2,[r5,#TileInfo_TranslationTablePtr] ; the table no longer exists so set the pointer to 0
str r2,[r3,#TileInfo_TranslationTablePtr] ; the table no longer exists so set the pointer to 0
add r5,r5,#TileInfo ; move on to the next one
cmp r5,r4
blt %BT00
add r3,r3,#TileInfo ; move on to the next one
cmp r3,r4
bcc %BT00
Pull "r0-r6,pc" ; exit with V clear
Pull "r0-r4,pc" ; exit with V clear
END
......@@ -3080,7 +3080,7 @@ dospriteop
BEQ ExitWimp
dospriteopnext
TEQ R0,#99
MOVEQ R0,#40 ; read info
MOVEQ R0,#SpriteReason_ReadSpriteSize
MOV R1,#1 ; incase daft routines expect it
BL wimp_SpriteOp
STMIA sp, {R1-R10} ; return correct results to caller
......@@ -3731,17 +3731,9 @@ gotwork
STRB R0, tinted_tool
]
[ windowsprite
[ ThreeDPatch ; initialise all the tile sprite info blocks
MOV R0,#0
ADRL R2,tile_sprites
ADD R3,R2,#TileInfo * 18
00 STR R0,[R2,#TileInfo_SpritePtr] ; set all sprite pointer to -1
STR R0,[R2,#TileInfo_TranslationTablePtr] ; and all translation table pointers to 0
ADD R2,R2,#TileInfo
CMP R2,R3
BLT %BT00
[ ThreeDPatch
MOV R0,#0 ; initialise all the tile sprite info blocks
BL reset_all_tiling_sprites
|
MOV R0,#-1
STR R0,tiling_sprite ; no tile sprite
......@@ -7203,7 +7195,7 @@ WimpKillSprite_Code
MOV R0,#1
STR R0,thisCBptr
STR R0,lengthflags
MOV R0,#25 ; delete sprite
MOV R0,#SpriteReason_DeleteSprite
BL wimp_SpriteOp
[ windowsprite
......
......@@ -8115,16 +8115,22 @@ have_thin_border
SUB y0,y0,R14
ADD y1,y1,R14
[ TrueIcon3
[ TrueIcon3
LDR R0, truetitlefg ; set title foreground colour
CMP R0, #rgb_black ; is foreground colour black?
[ ThreeDPatch
CMP R0, #rgb_black ; is foreground colour defaultk?
LDREQ R0, truewindowoutlinecolour ; if so, get window outline colour
|
LDRB R0,[handle,#w_tfcol] ; set title foreground colour
]
|
LDRB R0,[handle,#w_tfcol] ; set title foreground colour
]
BL window_fg
BL hollowrectangle
[ TrueIcon3 :LAND: ThreeDPatch
LDR R0, truetitlefg
CMP R0, #rgb_black
BLEQ window_fg ; Don't leave windowoutlinecolour selected
]
[ ChildWindows
no_thin_border
......@@ -8821,16 +8827,22 @@ have_thin_outline
; ADD y0,y0,R14
; SUB y1,y1,R14
[ TrueIcon3
[ TrueIcon3
LDR R0, truetitlefg ; set title foreground colour
CMP R0, #rgb_black ; is foreground colour black?
[ ThreeDPatch
CMP R0, #rgb_black ; is foreground colour defaultk?
LDREQ R0, truewindowoutlinecolour ; if so, get window outline colour
|
LDRB R0,[handle,#w_tfcol] ; set title foreground colour
]
|
LDRB R0,[handle,#w_tfcol] ; set title foreground colour
]
BL window_fg
BL hollowrectangle
[ TrueIcon3 :LAND: ThreeDPatch
LDR R0, truetitlefg
CMP R0, #rgb_black
BLEQ window_fg ; Don't leave windowoutlinecolour selected
]
[ ChildWindows
no_thin_outline
......
......@@ -5742,7 +5742,7 @@ fixupfontstring_end
BIC R1, R1, #3
LDR R1, [R1, #w_x1]
[ ThreeDPatch
LDR R14, arrowIconWidth
LDRB R14, arrowIconWidth
SUB R1, R1, #16 - 6 ; portion of excess text icon width on right
SUB R1, R1, R14
|
......
......@@ -246,7 +246,15 @@ makespritelist Entry "R0-R4,R8-R9"
MOV R1, R8
MOV R2, R4
SWI XOS_SpriteOp ; delete the unnecessary sprite
[ windowsprite
[ ThreeDPatch
MOV R0,#0 ; RAM pointers are now stale
BL reset_all_tiling_sprites
|
MOV R0,#-1 ; RAM pointers are now stale
STR R0,tiling_sprite
]
]
LDR R2, list_at ; go back to beginning of list
56 CMP R2, R3 ; have we finished yet?
Pull "R2,R5,R8,R9", EQ
......@@ -345,7 +353,7 @@ freelist EntryS "R0-R2"
;; Based on the algorithm in Knuth; Sorting/Searching, pp 407
;;
;; in [spritename] --> sprite name
;; out R2 -> sprite, VS/VC if found/not found
;; out R2 -> sprite, VS/VC if not found/found
;;-----------------------------------------------------------------------------
getspriteaddr Entry "R0-R1,R3-R5"
......
......@@ -1305,6 +1305,21 @@ freetooltrans ROUT
MOV PC,R1
;;-----------------------------------------------------------------------------
;; Set tools area, and do accompanying service call
;;
;; in R1 = value to set tool_area to
;;-----------------------------------------------------------------------------
settoolarea Entry "R1-R2"
STR R1,tool_area
MOV R2,R1 ; R2 -> new tool area
LDR R1,=Service_WimpToolSpritesChanged
SWI XOS_ServiceCall
EXIT
LTORG
;;-----------------------------------------------------------------------------
;; Free tools area, this attempts to free the tools area owned, even if none
;; is owned the areaCB is reset back to the default 16 byte block.
......@@ -1334,8 +1349,8 @@ freetoolarea EntryS "R1-R4"
BLLO XROS_Module ; attempt to free the buffer (ignore errors)
;
01 MOV R0,#0
STR R0,tool_area ; flag as being released
01 MOV R1,#0
BL settoolarea ; flag as being released
;
BL freetoollist ; release the tool list (used for finding the sprites)
BL freetooltrans ; release translation tables
......@@ -1411,7 +1426,7 @@ int_toolsprites Entry "R1-R6"
Debug tools,"Binding to ResourceFS block"
05
BL freetoolarea ; release the existing area
STR R1,tool_area ; -> tools in ResourcesFS
BL settoolarea ; -> tools in ResourcesFS
;
ADD R6,R6,#4
LDMIA R1!,{R7-R9} ; get the next set of bytes
......
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