Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Macintosh black-and-white mode for Mac Loom and Indy3 #3146

Merged
merged 5 commits into from Jul 13, 2021

Conversation

@eriktorbjorn
Copy link
Member

@eriktorbjorn eriktorbjorn commented Jul 11, 2021

This adds a black-and-white mode for Mac Loom and Indy3. This feature was actually requested several years ago [1]. I don't know if that guy is still around, but maybe others want it as well.

Each color is dithered to a 2x2 pattern. I don't know if the actual patterns were some sort of standard, or if LucasArts came up with them themselves. But I believe that the result is pixel-perfect compared to the originals. I have put these, along with the Mac "EGA" palette, in a new header file, graphics/macega.h in case they can be reused elsewhere. When I did it, I was mainly thinking about the Mac AGI games, though looking closer at screenshots I suspect they used 3x2 dither patterns instead. Oh well.

Text is rendered as black or white (I think all of the in-game text is white), except for dark gray which is rendered using a checkerboard pattern. This is used for disabled notes in Loom, and for the replacement verb GUI in Indy3. The Loom notes appear to be pixel perfect, except I still can't figure out exactly if/when/how the notes used shadowed text. Oh well, that'll have to be good enough.

When running in 16 colors, the games use the shadow palette to remap colors. This makes no sense when you only have two colors, so these color changes are handled by the renderer, and any change to the shadow palette triggers a full redraw of the screen. This is used for the lightning flashes around Castle Brunwald in Indy3, and for the scene in Loom where the dragon finds Rusty asleep. (If there are other scenes, I'm not aware of them.)

I have replayed all of Loom, because that's the one where I was the most worried about text color. In Indy3, most text is drawn using a separate functions (for the text boxes) that only knows how to draw white text.

[1] https://forums.scummvm.org/viewtopic.php?f=1&t=12489

This is currently only (partially) implemented for the 16-color Mac
versions of Loom and Indiana Jones and the Last Crusade. The text is
still drawn in color, since that's rendered separately, but I'm
committing this now while it still works.
I still need to add code for drawing disabled text for the Loom notes
and Indy 3 verbs.
I just need to test Loom a bit more. Indy 3 should be pretty safe, since
most of the text is printed in text boxes, which never use shaded text.
@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Jul 11, 2021

I'm actually surprised at how good the output looks. You'd think that 16 colors mapped to 2x2 patterns would just come out as a horrid mess. Particularly for Loom, which uses a lot of dithering to begin with.

indy3-bw

loom-bw

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Jul 12, 2021

It turns out that LucasArts didn't implement the palette changes in their interpreter:

loomdragon-minivmac

The image is small because I was emulating a 9" Mac screen since that's seemed like the most likely use case back then. This is how it currently looks in ScummVM:

loomdragon-scummvm

Which I think is an improvement. I'll check Indy 3 next.

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Jul 12, 2021

You could argue that Rusty is quite nicely shaded in the Mini vMac screenshot, without the palette change, but for the Indy 3 castle exterior I think there's no contest. The original image is nice but pretty static:

indycastle-minivmac

In ScummVM, the lightning makes the scene look much more dramatic, even degraded to black and white:

indycastle-scummvm

@eriktorbjorn eriktorbjorn force-pushed the eriktorbjorn:mac-dither branch 2 times, most recently from 7f8b19a to c034b18 Jul 12, 2021
In Macintosh b/w mode, there really is no such thing as palette
manipulation. Any color changes have to be handled by the renderer.
Instead of marking the palette as dirty, changes to the shadow palette
trigger a full redraw of the screen.

At the time of writing, I'm only aware of two things that use this: The
lightning flashes at Castle Brunwald in Indiana Jones and the Last
Crusade, and the scene where the dragon finds Rusty in Loom. I have
verified that both of these seem to work correctly.
@eriktorbjorn eriktorbjorn force-pushed the eriktorbjorn:mac-dither branch from c034b18 to a20e4b6 Jul 12, 2021
@sev-
sev- approved these changes Jul 13, 2021
Copy link
Member

@sev- sev- left a comment

Cool stuff. Please add that comment for translators and we're good to go.

@@ -44,6 +44,7 @@ const RenderModeDescription g_renderModes[] = {
{ "2gs", "Apple IIgs", kRenderApple2GS },
{ "atari", "Atari ST", kRenderAtariST },
{ "macintosh", "Macintosh", kRenderMacintosh },
{ "macintoshbw", _s("Macintosh b/w"), kRenderMacintoshBW },

This comment has been minimized.

@sev-

sev- Jul 13, 2021
Member

Please add a comment preceding this line, for the translators, something like

// I18N: Macintosh black-and-white render mode
@sev-
Copy link
Member

@sev- sev- commented Jul 13, 2021

Thanks!

@sev- sev- merged commit 5775637 into scummvm:master Jul 13, 2021
8 checks passed
8 checks passed
@github-actions
Windows (win32, x86-windows, x86, --enable-faad --enable-mpeg2 --enable-discord --disable-fribidi...
Details
@github-actions
Windows (x64, x64, x64-windows, --enable-faad --enable-mpeg2 --enable-discord --disable-fribidi, ...
Details
@github-actions
Windows (arm64, arm64, arm64-windows, --enable-faad --enable-mpeg2 --enable-discord --disable-fri...
Details
@github-actions
Xcode (macosx, -scheme ScummVM-macOS, --disable-nasm --enable-faad --enable-mpeg2, a52dec faad2 f...
Details
@github-actions
Xcode (ios7, -scheme ScummVM-iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO, --disable-nasm --...
Details
@github-actions
Ubuntu (ubuntu-latest, sdl2-config, --enable-c++11, libsdl2-dev libsdl2-net-dev liba52-dev libjpe...
Details
@github-actions
Ubuntu (ubuntu-18.04, sdl-config, --disable-c++11, libsdl1.2-dev libsdl-net1.2-dev liba52-dev lib...
Details
@codacy-production
Codacy Static Code Analysis Codacy Static Code Analysis
Details
@pmaciel
Copy link

@pmaciel pmaciel commented Jul 16, 2021

Hi @eriktorbjorn, I'm the one one with the original request -- it now it looks abolutelly gorgeous :-D
I had no clue it would also work on larger resolutions and with your palette fix, it's a new experience (specifically Loom). Thanks for your great work!
Pedro

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Jul 16, 2021

@pmaciel I didn't know you were still around. I'm glad you got to see the results!

I was actually a bit skeptical about the whole thing, but I figured that if (as it turned out) the dithering was just a simple matter of replacing each color with a 2x2 dithering pattern, then it would be a pretty small addition since the graphics already had to be upscaled to accommodate for the high-resolution font. That part was a bit of work, but others had already figured out how to handle Mac resources and render the fonts.

(I briefly toyed with the idea of adding a Macintosh black-and-white mode for the Sierra AGI games as well, but it seems different versions use different dithering methods. So no, I'll happily leave that to someone else. :-)

Please let me know if you run into issues, other than the known ones:

  • The games are rendered at 640x400 pixels. I believe this to be a reasonable approximation of how they would look on a Macintosh II, running in 2-color mode. Models with smaller screens would have cropped the image to - I believe - 512x342 pixels, and I believe they would also have had to adjust parts of the GUI to fit. (E.g. Loom would draw the notes box in Practice mode above the distaff instead of below it.) I see little reason to support this.
  • At least Loom had different settings for music quality. ScummVM only emulates what I believe is the highest quality version of the music. (I've never heard it on real hardware, so I don't know how close it is.) I'm not sure if it's worth pursuing the lower quality music, though I vaguely seem to recall stumbling over the medium-quality tracks while adding support for the custom instruments. So maybe I'll add that at some point... (I think the low quality music was played through the Mac synthesizer. See below.)
  • Indy 3's music doesn't sound like the original, since it's played through some sort of AdLib emulation where the original would use the Mac's synthesizer. But I lack all knowledge needed to emulate that.
  • There's that Indy 3 GUI that isn't implemented at all. I guess it would be reasonable to add support for that at some point, but it seems like quite a bit of work.

That's all I can think of at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants