Commit graph

248 commits

Author SHA1 Message Date
Torbjörn Andersson
7572817b96 SCUMM: Use GMM instead of original screen in Mac Maniac Mansion
The original save/load screen handles only a single save slot, which
doesn't align with how we handle saving and loading through the Mac
dialogs.
2025-02-02 06:35:19 +01:00
athrxx
b3baa636ee SCUMM: whitespace 2024-11-23 23:11:51 +01:00
Torbjörn Andersson
53c41d591d SCUMM: Disable some keysmaps while writing some savegame names
The userWriteLabelRoutine() seems to be used by several, but far from
all, of the SCUMM games when using the original GUI. Disable the
engine-default keymap while it's running, so that it won't clash with
text input.
2024-11-04 21:00:56 +01:00
Torbjörn Andersson
bfd05e00dc SCUMM: MACGUI: Disable the "engine-default" keymapper in the save dialog
The "engine-default" keymapper will by default have the "." key as "skip
line". But the way things currently work, that also makes Ctrl+".",
Alt+".", Shift+".", etc. the "skip line" key. And on my keyboard
Shift+"." is ":", which I may sensibly want to have in my savegame
names.

Of course, this doesn't keep the other keymappers from doing the same
thing. But there are stuff in those that we may still want active, even
while saving.
2024-10-29 21:11:00 +01:00
AndywinXp
da21a245d1 SCUMM: Disable some main menu (and other stuff) for _macGui games 2024-10-28 08:24:59 +01:00
AndywinXp
6b28d2c814 SCUMM: Assign Mac smoothing to config entry & implement Speech menu 2024-10-28 08:24:59 +01:00
AndywinXp
8f99ad12ae SCUMM: Fix warning in input.cpp 2024-10-28 08:24:59 +01:00
AndywinXp
9f319cdd86 SCUMM: Add Mac screen implementation for remaining LEC games
This adds optional EPX scaling and 640x480 resolution for
LucasArts Macintosh games other than Indy3 and Loom.

This includes:
* Monkey Island 1
* Monkey Island 2
* Indy4
* Day of the Tentacle
* Sam&Max
* Full Throttle
* The Dig

In doing this, I reverted the ugly code which previously offset
the game screen 20 pixels below (to create an internal 320x240
buffer, instead of 320x200). Instead of just offsetting mouse
coordinates and the final screen texture, I used to offset the
in-engine graphics elements. Ew.

This ensures flawless savegame compatibility between old and
new, without touching anything.
2024-10-28 08:24:59 +01:00
AndywinXp
67b0440ad0 SCUMM: MI1 (Mac): Implement EPX scaling and a stub for the menu 2024-10-28 08:24:59 +01:00
AndywinXp
996938b891 SCUMM: ZAK (FM-Towns): Insert workaround for intro timing
This fixes and closes #9591:
"SCUMM: ZAK (FM-Towns): Intro animation runs faster than intro music"

