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

Add support for new screen modes: 4K/64K colour modes and RGB/alpha variants

Detail:
  Resources/UK/Messages, Resources/Germany/Messages - Add entries M19 and M20 for 4K & 64K colour modes
  s/Front - Adjust workspace for the two new menu entries. Add definition for the new mode provider block format (referred to as mode descriptor blocks in the sources)
  s/GetAll - Get Hdr:GraphicsV as the new mode provider block uses the GVPixelFormat structure. Strip out NewShading option; now hard-coded to be true. Add new Allow24bpp option for control over whether we allow 24bpp modes to be used.
  s/Menu, s/Message, s/Mode - Lots of changes to add support for the new menu entries and handling of the new mode provider block format/pixel formats. Strip out old mode specifier -> string conversion code and instead just rely on OS_ScreenMode 14.
Admin:
  Tested in Tungsten, IOMD, OMAP3 & BCM2835 ROMs
  Requires HdrSrc-2_38 and Kernel-5_35-4_79_2_203
  New German messages are in need of translation


Version 0.41. Tagged as 'Display-0_41'
parent f17c069f
No preview for this file type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.40"
Module_Version SETA 40
Module_MajorVersion SETS "0.41"
Module_Version SETA 41
Module_MinorVersion SETS ""
Module_Date SETS "13 May 2009"
Module_ApplicationDate SETS "13-May-09"
Module_Date SETS "15 Dec 2013"
Module_ApplicationDate SETS "15-Dec-13"
Module_ComponentName SETS "Display"
Module_ComponentPath SETS "castle/RiscOS/Sources/Video/UserI/Display"
Module_FullVersion SETS "0.40"
Module_HelpVersion SETS "0.40 (13 May 2009)"
Module_FullVersion SETS "0.41"
Module_HelpVersion SETS "0.41 (15 Dec 2013)"
END
/* (0.40)
/* (0.41)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.40
#define Module_MajorVersion_CMHG 0.41
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 May 2009
#define Module_Date_CMHG 15 Dec 2013
#define Module_MajorVersion "0.40"
#define Module_Version 40
#define Module_MajorVersion "0.41"
#define Module_Version 41
#define Module_MinorVersion ""
#define Module_Date "13 May 2009"
#define Module_Date "15 Dec 2013"
#define Module_ApplicationDate "13-May-09"
#define Module_ApplicationDate "15-Dec-13"
#define Module_ComponentName "Display"
#define Module_ComponentPath "castle/RiscOS/Sources/Video/UserI/Display"
#define Module_FullVersion "0.40"
#define Module_HelpVersion "0.40 (13 May 2009)"
#define Module_LibraryVersionInfo "0:40"
#define Module_FullVersion "0.41"
#define Module_HelpVersion "0.41 (15 Dec 2013)"
#define Module_LibraryVersionInfo "0:41"
......@@ -90,7 +90,7 @@ ram_menustart # 0
m_iconbarmenu # m_headersize + mi_size * 2
mm_info * m_iconbarmenu + m_headersize + mi_submenu + mi_size * 0
mm_mode * m_iconbarmenu + m_headersize + mi_submenu + mi_size * 1
m_coloursmenu # m_headersize + mi_size * 8
m_coloursmenu # m_headersize + mi_size * 10
ram_menuend # 0
max_running_work * :INDEX:@
......@@ -109,15 +109,26 @@ f_greylevel * 2_00000001 ; Current mode is grey level.
f_messagesopen * 2_00000010 ; Messages file is open.
f_ratemenuvalid * 2_00000100 ; Rate menu is valid.
; Mode descriptor.
; Mode descriptor header
^ 0
mode_desc_size # 4
mode_desc_flags # 4
mode_desc_xres # 4
mode_desc_yres # 4
mode_desc_depth # 4
mode_desc_rate # 4
mode_desc_name # 0 ; Null terminated, word aligned string.
; Mode descriptor (format 0)
^ mode_desc_flags+4
mode_desc0_xres # 4
mode_desc0_yres # 4
mode_desc0_depth # 4
mode_desc0_rate # 4
mode_desc0_name # 0 ; Null terminated, word aligned string.
; Mode descriptor (format 1)
^ mode_desc_flags+4
mode_desc1_xres # 4
mode_desc1_yres # 4
mode_desc1_format # GVPixelFormat_Size
mode_desc1_rate # 4
mode_desc1_name # 0 ; Null terminated, word aligned string.
; Mode specifier.
^ 0
......
......@@ -40,6 +40,7 @@
GET Hdr:NewErrors
GET Hdr:ScrModes
GET Hdr:ColourTran
GET Hdr:GraphicsV
GET VersionASM
......@@ -75,12 +76,11 @@ LoadModeFiles SETL true
GBLL SortOnPixelShape
SortOnPixelShape SETL true
GBLL NewShading
NewShading SETL true
GBLL MessageChanging
MessageChanging SETL false
GBLL Allow24bpp ; Allow packed 24bpp modes?
Allow24bpp SETL false
;---------------------------------------------------------------------------
; Get the sources.
......
......@@ -27,11 +27,13 @@ mo_co_grey16 Item M13,,S
mo_co_colour16 Item M14,,S
mo_co_grey256 Item M15,,S
mo_co_colour256 Item M16,,S
mo_co_4K Item M19,,S
mo_co_32K Item M17,,S
mo_co_64K Item M20,,S
mo_co_16M Item M18,,S
DCB 0 ; Terminator.
ALIGN
colours_count * 8
colours_count * 10
rom_resolutionmenu
DCB "T02",0 ; Title.
......@@ -69,11 +71,7 @@ menu_rateflags
; Make menus for icon bar and display window.
;
Menu_Init
[ NewShading
Entry "r1-r5"
|
Entry "r1-r3"
]
Entry "r1-r8"
Debug menu,"Menu_Init"
......@@ -98,9 +96,8 @@ Menu_Init
EXIT VS
; All colour menu items are shaded so unshade the ones which are available.
[ NewShading
LDR r0, mode_menulist ; r0 -> mode_menulist entry
TEQ r0, #0
LDR r4, mode_menulist ; r4 -> mode_menulist entry
TEQ r4, #0
EXIT EQ
; FOR resolution = 1 TO resolution_count
......@@ -109,23 +106,26 @@ Menu_Init
; NEXT
; NEXT
MOV r4, #0 ; r4 = bitmask of found modes
MOV r5, #1
MOV r7, #0 ; r7 = bitmask of found modes
LDRB r1, resolution_count ; r1 = number of entries in resolution menu
LDR r8, =(1:SHL:mo_co_mono)+(1:SHL:mo_co_grey4)+(1:SHL:mo_co_colour16)+(1:SHL:mo_co_colour256)+(1:SHL:mo_co_4K)+(1:SHL:mo_co_32K)+(1:SHL:mo_co_64K)+(1:SHL:mo_co_16M)
10
SUBS r1, r1, #1
BCC %FT40 ; Apply the changes when no more menu resolutions
LDR r2, [r0], #4 ; r2 -> class pointer for current resolution menu item
LDR r2, [r4], #4 ; r2 -> class pointer for current resolution menu item
LDMIA r2, {r2,r3} ; r2 -> this class, r3 -> next class (or = 0)
20
LDR lr, [r2], #4 ; lr -> mode descriptor
TEQ lr, #0 ; If no more modes in this class then
LDR r6, [r2], #4 ; r6 -> mode descriptor
TEQ r6, #0 ; If no more modes in this class then
BEQ %BT10 ; try the next menu resolution.
LDR lr, [lr, #mode_desc_depth]
ORR r4, r4, r5, LSL lr ; factor this depth into the mask
TEQ r4, #2_111111
MOV r0, #0
BL Mode_DescriptorToColourMenuItem
MOV r3, #1
ORR r7, r7, r3, LSL r5
TEQ r7, r8
BEQ %FT40 ; all bpps are now available so no point checking any more
CMP r2, r3 ; If more modes in this class then
......@@ -135,54 +135,21 @@ Menu_Init
40
ADR r5, m_coloursmenu + m_headersize - mi_size ; r5 -> corresponding menu item
MOV r3, #-1
ASSERT mo_co_colour16 = mo_co_grey16+1
ASSERT mo_co_colour256 = mo_co_grey256+1
AND r8, r7, #(1:SHL:mo_co_colour16)+(1:SHL:mo_co_colour256)
ORR r7, r7, r8, LSR #1 ; Make 16/256 grey states reflect 16/256 colour states
45
TEQ r4, #0
TEQ r7, #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
MOVS r7, r7, 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
EXIT EQ
ADRL r2, log2bpp_to_greyitem
ADR r3, m_coloursmenu + m_headersize
10
LDR r1, [r0], #4 ; Get pointer to mode.
TEQ r1, #0
EXIT EQ
LDR r1, [r1, #mode_desc_depth]
LDRB r1, [r2, r1] ; Get menu item corresponding to depth.
ASSERT mi_size=24
MOV lr, r1, LSL #3
ADD lr, lr, lr, LSL #1
ADD lr, r3, lr ; Point to it.
TEQ r1, #mo_co_grey16 ; If grey16 or grey256 then we'll have to do colour items too.
TEQNE r1, #mo_co_grey256
20
LDR r1, [lr, #mi_iconflags]
BIC r1, r1, #is_shaded
STR r1, [lr, #mi_iconflags]
BNE %BT10 ; Not grey so move on to next mode.
ADDS lr, lr, #mi_size ; Otherwise do colour16 or colour256 but don't get into endless loop.
B %BT20
]
;---------------------------------------------------------------------------
; Menu_Resolution
......@@ -238,14 +205,17 @@ Menu_Resolution
10
STR r0, [r9], #4 ; Build list of pointers into mode_classlist in mode_menulist.
LDR lr, [lr] ; Get pointer to mode descriptor.
ADD r5, lr, #mode_desc_name ; Pointer to mode descriptor string.
LDR r5, [lr, #mode_desc_flags]
TST r5, #2
ADDEQ r5, lr, #mode_desc0_name ; Pointer to mode descriptor string.
ADDNE r5, lr, #mode_desc1_name
LDRB r2, [r5]
TEQ r2, #0 ; If mode class has no name then
SUBEQ r9, r9, #4 ; backtrack in mode_menulist
BEQ %FT15 ; and try next class.
[ SortOnPixelShape
LDR r2, [r5, #mode_desc_flags-mode_desc_name]
LDR r2, [lr, #mode_desc_flags]
AND r2, r2, #flags_squarepixel
TEQ r8, #0 ; don't do dotted above first entry
TEQNE r2, r10 ; If different pixel shape then
......@@ -297,7 +267,7 @@ Menu_Rate
BL MsgTrans_OpenFile
ADR r1, rom_ratemenu
ADRL r1, rom_ratemenu
LDR r2, m_ratemenu
TEQ r2, #0
BEQ %FT20
......@@ -305,16 +275,23 @@ Menu_Rate
SWI XMessageTrans_MakeMenus
BVS %FT20
ASSERT mode_desc_yres = mode_desc_xres + 4
ASSERT mode_desc0_yres = mode_desc0_xres + 4
LDR r3, m_ratemenu
ADD r3, r3, #m_headersize ; Point to menu entries.
LDR lr, [r4], #4 ; Get pointer to first mode in subclass.
LDR r5, [lr, #mode_desc_depth] ; Stop when depth changes
ADD r6, lr, #mode_desc_xres
MOV r0, #0
MOV r6, lr
BL Mode_DescriptorToColourMenuItem ; Stop when depth changes
MOV lr, r6
ASSERT mode_desc0_xres = mode_desc1_xres
ADD r6, lr, #mode_desc0_xres
LDMIA r6, {r6,r7} ; or when resolution changes.
MOV r8, #0 ; Count items in rate menu.
10
LDR r0, [lr, #mode_desc_rate] ; Fill in menu text.
LDR r0, [lr, #mode_desc_flags]
TST r0, #2
LDREQ r0, [lr, #mode_desc0_rate] ; Fill in menu text.
LDRNE r0, [lr, #mode_desc1_rate]
ADD r1, r3, #mi_icondata
MOV r2, #12
SWI XOS_ConvertInteger4 ; lr now corrupt.
......@@ -329,12 +306,18 @@ Menu_Rate
MOVEQ r0, #mi_it_lastitem ; this is the last item.
BEQ %FT15
LDR r1, [lr, #mode_desc_depth]
TEQ r5, r1 ; If depth has changed then
Push "r5-r7,lr"
MOV r7, r5
MOV r6, lr
MOV r0, #0
BL Mode_DescriptorToColourMenuItem
CMP r5, r7 ; If depth has changed then
Pull "r5-r7,lr"
MOVNE r0, #mi_it_lastitem ; last item.
BNE %FT15
ADD r1, lr, #mode_desc_xres
ASSERT mode_desc0_xres = mode_desc1_xres
ADD r1, lr, #mode_desc0_xres
LDMIA r1, {r1,r2}
TEQ r1, r6 ; If resolution has changed then
TEQEQ r2, r7
......
......@@ -65,12 +65,15 @@ msg_menuwarning
ADD r1, r1, #20
LDMIA r1, {r1-r3}
Push "r1-r3"
SUB sp, sp, #GVPixelFormat_Size
BL Mode_GetCurrent
MOV r5, sp
BLVC Mode_GetInfo
BLVC Mode_TestPalette
BLVC Mode_SetModeString
ADD sp, sp, #GVPixelFormat_Size
Pull "r1-r3"
SWIVC XWimp_CreateSubMenu
......
This diff is collapsed.
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