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.
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.
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.
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()...
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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!)