Commit 8913591b authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Change Wimp_ReadSysInfo 2 to not return alpha sprite names. Add...

Change Wimp_ReadSysInfo 2 to not return alpha sprite names. Add Wimp_ReadSysInfo 29 and Wimp_Extend 257.

Detail:
  s/Wimp01 - Change romspr_suffix initialisation so that it won't store alpha sprite suffixes. This has the knock-on effect of making Wimp_ReadSysInfo 2 no longer return alpha sprite suffixes, without affecting any of the sprite search code
  hdr/Wimp, s/Wimp01 - Add Wimp_ReadSysInfo 29 to read the alphaspriteflag value - i.e. whether alpha sprites are supported by the OS/Wimp and *IconSprites, Wimp_Extend 13, etc. will look for them
  hdr/Wimp - Document the private Wimp_Extend reason codes and add a couple of ROL's reason codes
  s/NewSWIs - Tidy up Wimp_Extend implementation to use a jump table instead of a load of tests and branches. Add an implementation of ROL's Wimp_Extend 257, which just acts as a wrapper around Wimp_Extend 13
Admin:
  Tested on Raspberry Pi
  Wimp_ReadSysInfo 2 change should fix issue reported on forums with software unexpectedly using low-res sprites or failing altogether:
  http://www.riscosopen.org/forum/forums/4/topics/2274


