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

Introduce definitions of the 16 standard Wimp colours

Substitute magic numbers through the code.
Squash some UAL warnings from missing #'s in Wimp10.s

Version 5.27. Tagged as 'Wimp-5_27'
parent 46989188
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.26"
Module_Version SETA 526
Module_MajorVersion SETS "5.27"
Module_Version SETA 527
Module_MinorVersion SETS ""
Module_Date SETS "09 May 2013"
Module_ApplicationDate SETS "09-May-13"
Module_Date SETS "11 May 2013"
Module_ApplicationDate SETS "11-May-13"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.26"
Module_HelpVersion SETS "5.26 (09 May 2013)"
Module_FullVersion SETS "5.27"
Module_HelpVersion SETS "5.27 (11 May 2013)"
END
/* (5.26)
/* (5.27)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.26
#define Module_MajorVersion_CMHG 5.27
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 May 2013
#define Module_Date_CMHG 11 May 2013
#define Module_MajorVersion "5.26"
#define Module_Version 526
#define Module_MajorVersion "5.27"
#define Module_Version 527
#define Module_MinorVersion ""
#define Module_Date "09 May 2013"
#define Module_Date "11 May 2013"
#define Module_ApplicationDate "09-May-13"
#define Module_ApplicationDate "11-May-13"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.26"
#define Module_HelpVersion "5.26 (09 May 2013)"
#define Module_LibraryVersionInfo "5:26"
#define Module_FullVersion "5.27"
#define Module_HelpVersion "5.27 (11 May 2013)"
#define Module_LibraryVersionInfo "5:27"
......@@ -111,6 +111,25 @@ w_title # 12 ; title (max 11 chars, then <CR)
w_nicons # 4 ; no. of icons following
w_icons # 0
; standard colour numbers
sc_white * &0
sc_verylightgrey * &1
sc_lightgrey * &2
sc_midlightgrey * &3
sc_middarkgrey * &4
sc_darkgrey * &5
sc_verydarkgrey * &6
sc_black * &7
sc_darkblue * &8
sc_yellow * &9
sc_lightgreen * &A
sc_red * &B
sc_cream * &C
sc_darkgreen * &D
sc_orange * &E
sc_lightblue * &F
; bit masks for flags/status
wf_title * 1 :SHL: 0
......
......@@ -50,7 +50,7 @@ plotspritebackground
MOV PC,R1
Pull "R0-R5,PC"
2
TEQ R0,#1 ; colour 1
TEQ R0,#sc_verylightgrey ; colour 1
SWINE XOS_WriteI+16 ; just clear the area
Pull "R0-R5,PC",NE
......
......@@ -1013,6 +1013,7 @@ baseoflosprites # 4 ; base of low priority common sprite poo
baseofhisprites # 4 ; base of high priority common sprite pool
]
baseofsprites # 4 ; base of common sprite pool (in RAM)
baseofromsprites # 4 ; base of ROM sprite pool (in Resources:)
oldCAOpointer # 4 ; used in OS_ChangeDynamicArea
handlerword # 4 ; flag word ==> has handler changed?
......@@ -1223,8 +1224,6 @@ userfreeptr # 4
userfreeend # 4
userfontcounts # 4
baseofromsprites # 4 ; base of ROM sprite pool (in Resources:)
PollTaskPtr # 4 ; -> last entry in PollTaskList
[ NKmessages1
......@@ -1325,6 +1324,7 @@ tool_area # 4 ; -> sprite area owned by tool managing
tool_areaCB # SpriteAreaCBsize
tool_list # 4 ; -> list of sprites in area / =0 if not valid yet
tool_list_backup # 4 ; backup copy of tool_list
; tool plotting information
......@@ -1536,7 +1536,6 @@ errordynamic * errorbuffer+4 ; put these after stashed PC
errordynamicsize * ?errorbuffer-4
stackspace # 0 ; temporary stack for debugging!
tool_list_backup # 4 ; backup copy of tool_list
copyerror # 240 ; copy of error block
greys_mode # 1 ; last grey mode.
last_greys # 1 ; previous greys mode
......@@ -1779,6 +1778,42 @@ w_size # 0 ; end of window data
! 0, "Selection data = handle+&" :CC: :STR: :INDEX: w_seldata
]
; standard colour numbers
sc_white * &0
sc_verylightgrey * &1
sc_lightgrey * &2
sc_midlightgrey * &3
sc_middarkgrey * &4
sc_darkgrey * &5
sc_verydarkgrey * &6
sc_black * &7
sc_darkblue * &8
sc_yellow * &9
sc_lightgreen * &A
sc_red * &B
sc_cream * &C
sc_darkgreen * &D
sc_orange * &E
sc_lightblue * &F
rgb_white * &FFFFFF00
rgb_verylightgrey * &DDDDDD00 ; Unused
rgb_lightgrey * &BBBBBB00
rgb_midlightgrey * &99999900
rgb_middarkgrey * &77777700
rgb_darkgrey * &55555500 ; Unused
rgb_verydarkgrey * &33333300 ; Unused
rgb_black * &00000000
rgb_darkblue * &99440000 ; Unused
rgb_yellow * &00EEEE00 ; Unused
rgb_lightgreen * &00CC0000 ; Unused
rgb_red * &0000DD00 ; Unused
rgb_cream * &BBEEEE00 ; Unused
rgb_darkgreen * &00885500 ; Unused
rgb_orange * &00BBFF00 ; Unused
rgb_lightblue * &FFBB0000 ; Unused
; bit masks for flags/status
wf_title * 2_00000000000000000000000000000001
......@@ -3596,14 +3631,14 @@ gotwork
; set up the 3dpatch configuration
MOV R0,#ThreeDFlags_Default
STR R0,ThreeDFlags
LDR R0,=&FFFFFF00
LDR R0,=rgb_white
STR R0,truemenuborderfacecolour
STR R0,truewindowborderfacecolour
LDR R0,=&99999900
LDR R0,=rgb_midlightgrey
STR r0,truemenuborderoppcolour
LDR R0,=&77777700
LDR R0,=rgb_middarkgrey
STR r0,truewindowborderoppcolour
MOV R0,#&00000000
LDR R0,=rgb_black
STR r0,truewindowoutlinecolour
[ true
MOV R0,#arrowIconWidth_No3D
......@@ -7275,27 +7310,27 @@ WimpVisualFlags_Code
LDR r1,[sp,#28] ; window border face colour
BL %FT02
LDRNE r0,=&FFFFFF00
LDRNE r0,=rgb_white
STR r0,truewindowborderfacecolour
LDR r1,[sp,#32] ; window border opposite colour
BL %FT02
LDRNE r0,=&77777700
LDRNE r0,=rgb_middarkgrey
STR r0,truewindowborderoppcolour
LDR r1,[sp,#36] ; menu border face colour
BL %FT02
LDRNE r0,=&FFFFFF00
LDRNE r0,=rgb_white
STR r0,truemenuborderfacecolour
LDR r1,[sp,#40] ; menu border opposite colour
BL %FT02
LDRNE r0,=&99999900
LDRNE r0,=rgb_midlightgrey
STR r0,truemenuborderoppcolour
LDR r1,[sp,#52] ; window outline colour
BL %FT02
LDRNE r0,=&00000000
LDRNE r0,=rgb_black
STR r0,truewindowoutlinecolour
LDR r1,[sp,#24] ; all
......@@ -7320,7 +7355,7 @@ WimpVisualFlags_Code
Pull "pc"
03 LDRB r0,[r1],#1
TEQ r0,#0
TEQ r0,#0 ; type = integer
Pull "pc",NE
LDRB lr,[r1,#2]
......
......@@ -3455,8 +3455,8 @@ settruefontcolours
]
defaultfontcolours
MOV R1,#0 ; background colour
MOV R2,#7 ; foreground colour
MOV R1,#sc_white ; background colour
MOV R2,#sc_black ; foreground colour
; convert the logical to physical colours and then call ColourTrans to perform the conversion
; and set the Font Manager
......@@ -8097,7 +8097,7 @@ redrawoutlp
[ TrueIcon3
LDR R0, truetitlefg
|
MOV R0,#7 ; set black border in case toolsprites need it...
MOV R0,#sc_black ; set black border in case toolsprites need it...
]
BL window_fg
B no_thin_border
......@@ -8113,7 +8113,7 @@ have_thin_border
[ TrueIcon3
LDR R0, truetitlefg ; set title foreground colour
CMP R0, #0 ; is foreground colour black?
CMP R0, #rgb_black ; is foreground colour black?
LDREQ R0, truewindowoutlinecolour ; if so, get window outline colour
|
LDRB R0,[handle,#w_tfcol] ; set title foreground colour
......@@ -8168,7 +8168,7 @@ no_thin_border
LDRB R1,titlecolour
LDRB R2,[handle,#w_tfcol]
TEQ R2,#&FF
MOVEQ R2,#7 ; title text colour if 'no border' colour set must be black
MOVEQ R2,#sc_black ; title text colour if 'no border' colour set must be black
CMP R2,#&100 ; set NE again
01
|
......@@ -8220,10 +8220,10 @@ redrawoutlp_done_tracing
[ TrueIcon3
LDR R14, titlecolour
LDR R0, =&BBBBBB00 ; 73% grey (colour 2)
LDR R0, =rgb_lightgrey
TEQ R0, R14
LDREQ R14, truetitlefg
TEQEQ R14, #0 ; unless both colours are standard,
TEQEQ R14, #rgb_black ; unless both colours are standard,
LDRNEB R0, tinted_enable ; turn on tinting for this window
STRNEB R0, tinted_window
......@@ -8813,7 +8813,7 @@ drawwindowoutline
[ TrueIcon3
LDR R0, truetitlefg
|
MOV R0,#7 ; set black border in case toolsprites need it...
MOV R0,#sc_black ; set black border in case toolsprites need it...
]
BL window_fg
B no_thin_outline
......@@ -8829,7 +8829,7 @@ have_thin_outline
[ TrueIcon3
LDR R0, truetitlefg ; set title foreground colour
CMP R0, #0 ; is foreground colour black?
CMP R0, #rgb_black ; is foreground colour black?
LDREQ R0, truewindowoutlinecolour ; if so, get window outline colour
|
LDRB R0,[handle,#w_tfcol] ; set title foreground colour
......@@ -9900,7 +9900,7 @@ noclrwbg
BL window_fg
LDRB R0,[handle,#w_wbcol]
CMP R0,#&FF ; important to clear V
MOVEQ R0,#0 ; set up a sensible colour just in case
MOVEQ R0,#sc_white ; set up a sensible colour just in case
BL window_bg
]
;
......
......@@ -250,7 +250,7 @@ setwindowcolours ROUT
BNE %FT10
LDRB R3, [handle, #w_tfcol]
TEQ R3, #&FF ; special flag value?
MOVEQ R3, #7 ; default to Wimp black
MOVEQ R3, #sc_black ; default to Wimp black
ANDNE R3, R3, #&F
LDR R3, [R14, R3, LSL #2] ; look up palette entry
STR R3, truetitlefg
......@@ -274,7 +274,7 @@ setwindowcolours ROUT
BNE %FT11
LDRB R3, [handle, #w_wbcol]
TEQ R3, #&FF ; special flag value?
MOVEQ R3, #0 ; default to Wimp white (yes, that's what the old Wimp did too...)
MOVEQ R3, #sc_white ; default to Wimp white (yes, that's what the old Wimp did too...)
ANDNE R3, R3, #&F
LDR R3, [R14, R3, LSL #2] ; look up palette entry
STR R3, trueworkbg
......@@ -350,9 +350,9 @@ int_seticonptrs ROUT
TST R1,#if_fancyfont
;If system font, use colours in flags
MOVEQ R14,R1
;If scalable font, use (0, 7). This might be changed later, if
;If scalable font, use white & black. This might be changed later, if
; there's an F in the validation string.
MOVNE R14,#(0:SHL:ib_bcol):OR:(7:SHL:ib_fcol)
MOVNE R14,#(sc_white:SHL:ib_bcol):OR:(sc_black:SHL:ib_fcol)
ASSERT ib_bcol > ib_fcol
MOV R3,R14,LSR #ib_bcol
STRB R3,fontbackground
......@@ -835,13 +835,13 @@ mungetruecolours ROUT
BNE %FT01
LDR R0, border_type
TEQ R0, #border_defaultaction
LDREQ R0, [R14, #12 :SHL: 2] ; default = Wimp cream (default action)
LDRNE R0, [R14, #1 :SHL: 2] ; default = Wimp grey 1 (editable)
LDREQ R0, [R14, #sc_cream :SHL: 2] ; default = Wimp cream (default action)
LDRNE R0, [R14, #sc_verylightgrey :SHL: 2] ; default = Wimp grey 1 (editable)
STR R0, truewellcolour
01
LDR R0, truefacecolour
CMP R0, #-1
LDREQ R0, [R14, #0 :SHL: 2] ; default = Wimp white
LDREQ R0, [R14, #sc_white :SHL: 2] ; default = Wimp white
STREQ R0, truefacecolour
LDR R0, trueoppcolour
......@@ -850,8 +850,8 @@ mungetruecolours ROUT
LDR R0, border_type
TEQ R0, #border_ridge
TEQNE R0, #border_channel
LDREQ R0, [R14, #2 :SHL: 2] ; default = Wimp grey 2 (shallow)
LDRNE R0, [R14, #4 :SHL: 2] ; default = Wimp grey 4 (normal)
LDREQ R0, [R14, #sc_lightgrey :SHL: 2] ; default = Wimp grey 2 (shallow)
LDRNE R0, [R14, #sc_middarkgrey :SHL: 2] ; default = Wimp grey 4 (normal)
STR R0, trueoppcolour
01
TST R1, #is_inverted
......@@ -978,7 +978,7 @@ fadetruecolour ROUT
MOV R1,#150
MLA R14,R2,R1,R14 ; red *77 + green *150
RSB R3,R3,R3,LSL #3
ADD R14,R14,R3,LSL #2 ; red *77 + green *150 + green *28
ADD R14,R14,R3,LSL #2 ; red *77 + green *150 + blue *28
ADD R14,R14,#&7F ; Rounding
ADD R14,R14,R14,LSL #8 ; Make 16 bit fractional
......
......@@ -299,7 +299,7 @@ plotcaret ROUT
Push "R0-R3,R5,LR"
TST R1,#crf_usercolour
MOVEQ R0,#11 ; default caret colour
MOVEQ R0,#sc_red ; default caret colour
MOVNE R0,R1,LSR #crb_colourshift
ANDNE R0,R0,#&FF
......@@ -3773,7 +3773,7 @@ crmenuiconlp
]
LDR R14,[userblk] ; flags of middle icon
TST R14,#if_fancyfont
MOVNE R2,#(0:SHL:ib_bcol):OR:(7:SHL:ib_fcol)
MOVNE R2,#(sc_white:SHL:ib_bcol):OR:(sc_black:SHL:ib_fcol)
ANDEQ R2,R14,#if_fcol:OR:if_bcol
AND R14,R14,#is_shaded
ORR R14,R14,R2
......@@ -3794,7 +3794,7 @@ crmenuiconlp
Debug menuparam,"menu icon flags,data",R1,R2,R3,R4
[ NCMenus
ORR r1, r1, #2:SHL:ib_bcol
ORR r1, r1, #sc_lightgrey:SHL:ib_bcol
ORR r1, r1, #if_filled
|
TST R1,#if_filled ; if not filled,
......@@ -3873,7 +3873,7 @@ crmenuiconlp
TST r1,#if_sprite
LDREQ r14,MenuIsColourMenu
TEQEQ r14,#0
ORREQ r1,r1,#7 :SHL: ib_bcol ; if the icon doesn't have a sprite then set the bg col to black
ORREQ r1,r1,#sc_black :SHL: ib_bcol ; if the icon doesn't have a sprite then set the bg col to black
90
]
; BIC R1,R1,#if_buttontype
......
......@@ -144,7 +144,7 @@ plot_editable Entry
TST R1,#is_shaded ; Icon disabled?
BNE %FT10 ; Yes then no black border
MOV R0,#black
MOV R0,#sc_black
BL int_setcolour ; then a rectangle that is in black
BL hollowrectangle
10
......@@ -396,29 +396,17 @@ ct_grey DCD :INDEX: truewellcolour, :INDEX: truewellcolour, :INDEX:
|
white * 0
lightgrey * 1
grey * 2
midgrey * 4
darkgrey * 5
darkergrey * 6
black * 7
red * 11
cream * 12
orange * 14
[ NCErrorBox
ct_in = darkgrey, darkgrey, darkergrey, darkergrey
ct_out = darkergrey, darkergrey, darkgrey, darkgrey
|
ct_in = white, white, midgrey, midgrey
ct_out = midgrey, midgrey, white, white
]
ct_inshallow = white, white, grey, grey
ct_outshallow = grey, grey, white, white
ct_cream = cream, cream, cream, cream
ct_grey = lightgrey, lightgrey, lightgrey, lightgrey
[ NCErrorBox
ct_in = sc_darkgrey, sc_darkgrey, sc_verydarkgrey, sc_verydarkgrey
ct_out = sc_verydarkgrey, sc_verydarkgrey, sc_darkgrey, sc_darkgrey
|
ct_in = sc_white, sc_white, sc_middarkgrey, sc_middarkgrey
ct_out = sc_middarkgrey, sc_middarkgrey, sc_white, sc_white
]
ct_inshallow = sc_white, sc_white, sc_lightgrey, sc_lightgrey
ct_outshallow = sc_lightgrey, sc_lightgrey, sc_white, sc_white
ct_cream = sc_cream, sc_cream, sc_cream, sc_cream
ct_grey = sc_verylightgrey, sc_verylightgrey, sc_verylightgrey, sc_verylightgrey
ALIGN
]
......@@ -890,8 +878,8 @@ cachetoolspriteaddress ; [spritename], [thisCBptr], [lengthflags] as for cachesp
]
;
ASSERT tool_maskop = tool_plotop+4
ASSERT tool_scaling = tool_maskop +4
ASSERT tool_transtable = tool_scaling +4
ASSERT tool_scaling = tool_maskop+4
ASSERT tool_transtable = tool_scaling+4
ASSERT ?tool_scalingblk = 4*4
;
ADRL R14,tool_plotparams
......@@ -2028,13 +2016,13 @@ dofunkytitlebar EntryS "R0-R11"
LDMIA R0,{R0,R5,R6,R7} ; R0,R5-R7 => sprite op information
Push "R10,R11" ; preserve these - they are important
;
LDR R2, [R1,tool_tbarlcap]
LDR R14,[R1,tool_tbarrcap]
ORR R2,R2,R14
LDR R14,[R1,tool_tbarmidb]
ORR R2,R2,R14
LDR R14,[R1,tool_tbarmidt]
LDR R2, [R1,#tool_tbarlcap]
LDR R14,[R1,#tool_tbarrcap]
ORRS R2,R2,R14
LDREQ R14,[R1,#tool_tbarmidb]
ORREQS R2,R2,R14
LDREQ R14,[R1,#tool_tbarmidt]
ORREQS R2,R2,R14
BEQ %FT20 ; none of the sprites exist, reduce flicker by not bothering
;
......@@ -3176,7 +3164,7 @@ cachetoolspritedata
;------------------------------------------------------------------------------
; Routine called to process a palette entry to "tint" a tool sprite
; Maps greys on to title bar foreground-background scale
; White - &bbbbbb00 - Black ---> White - [titlecolour] - [truetitlefg]
; White - rgb_lightgrey - Black ---> White - [titlecolour] - [truetitlefg]
;
; In: R0 = input palette entry
; Out: R0 = modified palette entry
......
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