Commit adbd854d authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix PreCreateHeader to allow palettes for <=256 colour RISC OS 5 sprites. LoadCoordPair tweaks.

Detail:
  s/vdu/vdudecl - Add a couple more optimisations to LoadCoordPair - use SXTH where possible, and use LDRSH if data is halfword aligned (not currently the case, but may be in future)
  s/vdu/vdugrafj - Fix PreCreateHeader to allow <=256 colour RISC OS 5 sprites to have palettes
Admin:
  Tested on Pandaboard


Version 5.35, 4.79.2.238. Tagged as 'Kernel-5_35-4_79_2_238'
parent 711c4b83
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.237"
Module_Date SETS "16 Sep 2014"
Module_ApplicationDate SETS "16-Sep-14"
Module_MinorVersion SETS "4.79.2.238"
Module_Date SETS "18 Sep 2014"
Module_ApplicationDate SETS "18-Sep-14"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.237)"
Module_HelpVersion SETS "5.35 (16 Sep 2014) 4.79.2.237"
Module_FullVersion SETS "5.35 (4.79.2.238)"
Module_HelpVersion SETS "5.35 (18 Sep 2014) 4.79.2.238"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.237
#define Module_Date_CMHG 16 Sep 2014
#define Module_MinorVersion_CMHG 4.79.2.238
#define Module_Date_CMHG 18 Sep 2014
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.237"
#define Module_Date "16 Sep 2014"
#define Module_MinorVersion "4.79.2.238"
#define Module_Date "18 Sep 2014"
#define Module_ApplicationDate "16-Sep-14"
#define Module_ApplicationDate "18-Sep-14"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.237)"
#define Module_HelpVersion "5.35 (16 Sep 2014) 4.79.2.237"
#define Module_FullVersion "5.35 (4.79.2.238)"
#define Module_HelpVersion "5.35 (18 Sep 2014) 4.79.2.238"
#define Module_LibraryVersionInfo "5:35"
......@@ -201,14 +201,19 @@ GVDriverState_Started * 1:SHL:0 ; ScreenMode_StartDriver called
MACRO
LoadCoordPair $x, $y, $basereg, $offset
[ NoARMv4 :LOR: (($offset :AND: 1)=1)
[ NoARMv6 :LOR: NoUnaligned
ASSERT $x < $y
[ ($offset) :AND: 3 = 2
ADD $x, $basereg, #($offset)-2
LDMIA $x, {$x, $y} ; (Xh,Xl,??,??) (??,??,Yh,Yl)
MOV $x, $x, ASR #16 ; (Xs,Xs,Xh,Xl)
MOV $y, $y, LSL #16 ; (Yh,Yl, 0, 0)
MOV $y, $y, ASR #16 ; (Ys,Ys,Yh,Yl)
[ NoARMv6
MOV $y, $y, LSL #16 ; (Yh,Yl, 0, 0)
MOV $y, $y, ASR #16 ; (Ys,Ys,Yh,Yl)
|
SXTH $y, $y ; (Ys,Ys,Yh,Yl)
]
|
[ ($offset) :AND: 3 = 0
LDR $x, [$basereg, #$offset] ; (Yh,Yl,Xh,Xl)
......@@ -226,14 +231,23 @@ GVDriverState_Started * 1:SHL:0 ; ScreenMode_StartDriver called
]
]
MOV $y, $x, ASR #16 ; (Ys,Ys,Yh,Yl)
MOV $x, $x, LSL #16 ; (Xh,Xl, 0, 0)
MOV $x, $x, ASR #16 ; (Xs,Xs,Xh,Xl)
[ NoARMv6
MOV $x, $x, LSL #16 ; (Xh,Xl, 0, 0)
MOV $x, $x, ASR #16 ; (Xs,Xs,Xh,Xl)
|
SXTH $x, $x ; (Xs,Xs,Xh,Xl)
]
]
|
; Use unaligned loads from ARMv6
LDRSH $x, [$basereg, #$offset]
LDRSH $y, [$basereg, #($offset)+2]
]
|
; Aligned halfwords
LDRSH $x, [$basereg, #$offset]
LDRSH $y, [$basereg, #($offset)+2]
]
MEND
;
......
......@@ -781,10 +781,13 @@ PreCreateHeader ROUT
; MOVS LR, LR, LSR #27 ; set NE if new
; MOVNE R3, #0 ; turn off palette
LDR LR, [WsPtr, #SGetMode] ; get the sprite mode word
MOV LR, LR, LSR #27 ; isolate the sprite type
CMP LR, #SpriteType_New16bpp ; check for 16/32bpp
MOVCS R3, #0 ; turn off the palette request
LDR LR, [WsPtr, #SGetMode] ; get the sprite mode word
BIC LR, LR, #&80000000 ; ignore alpha mask flag
CMP LR, #SpriteType_RISCOS5<<27
MOVLO LR, LR, LSR #7 ; shift sprite type to its RISC OS 5 location
ANDHS LR, LR, #127<<20 ; or get RISC OS 5 type as-is
CMP LR, #SpriteType_New16bpp<<20 ; check for true colour
MOVHS R3, #0 ; turn off the palette request
TEQ R3, #0 ; convert R3 into mask to (ex/in)clude
MOVNE R3, #&FF ; space for palette data
......
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