Commit 84a2570c authored by Robert Sprowson's avatar Robert Sprowson

Only skip ColourTrans calls for 32bpp TBGR

The whizzy new TRGB modes can't assume 32bpp sprite data is equivalent to 32bpp palette entries, so must use ColourTrans.
* Disable the use-in-place optimisation if that's the case
* Update the comments to reflect this logic more clearly
Fix bug in non Medusa case, STRB was using the wrong register as the base address.

Tested briefly with 'Raspberry' theme, unchanged from previous version.

Version 5.48. Tagged as 'Wimp-5_48'
parent 66f1a629
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.47"
Module_Version SETA 547
Module_MajorVersion SETS "5.48"
Module_Version SETA 548
Module_MinorVersion SETS ""
Module_Date SETS "15 Nov 2014"
Module_ApplicationDate SETS "15-Nov-14"
Module_Date SETS "08 Jul 2015"
Module_ApplicationDate SETS "08-Jul-15"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.47"
Module_HelpVersion SETS "5.47 (15 Nov 2014)"
Module_FullVersion SETS "5.48"
Module_HelpVersion SETS "5.48 (08 Jul 2015)"
END
/* (5.47)
/* (5.48)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.47
#define Module_MajorVersion_CMHG 5.48
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 15 Nov 2014
#define Module_Date_CMHG 08 Jul 2015
#define Module_MajorVersion "5.47"
#define Module_Version 547
#define Module_MajorVersion "5.48"
#define Module_Version 548
#define Module_MinorVersion ""
#define Module_Date "15 Nov 2014"
#define Module_Date "08 Jul 2015"
#define Module_ApplicationDate "15-Nov-14"
#define Module_ApplicationDate "08-Jul-15"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.47"
#define Module_HelpVersion "5.47 (15 Nov 2014)"
#define Module_LibraryVersionInfo "5:47"
#define Module_FullVersion "5.48"
#define Module_HelpVersion "5.48 (08 Jul 2015)"
#define Module_LibraryVersionInfo "5:48"
......@@ -1072,18 +1072,23 @@ mastertoactive ROUT
LDR R5,log2bpp ; bpp 0,1,2,3,4,5
CMP R5,#4
MOVCC R7,#256
MOVEQ R7,#512
MOVHI R7,#1024 ; => bytes per table entry
MOVCC R7,#256*1
MOVEQ R7,#256*2
MOVHI R7,#256*4 ; => bytes per table entry
MUL R3,R1,R7 ; => bytes for all the tables present
LDRHI R14,modeflags
ASSERT ModeFlag_DataFormatSub_RGB > 8
ANDHI R14,R14,#ModeFlag_DataFormatSub_RGB
ORRHI R5,R14,R5 ; force table creation for RGB (but not BGR) 32bpp
LDR R2,ttt_activeset_at
TEQ R2,#0
BEQ %FT15 ; none claimed yet
CMP R5,#5
LDRNE R14,ttt_activeset_size
MOVEQ R14,#0 ; 32bpp, no copies needed, force a free
MOVEQ R14,#0 ; 32bpp BGR, no copies needed, force a free
CMP R14,R3
BCS %FT20 ; big enough
10
......@@ -1093,7 +1098,7 @@ mastertoactive ROUT
BL XROS_Module ; too small, free old one
15
CMP R5,#5
BEQ %FT20 ; 32bpp, no copies needed, skip the claim
BEQ %FT20 ; 32bpp BGR, no copies needed, skip the claim
MOV R0,#ModHandReason_Claim
STR R3,ttt_activeset_size
BL XROS_Module
......@@ -1104,16 +1109,16 @@ mastertoactive ROUT
MOV R3,#15 ; for each master table present, generate user table
25
; R1=colour number to convert (0-255)
; R2->base of storage for user tables
; R2->base of storage for active set tables
; R3=wimp colour (0-15)
; R4->table of user pointers
; R4->table of active set pointers
; R5=log2bpp
; R6->table of master pointers
; R7=size of 1 user table in bytes
; R7=size of 1 active set table in bytes
; R8->base of master table for this wimp colour
LDR R8,[R6,R3,LSL #2]
CMP R8,#0 ; master table absent?
CMPNE R5,#5 ; or 32bpp mode?
CMPNE R5,#5 ; or 32bpp BGR mode?
STREQ R8,[R4,R3,LSL #2]
BEQ %FT35
......@@ -1122,12 +1127,13 @@ mastertoactive ROUT
LDR R0,[R8,R1,LSL #2]
MOV R0,R0,ROR #24 ; xBGR->BGRx
SWI XColourTrans_ReturnColourNumber
CMP R5,#4 ; 16bpp is 2B/entry, others are 1
CMP R5,#4 ; 32bpp is 4B/entry, 16bpp is 2B/entry, others are 1
STRCCB R0,[R2,R1]
ADDEQ R14,R2,R1,LSL #1
STREQB R0,[R14,#0]
MOVEQ R0,R0,LSR #8
STREQB R0,[R14,#1]
STRHI R0,[R2,R1,LSL #2]
SUBS R1,R1,#1
BPL %BT30
......@@ -1180,9 +1186,9 @@ colourmatchtool
[ Medusa
LDR R1,log2bpp ; bpp 0,1,2,3,4,5
CMP R1,#4
MOVCC R1,#256
MOVEQ R1,#512
MOVHI R1,#1024 ; => bytes per table entry
MOVCC R1,#256*1
MOVEQ R1,#256*2
MOVHI R1,#256*4 ; => bytes per table entry
|
MOV R1,#256
]
......@@ -1233,7 +1239,7 @@ colourmatchtool
STREQB R0,[R14,#1]
STRHI R0,[R2,R1,LSL #2]
|
STRB R0,[R1,R1] ; No wide translation tables
STRB R0,[R2,R1] ; No wide translation tables
]
SUBS R1,R1,#1
BPL %BT30
......
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