Themes

Anything QL Software or Programming Related.
duncan
ROM Dongle
Posts: 31
Joined: Tue Aug 15, 2017 5:08 pm

Themes

Postby duncan » Wed Aug 21, 2019 8:53 pm

Hi

It may be a question that has been asked before, but what I am wondering is which mode is used for the 16 bit colours in themes. Have looked through Dilwyn's site and QToday without finding an answer. Are they mode 32 or if not what are they?

Why? I have been looking at updating EddIcon.

Thanks for any help.

Duncan


User avatar
pjw
Super Gold Card
Posts: 530
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Themes

Postby pjw » Thu Aug 22, 2019 5:40 pm

While we wait for a more learned explanation, here is my understanding:
These are the new Wman colours, as described in the display_txt document in the SMSQ/E
sources. They are not of any particular "mode"; they are mode-agnostic codes. You can use
the following colour codes in any wman objects (and WM_xxx keywords):

Code: Select all

        %00000000cccccccc       exactly as before
        %00000001pppppppp       palette
        %00000010pppppppp       system palette
        %00000011gggggggg       gray scale
        %00000100cc00tttd       3d border (border calls only!)
        %01ssxxxxxxyyyyyy       palette stipple. see below
        %1rrrrrgggggbbbbb       15 bit RGB

Obviously, the actual colours displayed will have been converted to the native mode as per
disp_type 0, 8, 16, 32 or 33.


Per
Be wary of large West-Coast corporations bearing gifts!
- Ancient Trojan proverb
duncan
ROM Dongle
Posts: 31
Joined: Tue Aug 15, 2017 5:08 pm

Re: Themes

Postby duncan » Fri Aug 23, 2019 7:29 am

Hi Per,

Thanks for the pointer to that document, so if I now understand it correctly only the hex numbers in the saved theme files that have the first bit set are the 15 bit colours that are used for paper ink etc, while the other numbers are borders, stipples etc.

Thanks.


User avatar
pjw
Super Gold Card
Posts: 530
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Themes

Postby pjw » Fri Aug 23, 2019 11:31 am

Hi Duncan,
Well, sort of: The Wman 15bit RGB colours dont correspond to those of any of the "natural" modes.
Since its quite complicated to unravel the Wman codes to convert them into real colours, and since
there are no hooks into the internal routines to do those conversions, I find the simplest way to
access the real colours is to set, say, the ink colour using WM_INK, and then get the resulting native
colour directly from the CDB with an xtop routine. This works ok for plain colours at least.


Per
Be wary of large West-Coast corporations bearing gifts!
- Ancient Trojan proverb
User avatar
mk79
Gold Card
Posts: 364
Joined: Sun Feb 02, 2014 10:54 am

Re: Themes

Postby mk79 » Fri Aug 23, 2019 12:27 pm

Yes Duncan, that's correct.

Regarding the 15-bit RGB mapping, WMAN code is written device independent, so it needs to use the 24-bit TRAP calls to interface with the OS. For this to work there is a 5-to-8 bit RGB conversion table that maps the values 0..31 uniformly to 0..255. On the CON driver side this is then reduced again to 16-bit or 8-bit or whatever, so the results are somewhat difficult to predict at the bit level.



Who is online

Users browsing this forum: No registered users and 4 guests