Also, make sure that the timer frequency is always used by calling
getTimerFrequency()...
2024-08-19 15:45:40 +02:00
athrxx
65af75f079 SCUMM : (V1/2) - minor Hercules mouse precision improvement 2024-07-24 23:27:45 +02:00
AndywinXp
e18e0a4da1 SCUMM: DIG: Fix CTRL-B easter egg not working
This fixes #15064. The CTRL-B combination was used in COMI to
regulate the buffer count for iMUSE, so I originally decided to extend
it to SCUMM v7 games. Unfortunately DIG uses this combination for
an easter egg, so the iMUSE buffer function is now available through
SHIFT-B for this game.
2024-05-19 20:26:50 +02:00
athrxx
55f1bbd47d SCUMM: (FM-Towns) - add menu option to force 640 x 480 mode
English versions usually run in a 320 x 240 resolution in ScummVM.
The original interpreter uses 640 x 480. It has a unique pause/restart
banner that we cannot display in 320 x 240. So that is really the only
reason for adding this option.
2024-05-01 16:06:11 +02:00
Torbjörn Andersson
61b72f29f6 SCUMM: Freeze the Mac GUI while waiting for banner input
I encountered some graphics corruption and even a crash if I allowed the
Mac menus to be used while the pause banner was displayed.
2024-03-14 21:48:09 +01:00
AndywinXp
de4a6ad9b1 SCUMM: Fix #15009 2024-03-09 09:07:10 +01:00
AndywinXp
5caac7e013 SCUMM: Attempt at fixing #14781 2024-01-23 21:03:11 +01:00
Torbjörn Andersson
c7ab59293f SCUMM: Split MacGui into MacGui and MacGuiImpl
The idea here is to expose a much smaller part of the MacGui headers to
the SCUMM engine, but introducing a new class that simply relays calls
to the actual Mac GUI. I hope this will allow me to further untangle
things.
2023-12-22 15:09:06 +01:00
Torbjörn Andersson
fb2bd1166d SCUMM: Split up gfx_mac.cpp into new macgui directory
The Mac GUI code is getting unwieldy, and this is an attempt at breaking
it up into more manageable chunks.
2023-12-22 15:09:06 +01:00
Torbjörn Andersson
1c8088ec9a SCUMM: Move Mac Loom drafts inventory into MacLoomGui 2023-11-27 18:12:06 +01:00
Torbjörn Andersson
3800f8f33f SCUMM: Simplify launching of Mac Loom drafts inventory
It's now the Mac dialog class that's responsible for saving/restoring
the screen shaking. (They were already responsible for pausing and
unpausing.) There are some other minor cleanups along the way, and the
drafts inventory can now be launched from the Apple menu.
2023-11-21 18:58:24 +01:00
AndywinXp
b599b254f5 SCUMM: MACGUI: Implement Loom's Drafts inventory using a MacDialogWindow 2023-11-20 14:39:17 +01:00
AndywinXp
4232178ab2 SCUMM: MACGUI: Implement restart dialog handling outside the Mac menu 2023-11-18 18:47:39 +01:00
AndywinXp
3f707d009d SCUMM: MACGUI: Implement quit dialog handling for out-of-menu quit events 2023-11-18 18:47:39 +01:00
AndywinXp
204d900dd8 SCUMM: MACGUI: Wire up quit and restart callbacks 2023-11-18 18:47:39 +01:00
Torbjörn Andersson
e2ca711d5b SCUMM: Finish migrating Mac banner drawing to Mac GUI 2023-11-18 18:47:39 +01:00
Torbjörn Andersson
ec1ab82283 SCUMM: Initial work on a common MacGui class that handles Mac menus etc.
This will be used for Last Crusade and Loom. Loom is currently the more
broken of the two, though.
2023-11-18 18:47:39 +01:00
AndywinXp
5d5cc05610 SCUMM: Improve numpad remapping following PR #5406
In particular we set the _keyPressed object only when we find
an event.kbd for the numpad keys. Otherwise we immediately
get double events when pressing any key.
2023-11-13 19:53:32 +01:00
Lars Sundström
e8ea447c90 SCUMM: Fix remapping of numpad keys on EVENT_KEYUP
Dpad buttons are by default remapped to numpad keys. Up/Down are
KEYCODE_KP8/KEYCODE_KP2 and Left/right are KEYCODE_KP4/KEYCODE_KP6.

The numpad keys are remapped to have a corresponding ASCII value
since the state of the keys are stored in the _keyDownMap array,
indexed by the ASCII value.

It was found that the ASCII values were calculated incorrectly for
EVENT_KEYUP events but correctly for EVENT_KEY DOWN events. In the
latter cases the keyboard event was stored to the _keyPressed member
variable. The keycode was checked and if being a numpad key the
corresponding ASCII value was calculated. The key state was then
stored in the _keyDownMap array using the calculated ASCII value.

For the EVENT_KEYUP events the keyboard event was not stored to the
_keyPressed member variable. The keycode was still checked using the
_keyPressed variable. However the _keyPressed could have been reset
causing the ASCII calculation to fail for the numpad key. The raw
ASCII value of the keyboard event was instead being used to reset
the key state in the _keyDownMap array causing the numpad key to be
left in a pressed state.

This was found when plaing the Lunar Lander mini game in "The Dig"
using the virtual gamepad controller in iOS.

