Commit 41cb4f23 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix to build with HdrSrc-2_42. Use OS_SpriteOp 65 where possible.

Detail:
  s/Wimp01 - Update Wimp_SpriteOp handler to cope with the new SpriteReason_BadReasonCode value. Initialise unused bits of spritebits to 1 so that it acts as a whitelist, only allowing through operations that we know are safe.
  s/Tiling3D - Use OS_SpriteOp 65 for drawing tiled window backgrounds. Softload versions will fall back to using the old manual tiling code if OS_SpriteOp 65 is unavailable.
  s/Wimp10 - Use OS_SpriteOp 65 for drawing the tiled sprites that make up scrollbar wells and bars. Falls back to manual tiling in softload versions.
Admin:
  Tested on Iyonix, BB-xM
  Requires HdrSrc-2_42


Version 5.37. Tagged as 'Wimp-5_37'
parent 9187a060
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "5.36" Module_MajorVersion SETS "5.37"
Module_Version SETA 536 Module_Version SETA 537
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "01 Mar 2014" Module_Date SETS "09 Mar 2014"
Module_ApplicationDate SETS "01-Mar-14" Module_ApplicationDate SETS "09-Mar-14"
Module_ComponentName SETS "Wimp" Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp" Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.36" Module_FullVersion SETS "5.37"
Module_HelpVersion SETS "5.36 (01 Mar 2014)" Module_HelpVersion SETS "5.37 (09 Mar 2014)"
END END
/* (5.36) /* (5.37)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 5.36 #define Module_MajorVersion_CMHG 5.37
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 01 Mar 2014 #define Module_Date_CMHG 09 Mar 2014
#define Module_MajorVersion "5.36" #define Module_MajorVersion "5.37"
#define Module_Version 536 #define Module_Version 537
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "01 Mar 2014" #define Module_Date "09 Mar 2014"
#define Module_ApplicationDate "01-Mar-14" #define Module_ApplicationDate "09-Mar-14"
#define Module_ComponentName "Wimp" #define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp" #define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.36" #define Module_FullVersion "5.37"
#define Module_HelpVersion "5.36 (01 Mar 2014)" #define Module_HelpVersion "5.37 (09 Mar 2014)"
#define Module_LibraryVersionInfo "5:36" #define Module_LibraryVersionInfo "5:37"
...@@ -494,6 +494,27 @@ tile_sprite_fill_area ...@@ -494,6 +494,27 @@ tile_sprite_fill_area
mov r11,r8 mov r11,r8
ldr r0,=SpriteReason_TileSpriteScaled+512
ldr r1,[r11,#TileInfo_SpriteAreaPtr]
ldr r2,[r11,#TileInfo_SpritePtr]
ldr r3,[handle,#w_scx]
ldr r6,[handle,#w_wax0]
ldr r4,[handle,#w_scy]
ldr r7,[handle,#w_way1]
sub r3,r6,r3
sub r4,r7,r4
mov r5,#0
bl plot_tile
[ standalone
; Fall black to plotting the tiles manually if the above call
; failed due to OS_SpriteOp 65 not being available
bvc %ft90
ldr r0,[r0]
ldr r1,=Sprite_BadReasonCode
teq r0,r1
bne %ft90
ldr x0,[handle,#w_wax0] ldr x0,[handle,#w_wax0]
ldr r0,[handle,#w_scx] ldr r0,[handle,#w_scx]
ldr r3,[r11,#TileInfo_Width] ldr r3,[r11,#TileInfo_Width]
...@@ -543,6 +564,8 @@ tile_sprite_fill_area ...@@ -543,6 +564,8 @@ tile_sprite_fill_area
sub r4,r4,r10 ; move down one tile sub r4,r4,r10 ; move down one tile
cmp r4,y0 ; if more tiles below cmp r4,y0 ; if more tiles below
bgt %BT02 ; keep going bgt %BT02 ; keep going
90
] ; standalone
Pull "r0-r11,pc" Pull "r0-r11,pc"
......
...@@ -3144,8 +3144,9 @@ dospriteopnext ...@@ -3144,8 +3144,9 @@ dospriteopnext
spritebits ; 0 8 16 24 31 spritebits ; 0 8 16 24 31
DCD 2_11100000011000111000000001110111 DCD 2_11100000011000111000000001110111
DCD 2_11010000001011110000001001101100 DCD 2_11010000001011110000001001101101
ASSERT SpriteReason_BadReasonCode < 64 DCD 2_10111111111111111111111111111111
ASSERT SpriteReason_BadReasonCode < 96
sprite_not_found sprite_not_found
ADR R0,SpriteDoesntExist ADR R0,SpriteDoesntExist
......
...@@ -2395,8 +2395,15 @@ dofunkyvscroll EntryS "R0-R11" ...@@ -2395,8 +2395,15 @@ dofunkyvscroll EntryS "R0-R11"
LDR R14,vscroll_bottom LDR R14,vscroll_bottom
ADD R4,R4,R14 ADD R4,R4,R14
ADD R4,R4,R1 ; plot the end of the block ADD R4,R4,R1 ; plot the end of the block
LDR R2,[R10,#tool_vwellb] LDR R2,[R10,#tool_vwellb]
BL set_vclip
BLE %FT20
LDR R0,=SpriteReason_TileSpriteScaled+512
BL Tool_SpriteOp
LDR R0,tool_plotparams
[ standalone
; Plot manually if OS_SpriteOp 65 failed
BVC %FT20
10 10
CMP R4,R11 CMP R4,R11
BLLE Tool_SpriteOp BLLE Tool_SpriteOp
...@@ -2404,6 +2411,7 @@ dofunkyvscroll EntryS "R0-R11" ...@@ -2404,6 +2411,7 @@ dofunkyvscroll EntryS "R0-R11"
ADDLE R4,R4,R14 ADDLE R4,R4,R14
ADDLE R4,R4,R1 ADDLE R4,R4,R1
BLE %BT10 ; fill in the top section BLE %BT10 ; fill in the top section
]
; ;
; now plot the top section of the scroll bar ; now plot the top section of the scroll bar
; ;
...@@ -2420,6 +2428,17 @@ dofunkyvscroll EntryS "R0-R11" ...@@ -2420,6 +2428,17 @@ dofunkyvscroll EntryS "R0-R11"
BL Tool_SpriteOp ; plot the top shell BL Tool_SpriteOp ; plot the top shell
; ;
LDR R2,[R10,#tool_vwellt] LDR R2,[R10,#tool_vwellt]
MOV R11,R4
LDR R4,[sp,#Proc_RegOffset+sp_cy1]
BL set_vclip
BLE %FT20
MOV R4,R11
LDR R0,=SpriteReason_TileSpriteScaled+512
BL Tool_SpriteOp
LDR R0,tool_plotparams
[ standalone
; Plot manually if OS_SpriteOp 65 failed
BVC %FT20
LDR R11,[sp,#Proc_RegOffset+sp_cy1] LDR R11,[sp,#Proc_RegOffset+sp_cy1]
10 10
CMP R4,R11 CMP R4,R11
...@@ -2428,6 +2447,7 @@ dofunkyvscroll EntryS "R0-R11" ...@@ -2428,6 +2447,7 @@ dofunkyvscroll EntryS "R0-R11"
SUBGE R4,R4,R1 SUBGE R4,R4,R1
BLGE Tool_SpriteOp ; plot a section BLGE Tool_SpriteOp ; plot a section
BGE %BT10 ; loop back until all plotted BGE %BT10 ; loop back until all plotted
]
; ;
; plot the scroll sausage ; plot the scroll sausage
; ;
...@@ -2477,6 +2497,14 @@ dofunkyvscroll EntryS "R0-R11" ...@@ -2477,6 +2497,14 @@ dofunkyvscroll EntryS "R0-R11"
ADD R4,R4,R1 ; base of the area ADD R4,R4,R1 ; base of the area
; ;
LDR R2,[R10,#tool_vbarmid] LDR R2,[R10,#tool_vbarmid]
BL set_vclip
BLE %FT20
LDR R0,=SpriteReason_TileSpriteScaled+512
BL Tool_SpriteOp
LDR R0,tool_plotparams
[ standalone
; Plot manually if OS_SpriteOp 65 failed
BVC %FT20
10 10
CMP R4,R11 CMP R4,R11
BLLE Tool_SpriteOp BLLE Tool_SpriteOp
...@@ -2484,7 +2512,11 @@ dofunkyvscroll EntryS "R0-R11" ...@@ -2484,7 +2512,11 @@ dofunkyvscroll EntryS "R0-R11"
ADDLE R4,R4,R14 ADDLE R4,R4,R14
ADDLE R4,R4,R1 ADDLE R4,R4,R1
BLE %BT10 ; loop back until blob section plotted BLE %BT10 ; loop back until blob section plotted
]
; ;
20 LDR R4,[sp,#Proc_RegOffset+sp_cy0]
LDR R11,[sp,#Proc_RegOffset+sp_cy1]
BL set_vclip ; restore clip region
LDR R14,vscroll_blobtop LDR R14,vscroll_blobtop
SUB R4,R11,R14 SUB R4,R11,R14
SUB R4,R4,R1 SUB R4,R4,R1
...@@ -2615,6 +2647,14 @@ dofunkyhscroll EntryS "R0-R11" ...@@ -2615,6 +2647,14 @@ dofunkyhscroll EntryS "R0-R11"
ADD R3,R3,R1 ADD R3,R3,R1
; ;
LDR R2,[R10,#tool_hwelll] LDR R2,[R10,#tool_hwelll]
BL set_hclip
BLE %FT15
LDR R0,=SpriteReason_TileSpriteScaled+512
BL Tool_SpriteOp
LDR R0,tool_plotparams
[ standalone
; Plot manually if OS_SpriteOp 65 failed
BVC %FT15
10 10
CMP R3,R11 ; have we finished plotting the blanking section CMP R3,R11 ; have we finished plotting the blanking section
BLLE Tool_SpriteOp BLLE Tool_SpriteOp
...@@ -2622,6 +2662,7 @@ dofunkyhscroll EntryS "R0-R11" ...@@ -2622,6 +2662,7 @@ dofunkyhscroll EntryS "R0-R11"
ADDLE R3,R3,R14 ADDLE R3,R3,R14
ADDLE R3,R3,R1 ADDLE R3,R3,R1
BLE %BT10 ; loop filling in the base area BLE %BT10 ; loop filling in the base area
]
; ;
; plot the right hand side of the bar ; plot the right hand side of the bar
; ;
...@@ -2638,6 +2679,17 @@ dofunkyhscroll EntryS "R0-R11" ...@@ -2638,6 +2679,17 @@ dofunkyhscroll EntryS "R0-R11"
BL Tool_SpriteOp ; put the scroll blob BL Tool_SpriteOp ; put the scroll blob
; ;
LDR R2,[R10,#tool_hwellr] LDR R2,[R10,#tool_hwellr]
MOV R11,R3
LDR R3,[sp,#Proc_RegOffset+sp_cx1]
BL set_hclip
BLE %FT25
MOV R3,R11
LDR R0,=SpriteReason_TileSpriteScaled+512
BL Tool_SpriteOp
LDR R0,tool_plotparams
[ standalone
; Plot manually if OS_SpriteOp 65 failed
BVC %FT25
LDR R11,[sp,#Proc_RegOffset+sp_cx1] LDR R11,[sp,#Proc_RegOffset+sp_cx1]
20 CMP R3,R11 20 CMP R3,R11
LDRGE R14,hscroll_rightfill LDRGE R14,hscroll_rightfill
...@@ -2645,6 +2697,7 @@ dofunkyhscroll EntryS "R0-R11" ...@@ -2645,6 +2697,7 @@ dofunkyhscroll EntryS "R0-R11"
SUBGE R3,R3,R1 SUBGE R3,R3,R1
BLGE Tool_SpriteOp BLGE Tool_SpriteOp
BGE %BT20 BGE %BT20
]
; ;
; plot the scroll blob section ; plot the scroll blob section
; ;
...@@ -2697,6 +2750,14 @@ dofunkyhscroll EntryS "R0-R11" ...@@ -2697,6 +2750,14 @@ dofunkyhscroll EntryS "R0-R11"
ADD R3,R3,R1 ADD R3,R3,R1
; ;
LDR R2,[R10,#tool_hbarmid] LDR R2,[R10,#tool_hbarmid]
BL set_hclip
BLE %FT40
LDR R0,=SpriteReason_TileSpriteScaled+512
BL Tool_SpriteOp
LDR R0,tool_plotparams
[ standalone
; Plot manually if OS_SpriteOp 65 failed
BVC %FT40
38 38
CMP R3,R11 CMP R3,R11
BLLT Tool_SpriteOp BLLT Tool_SpriteOp
...@@ -2704,7 +2765,11 @@ dofunkyhscroll EntryS "R0-R11" ...@@ -2704,7 +2765,11 @@ dofunkyhscroll EntryS "R0-R11"
ADDLT R3,R3,R14 ADDLT R3,R3,R14
ADDLT R3,R3,R1 ADDLT R3,R3,R1
BLT %BT38 BLT %BT38
]
; ;
40 LDR R3,[sp,#Proc_RegOffset+sp_cx0] ; setup the region to plot the blob
LDR R11,[sp,#Proc_RegOffset+sp_cx1]
BL set_hclip ; restore clip region
LDR R2,[R10,#tool_hbarr] LDR R2,[R10,#tool_hbarr]
Debug scroll,"tool_phbarr",R2 Debug scroll,"tool_phbarr",R2
......
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