Commit 3c17f6fb authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Bug fix to the colour popup menu.The "this is how many bpp I'm looking to...

Bug fix to the colour popup menu.The "this is how many bpp I'm looking to ungrey" value only got incremented when a successful mode match was made so you could never get greyed entries at the start of a menu - that would just lead to a completely grey menu.

This now evaluates all modes into a bit mask,then ungreys selected
entries as required.
Now also forces a redraw of its iconbar icon when the MDF is changed so
that the display manager icon can look like the monitor the MDF describes.

Version 0.38. Tagged as 'Display-0_38'
parent b57122ef
......@@ -26,7 +26,11 @@ COMPONENT = DisplayManager
TARGET = Display
ROM_SOURCE = GetAll.s
RESOURCEEXTRA = resources_templates
#RESOURCEEXTRA = resources_templates
RESOURCEEXTRA = resources_templrate
resources_templrate ::
${CP} LocalRes:TemplRate ${RESFSDIR}.Templates ${CPFLAGS}
include StdTools
include AAsmModule
......
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.68.
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
GBLS Module_ApplicationDate2
GBLS Module_ApplicationDate4
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.37"
Module_Version SETA 37
Module_MajorVersion SETS "0.38"
Module_Version SETA 38
Module_MinorVersion SETS ""
Module_Date SETS "23 Mar 2001"
Module_ApplicationDate2 SETS "23-Mar-01"
Module_ApplicationDate4 SETS "23-Mar-2001"
Module_Date SETS "03 Feb 2003"
Module_ApplicationDate SETS "03-Feb-03"
Module_ComponentName SETS "Display"
Module_ComponentPath SETS "RiscOS/Sources/Video/UserI/Display"
Module_FullVersion SETS "0.37"
Module_HelpVersion SETS "0.37 (23 Mar 2001)"
Module_FullVersion SETS "0.38"
Module_HelpVersion SETS "0.38 (03 Feb 2003)"
END
/* (0.37)
/* (0.38)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 0.37
#define Module_MajorVersion_CMHG 0.38
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 23 Mar 2001
#define Module_Date_CMHG 03 Feb 2003
#define Module_MajorVersion "0.37"
#define Module_Version 37
#define Module_MajorVersion "0.38"
#define Module_Version 38
#define Module_MinorVersion ""
#define Module_Date "23 Mar 2001"
#define Module_Date "03 Feb 2003"
#define Module_ApplicationDate2 "23-Mar-01"
#define Module_ApplicationDate4 "23-Mar-2001"
#define Module_ApplicationDate "03-Feb-03"
#define Module_ComponentName "Display"
#define Module_ComponentPath "RiscOS/Sources/Video/UserI/Display"
#define Module_FullVersion "0.37"
#define Module_HelpVersion "0.37 (23 Mar 2001)"
#define Module_FullVersion "0.38"
#define Module_HelpVersion "0.38 (03 Feb 2003)"
#define Module_LibraryVersionInfo "0:38"
......@@ -103,13 +103,18 @@ Menu_Init
TEQ r0, #0
EXIT EQ
MOV r4, #0 ; r4 = depth we are searching for
ADR r5, m_coloursmenu + m_headersize ; r5 -> corresponding menu item
; FOR resolution = 1 TO resolution_count
; FOR mode = 1 TO maxmodeinthisclass
; maskofdepths = maskofdepths OR depth(mode)
; NEXT
; NEXT
MOV r4, #0 ; r4 = bitmask of found modes
MOV r5, #1
LDRB r1, resolution_count ; r1 = number of entries in resolution menu
10
SUBS r1, r1, #1
EXIT CC ; Give up if no more menu resolutions.
BCC %FT40 ; Apply the changes when no more menu resolutions
LDR r2, [r0], #4 ; r2 -> class pointer for current resolution menu item
LDMIA r2, {r2,r3} ; r2 -> this class, r3 -> next class (or = 0)
......@@ -119,29 +124,36 @@ Menu_Init
BEQ %BT10 ; try the next menu resolution.
LDR lr, [lr, #mode_desc_depth]
TEQ lr, r4 ; If depth is not what we are looking for then
BNE %FT30 ; move on to next mode.
LDR lr, [r5, #mi_iconflags] ; Otherwise, unshade menu item for this depth.
BIC lr, lr, #is_shaded
STR lr, [r5, #mi_iconflags]
TEQ r4, #2 ; If this was 4bpp (we've done 16 greys)
TEQNE r4, #3 ; or 8bpp (we've done 256 greys) then
ADDEQ r5, r5, #mi_size ; unshade menu item for colour 16 or colour 256.
LDREQ lr, [r5, #mi_iconflags]
BICEQ lr, lr, #is_shaded
STREQ lr, [r5, #mi_iconflags]
ORR r4, r4, r5, LSL lr ; factor this depth into the mask
TEQ r4, #2_111111
BEQ %FT40 ; all bpps are now available so no point checking any more
ADD r4, r4, #1 ; Move on to next depth
TEQ r4, #6 ; If no more depths to search for then
EXIT EQ ; stop now.
ADD r5, r5, #mi_size ; Move on to next menu item.
30
CMP r2, r3 ; If more modes in this class then
BNE %BT20 ; try them.
B %BT10 ; Try next menu resolution.
40
ADR r5, m_coloursmenu + m_headersize - mi_size ; r5 -> corresponding menu item
MOV r3, #-1
45
TEQ r4, #0
EXIT EQ ; no bpp bits set anyway
ADD r3, r3, #1 ; the bitdepth in natural numbers
ADD r5, r5, #mi_size
MOVS r4, r4, LSR#1
LDRCS lr, [r5, #mi_iconflags] ; Otherwise, unshade menu item for this depth.
BICCS lr, lr, #is_shaded
STRCS lr, [r5, #mi_iconflags]
TEQ r3, #2 ; If this was 4bpp (we've done 16 greys)
TEQNE r3, #3 ; or 8bpp (we've done 256 greys) then
ADDEQ r5, r5, #mi_size ; unshade menu item for colour 16 or colour 256.
LDRCS lr, [r5, #mi_iconflags]
BICCS lr, lr, #is_shaded
STRCS lr, [r5, #mi_iconflags]
B %BT45
|
LDR r0, mode_sortedlist
TEQ r0, #0
......
......@@ -371,12 +371,26 @@ svc_modechange
svc_modefilechanged
Entry "r0"
Entry "r0-r4"
Debug mod,"svc_modefilechanged"
LDR lr, task_handle ; Make sure we are a task.
TEQ lr, #0
EXIT EQ
BL Menu_Init ; Build menus.
SUB r13, r13, #40
MOV r1, #iconbar_whandle ; refresh iconbar icon (incase the 'display' sprite was changed)
STR r1, [r13, #0]
LDR r1, icon_handle
STR r1, [r13, #4]
MOV r1, r13
SWI XWimp_GetIconState
ADDVC r0, r1, #8
LDMVCIA r0, {r1-r4}
MOVVC r0, #iconbar_whandle
SWIVC XWimp_ForceRedraw
ADD r13, r13, #40
LDR lr, pollword
ORR lr, lr, #pf_modeinit :OR: pf_refreshicons :OR: pf_settitle
STR lr, pollword
......
......@@ -136,8 +136,16 @@ patch_info_version
Version_tag DCB "Version",0
|
10 LDRB lr, [r1], #1
STRB lr, [r2], #1
TEQ lr, #0
SUBNES r3, r3, #1
BNE %BT10
MOV lr, #0
STRB lr, [r2, #-1]
EXIT
Version_tag DCB "$Module_MajorVersion ($Module_ApplicationDate2)", 0
Version_tag DCB "$Module_MajorVersion ($Module_ApplicationDate)", 0
]
ALIGN
......
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