Fix it by writing the keyboard event to the _keyPressed variable
and use the corresponding ASCII value when reseting the key state
in the _keyDownMap array.
2023-11-13 12:11:53 +01:00
AndywinXp
8461f25218 SCUMM: Rename enhancementClassActive to enhancementEnabled 2023-11-08 11:46:06 +01:00
AndywinXp
d5fa7aeb90 SCUMM: Mark all enhancements with their respective classes 2023-11-08 11:46:06 +01:00
AndywinXp
c62e4c5829 SCUMM: LOOM: Begin work on Drafts Inventory enhancement 2023-10-29 20:22:52 +01:00
Torbjörn Andersson
2223c96395 SCUMM: More Indy 3 Mac GUI cleanups 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
a67b1e9758 SCUMM: Remove Indy 3 Mac GUI verb script check
It seems it's no longer needed. Also, cleaned up naming a bit so that
instead of "active" and "visible", the GUI is now "allowed" and
"active".
2023-10-16 17:40:29 +02:00
Torbjörn Andersson
e40c3a2fbb SCUMM: More Indy 3 Mac GUI cleanup + inventory scrolling 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
6f8f3b4b13 SCUMM: Update Indy 3 Mac GUI less frequently
It's enough to do it after thigns have had a chance to change. Not every
iteration of waitForTimer(). This means we no longer have as precise
resolution for our animation timers, but I don't think that's any reason
not to cut down on the (admittedly small) amount of extra work the GUI
has to do.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson
c6d1a256ef SCUMM: Moved Mac Indy 3 GUI into its own class
This is still just a mock-up, and a bad one at that. It will all be for
nought unless I can figure out how to wire up these buttons to the SCUMM
verbs.
2023-10-16 17:40:29 +02:00
AndywinXp
f4455e773e SCUMM: Relabel part of the general sound code
Albeit not 100% necessary for rewriting the HE sound engine,
I decided to make this change in order to:
- Give proper meaning to magic numbers and variables
  which were given temporary names 20 years ago;
- Avoid going insane when making comparison with HE code
  and ours, when rewriting the sound code.
2023-08-18 22:20:45 +02:00
AndywinXp
142924cec4 SCUMM: GUI: Fix some FM-Towns banner not disappearing properly 2023-07-09 20:50:09 +02:00
AndywinXp
f484ad6545 SCUMM: SAMNMAX: Fix bug #14467
This was caused by the fact that the pre and post save screen scripts
were not being called, and this messed up the cursor state with savegames
created as quicksaves.

Also, renamed the variables containing said scripts numbers, so that
they are a little bit more meaningful now.
2023-05-21 21:17:36 +02:00
AndywinXp
9416772cb1 SCUMM: Fix keyboard inputs being lost during mouse inputs
The line we're amending was applied a while ago when there had
been issues with COMI losing mouse inputs during a keyboard press;
apparently this has been resolved in a different way, and keeping it
(on the contrary) loses keyboard inputs.

This has been tested by the speedrun community.
2023-04-02 11:35:35 +02:00
AndywinXp
e28b3f09b1 SCUMM: GUI: Use correct heap message for some v6 games 2023-03-19 19:26:15 +01:00
AndywinXp
e689c5116f SCUMM: GUI: Fix text not being entirely cleared in edge cases
When clearBanner() is called for versions lower than 7, it can cause some pixels
from the previous dialog text to remain on screen and not be cleared when the
text speed banner is displayed and cleared out.
2023-03-17 18:40:13 +01:00
AndywinXp
122eab3e4a SCUMM: Remove leftover debug print 2023-02-11 16:46:15 +01:00
AndywinXp
ca59d016e5 SCUMM: MI1 (SegaCD): Improve input handling during dialogs
We allow ENTER to be used to confirm the dialog choice, swap the left and right
arrow keys, and correctly map the numpad keys (so that joypad now actually work!)
2023-02-11 11:32:48 +01:00
Cameron Cawley
f7785f463a SCUMM: Use the keymapper for bike fights in Full Throttle 2023-02-08 00:11:40 +01:00
Little Cat
2f6b3df250 SCUMM: INPUT: Don't subsitute clicks in HE games.
These (later) games can have scripts that accept Enter and Tab keys.
2023-01-26 11:01:58 +01:00
AndywinXp
27f9345bed SCUMM: Fix bug #14051 2023-01-19 19:41:10 +01:00
AndywinXp
0a665007d5 JANITORIAL: SCUMM: Fix spelling error 2023-01-19 19:37:38 +01:00
AndywinXp
b376f0010f SCUMM: GUI: Add support for Maniac NES 2022-12-29 11:19:45 +01:00
AndywinXp
995b83c546 SCUMM: GUI: Allow quitting with ALT-X and ALT-Q combinations 2022-12-28 19:15:39 +01:00