Opened 8 months ago

Closed 6 months ago

#15025 closed defect (fixed)

SCUMM: DIG: Sentence Line font has wrong colors

Reported by: ATMcashpoint Owned by: athrxx
Priority: normal Component: Engine: SCUMM
Version: Keywords: fonts
Cc: ATMcashpoint Game: The Dig

Description

In The Dig on DOS, the font used for the Sentence Line has at least three colors: white, black for shadows, and gray for some of the letter corners. In ScummVM, the gray pixels are changed to black by mistake.

This font is also used for the opening and closing credits, with different colors for each set of credits, but those appear to be displayed correctly in ScummVM.

Attachments (6)

digdosclosingcreditsfont.png (38.9 KB ) - added by ATMcashpoint 8 months ago.
digdosopeningcreditsfont.png (13.0 KB ) - added by ATMcashpoint 8 months ago.
digdossentencelinefont.png (73.2 KB ) - added by ATMcashpoint 8 months ago.
digscummvmclosingcreditsfont.png (39.1 KB ) - added by ATMcashpoint 8 months ago.
digscummvmopeningcreditsfont.png (11.7 KB ) - added by ATMcashpoint 8 months ago.
digscummvmsentencelinefont.png (72.4 KB ) - added by ATMcashpoint 8 months ago.

Download all attachments as: .zip

Change History (14)

by ATMcashpoint, 8 months ago

by ATMcashpoint, 8 months ago

by ATMcashpoint, 8 months ago

Attachment: digdossentencelinefont.png added

by ATMcashpoint, 8 months ago

by ATMcashpoint, 8 months ago

by ATMcashpoint, 8 months ago

comment:1 by AndywinXp, 8 months ago

Summary: DIG: Sentence Line font has wrong colorsSCUMM: DIG: Sentence Line font has wrong colors

Thanks! :D I'll get to it asap!

comment:2 by eriktorbjorn, 7 months ago

I added some debug messages to CharsetRendererV7, and this is what it decodes the "a" in the sentence line as:

                    
                    
    1  1  1  1  3   
       3  3  3  1  3
 2  1  1  1  1  1  3
 1  3  3  3  3  1  3
 2  1  1  1  1  1  3
    3  3  3  3  3  3

Transparency is 0, but I've removed them from the image above for clarity. This is then mapped through _charsetColorMap[], resulting in the following bitmap:

                    
                    
   15 15 15 15  0   
       0  0  0 15  0
 0 15 15 15 15 15  0
15  0  0  0  0 15  0
 0 15 15 15 15 15  0
    0  0  0  0  0  0

I.e. colors 2 and 3 are both mapped to black. But color 2 should probably be mapped to something else?

_charsetColorMap[1] gets set by CharsetRendererV7::drawCharV7() but what about the rest of it? It does get initialized by the SO_CHARSET_COLOR of ScummEngine_v6::o6_cursorCommand(). Everything in _charsetColorMap[] gets set to zero, except for entries 1 and 2 which are set to 15 and 7 respectively. Well, we did get 15 earlier but what happened to the 7?

It seems it gets zeroed out in ScummEngine::initCharset() by copying _charsetData[charsetno] into it. There are a number of places where this can happen, but that's the one that gets triggered here. If I just remove that memcpy() the character seems to be rendered correctly.

Of course this is just an observation. I'm not saying that it is the correct fix!

Last edited 7 months ago by eriktorbjorn (previous) (diff)

comment:3 by AndywinXp, 7 months ago

@eriktorbjorn thank you, this is actually very valuable.
_charsetColorMap[1] being set without anything else is something I always see on about every SPUTM disassembled code. It might be different on DIG, I should check... The initCharset() part might also work differently on DIG, that's a good point!

I'll check it out asap, I'm a little bit busy these days unfortunately...

comment:4 by eriktorbjorn, 7 months ago

I noticed there are some special cases for the demo version of The Dig too so any change may have to take that into account as well.

comment:5 by ATMcashpoint, 6 months ago

The Sentence Line font in The Dig demo is entirely different - it's just basically the Sentence Line font from Fate of Atlantis, in a light blue (not teal) color.

comment:6 by athrxx, 6 months ago

Owner: set to athrxx
Resolution: pending
Status: newpending

I've made a fix. Please check if it works for you.

comment:7 by ATMcashpoint, 6 months ago

It appears to work properly in the daily build from May 8, 2024 (04:48:48).

comment:8 by athrxx, 6 months ago

Resolution: pendingfixed
Status: pendingclosed

Thanks for testing!

Note: See TracTickets for help on using tickets.