Version 5.35. Tagged as 'Wimp-5_35'
parent 9f37c9dd
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.34"
Module_Version SETA 534
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS ""
Module_Date SETS "30 Nov 2013"
Module_ApplicationDate SETS "30-Nov-13"
Module_Date SETS "01 Jan 2014"
Module_ApplicationDate SETS "01-Jan-14"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.34"
Module_HelpVersion SETS "5.34 (30 Nov 2013)"
Module_FullVersion SETS "5.35"
Module_HelpVersion SETS "5.35 (01 Jan 2014)"
END
/* (5.34)
/* (5.35)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.34
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 Nov 2013
#define Module_Date_CMHG 01 Jan 2014
#define Module_MajorVersion "5.34"
#define Module_Version 534
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion ""
#define Module_Date "30 Nov 2013"
#define Module_Date "01 Jan 2014"
#define Module_ApplicationDate "30-Nov-13"
#define Module_ApplicationDate "01-Jan-14"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.34"
#define Module_HelpVersion "5.34 (30 Nov 2013)"
#define Module_LibraryVersionInfo "5:34"
#define Module_FullVersion "5.35"
#define Module_HelpVersion "5.35 (01 Jan 2014)"
#define Module_LibraryVersionInfo "5:35"
......@@ -182,18 +182,29 @@ WimpSysInfo_AutoMenuPause # 1 ; Wimp 5.14 onwards
WimpSysInfo_IconbarFactors # 1 ; Wimp 5.14 onwards
WimpSysInfo_Reserved_ROL27 # 1 ; RISC OS Select
WimpSysInfo_ThreeDFlags # 1 ; Wimp 5.14 onwards
WimpSysInfo_AlphaSprites # 1 ; Wimp 5.35 onwards
WimpSysInfo_MAX # 0
; Extend reason codes
^ 6 ; earlier codes are internal use only
WimpExtend_Parent # 1
WimpExtend_FrontChild # 1
WimpExtend_BackChild # 1
WimpExtend_SiblingAbove # 1
WimpExtend_SiblingBehind # 1
WimpExtend_GetBorderInfo # 1 ; Wimp 3.99 onwards
^ 1
WimpExtend_Workspace # 1 ; 1 Private
WimpExtend_Jumptable # 1 ; 2 Private
WimpExtend_SWICallback # 1 ; 3 Private
WimpExtend_SpriteNamePointers # 1 ; 4 Private
WimpExtend_TilingCallback # 1 ; 5 Private
WimpExtend_Parent # 1 ; 6
WimpExtend_FrontChild # 1 ; 7
WimpExtend_BackChild # 1 ; 8
WimpExtend_SiblingAbove # 1 ; 9
WimpExtend_SiblingBehind # 1 ; 10
WimpExtend_GetBorderInfo # 1 ; 11 Wimp 3.99 onwards
WimpExtend_NCErrorPointerSuspend # 1 ; 12 Private/STB-only
WimpExtend_SpriteSuffix # 1 ; 13 Wimp 4.85 onwards
WimpExtend_MAX # 0
WimpExtend_SpriteSuffix_ROL * 257 ; ROOL Wimp 5.35 onwards
WimpExtend_SpriteColourmap_ROL * 258 ; ROOL unimplemented
; TextOp
Wimp_SetTextColour * 0
......
......@@ -550,60 +550,86 @@ badiconhandle
SETV
B ExitWimp
SWIWimp_Extend
badextend * ExitWimp
SWIWimp_Extend ROUT
MyEntry "Extend"
TEQ R0,#1
MOVEQ R0,R12
BEQ ExitWimp
TEQ R0,#2
ADREQ R0,extendjumptable
BEQ ExitWimp
TEQ R0,#3
LDREQ R0,wimpswiintercept
STREQ R1,wimpswiintercept
BEQ ExitWimp
TEQ R0,#4
ADREQ R0,spritename
ADREQ R1,list_at
STREQ R1,[sp]
BEQ ExitWimp
TEQ R0,#5
LDREQ R0,plotsprCB
STREQ R1,plotsprCB
BEQ ExitWimp
[ ChildWindows
CMP R0,#6 ; In: R0 = 6 => get parent, 7,8 => get top/bottom child, 9,10 => get next/previous sibling
RSBHSS R14,R0,#10 ; In: R1 = window handle, or -1 for top-level ; Out: R1 = result handle, or -1 for none
BHS %FT01
]
TEQ R0,#11 ; In: R1 = pointer to block to fill with furniture dimensions
BEQ %FT11 ; [R1,#0] = window handle to use, or 0 for generic values
[ NCErrorBox
TEQ R0,#12
BEQ %FT12
]
TEQ R0,#13
BEQ %FT13
CMP R0,#WimpExtend_MAX
ADDLO PC,PC,R0,LSL #2
B extend_more
00
B badextend
B extend_workspace
B extend_jumptable
B extend_swicallback
B extend_spritenamepointers
B extend_tilingcallback
B extend_parent
B extend_frontchild
B extend_backchild
B extend_siblingabove
B extend_siblingbehind
B extend_getborderinfo
B extend_ncerrorpointersuspend
B extend_spritesuffix
ASSERT . - %BT00 = WimpExtend_MAX*4
extend_more
SUB R14,R0,#256
CMP R14,#WimpExtend_SpriteSuffix_ROL-256
BEQ extend_spritesuffix_rol
B badextend
extend_workspace
MOV R0,R12
B ExitWimp
[ ChildWindows
extend_jumptable
ADR R0,extendjumptable
B ExitWimp
extend_swicallback
LDR R0,wimpswiintercept
STR R1,wimpswiintercept
B ExitWimp
extend_spritenamepointers
ADR R0,spritename
ADR R1,list_at
STR R1,[sp]
B ExitWimp
01 CMP R1,#nullptr
extend_tilingcallback
LDR R0,plotsprCB
STR R1,plotsprCB
B ExitWimp
[ ChildWindows
extend_parent
extend_frontchild
extend_backchild
extend_siblingabove
extend_siblingbehind
ROUT
; In: R0 = 6 => get parent, 7,8 => get top/bottom child, 9,10 => get next/previous sibling
; R1 = window handle, or -1 for top-level
; Out: R1 = result handle, or -1 for none
CMP R1,#nullptr
BEQ %FT05
MOV handle,R1
BL checkhandle_iconbar
BVS ExitWimp
CMP R0,#7
CMP R0,#WimpExtend_FrontChild
LDRLO handle,[handle,#w_parent]
BLO %FT03
LDREQ handle,[handle,#w_children + lh_forwards]
BEQ %FT02
CMP R0,#9
CMP R0,#WimpExtend_SiblingAbove
LDRLO handle,[handle,#w_children + lh_backwards]
BLO %FT02
......@@ -612,7 +638,7 @@ SWIWimp_Extend
MOVEQ handle,#nullptr
BEQ %FT04
CMP R0,#9
CMP R0,#WimpExtend_SiblingAbove
LDREQ handle,[handle,#w_active_link + ll_forwards]
LDRHI handle,[handle,#w_active_link + ll_backwards]
......@@ -630,29 +656,39 @@ SWIWimp_Extend
04 STR handle,[sp]
B ExitWimp
05 CMP R0,#7
05 CMP R0,#WimpExtend_FrontChild
LDREQ handle,activewinds + lh_forwards
BEQ %BT02
CMP R0,#8
CMP R0,#WimpExtend_BackChild
LDREQ handle,activewinds + lh_backwards
BEQ %BT02
B ExitWimp
|
extend_parent * badextend
extend_frontchild * badextend
extend_backchild * badextend
extend_siblingabove * badextend
extend_siblingbehind * badextend
]
[ NCErrorBox
; Handle hiding of pointer for the duration of keyboard-driving of pointer
12 MOV R0, #106
extend_ncerrorpointersuspend
MOV R0, #106
MOV R1, #0
SWI XOS_Byte ; turn off pointer
MOV R0, #1
ADRL R14, ptrsuspendflag
STR R0, [R14]
B ExitWimp
|
extend_ncerrorpointersuspend * badextend
]
13 ; Work out for the client what resolution suffix to append to a sprites file
extend_spritesuffix ROUT
; Work out for the client what resolution suffix to append to a sprites file
; First available in Wimp 4.85
; Older Wimps don't return error, but can be detected because all registers are preserved
; On entry:
......@@ -757,6 +793,46 @@ loop4 ADD LR, R5, #'0'
SWIVC XOS_Find
B ExitWimp ; return any error we got from this last one
extend_spritesuffix_rol ROUT
; In: R1 = buffer containing pathname of file with no suffix
; Out: R0 = buffer passed in
; R1 = 0 (to indicate call supported by Wimp version)
; This is effectively the same as Wimp_Extend 13, except the name is
; updated in-place, and no error is returned if no suitable file is
; found.
; To keep things simple, we'll just allocate a temporary buffer from the
; RMA and call Wimp_Extend 13.
MOV R3, #0
STR R3, [SP]
10
LDRB R0, [R1, R3]
ADD R3, R3, #1
CMP R0, #32
BCS %BT10
ADD R3, R3, #2
MOV R0, #ModHandReason_Claim
BL XROS_Module
BVS %FT90 ; Give up if no memory
MOV R0, #WimpExtend_SpriteSuffix
SWI XWimp_Extend
BVS %FT30
; Copy result to original buffer
MOV R3, #0
20
LDRB R0, [R2, R3]
STRB R0, [R1, R3]
CMP R0, #32
ADD R3, R3, #1
BCS %BT20
30
MOV R0, #ModHandReason_Free
BL XROS_Module
90
MOV R0, R1
CLRV
B ExitWimp
extendjumptable
B getspriteaddr
[ CnP
......@@ -803,7 +879,9 @@ furnblock_hscr # 4
furnblock_left # 4
furnblock_hscrgap0 # 4
11
extend_getborderinfo ROUT
; In: R1 = pointer to block to fill with furniture dimensions
; [R1,#0] = window handle to use, or 0 for generic values
CMP userblk, #ApplicationStart
MyXError WimpBadPtrInR1, LO, L
BVS ExitWimp ; check pointer valid in this case
......
......@@ -4233,10 +4233,6 @@ getromsprites
TEQEQ R6,#3
MOVEQ R0,#0
STREQB R0,alphaspriteflag ; Completely ignore alpha sprites in mode 23
LDRNEB R0,alphaspriteflag
CMP R0,#255 ; If alpha sprites supported
CMPEQ R5,R6 ; And square pixel mode
MOVEQ R5,#'A'-'0' ; Look for alpha version
]
ADD R14,R5,R6,LSL #8
......@@ -5388,6 +5384,7 @@ SWIWimp_ReadSysInfo
B sysinfo_iconbar ; 26= iconbar speed and acceleration
B err_badR0 ; 27= screen edge notification (ROL)
B sysinfo_3Dpatch ; 28= visual flags
B sysinfo_alphasprites ; 29= alpha sprites
err_badR0
MyXError WimpBadSysInfo
......@@ -5544,6 +5541,19 @@ sysinfo_pausedelay
B err_badR0
]
sysinfo_alphasprites
; Bit 0: Alpha-masked sprites supported by OS/Wimp and will be looked
; for by IconSprites, Wimp_Extend 13, etc.
; Bits 1-31: reserved
[ SpritesA
LDRB R0, alphaspriteflag
ANDS R0, R0, #255
MOVNE R0, #1
|
MOV R0, #0
]
B ExitWimp
;;-----------------------------------------------------------------------------
;; Command Window handling
;;-----------------------------------------------------------------------------
......
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