Age | Commit message (Collapse) | Author |
|
Fix mouse presses falling through the icon bar in KQ6 and FPFP Mac
|
|
Basic keyup event support appears to have been added in the SCI1.1
IBM keyboard driver, and more robust support was provided in SCI32
which actually gets used by at least Lighthouse. This patch adds
support for keyup events in SCI1.1+.
Fixes Trac#10242.
|
|
Convert macros and vars to enums, rename keyboard events in
preparation for adding key up events, clean up unnecessary nested
conditionals, add TODOs for potential future work.
|
|
|
|
This fixes delayed mouse cursor updates during the chase scene in
Phant1.
Refs Trac#9975.
|
|
|
|
In SSCI, mouse events are received through a hardware interrupt
and the cursor is drawn directly to the graphics card by the
interrupt handler. This allows game scripts to omit calls to
kFrameOut without stopping the mouse cursor from being redrawn
in response to mouse movement.
ScummVM, in contrast, needs to poll for events and submit screen
updates explicitly from the main thread. Submitting screen updates
may block on vsync, which means that this call should really only
be made once per frame, just after the game has finished updating
its back buffer. The closest signal in SCI32 for having completed
drawing a frame is the kFrameOut call, so this is where the
update is submitted (by calling OSystem::updateScreen).
The problem with the approach in ScummVM is that, even though the
mouse position is being updated (by calls to kGetEvent) and drawn
to the backend's back buffer (by GfxCursor32::drawToHardware),
OSystem::updateScreen is never called during game loops that omit
calls to kFrameOut.
This commit introduces a workaround that looks at the number of
times kGetEvent is called between calls to kFrameOut. If the
number of kGetEvent calls is higher than usual (where "usual"
seems to be 0 or 1), we assume that the game is running one of
these tight event loops, and kGetEvent starts calling
OSystem::updateScreen until the next kFrameOut call. We also
then start throttling the calls to kGetEvent to keep CPU usage
down. This fixes at least two such known loops:
1. When interacting with the menu bar at the top of the screen
in LSL6hires;
2. When restoring a game in Phant2 and sitting on the "click mouse"
screen.
A similar workaround may also be needed for kGetTime, though loops
around kGetTime should preferably be replaced using a script patch
to call kWait instead.
|
|
GuestAdditions
|
|
_delayedRestoreGame is always set and cleared at the same time as
_delayedRestoreGameId, and _delayedRestoreFromLauncher is written
but never read.
|
|
Memory references and integers in SSCI are both 16-bit numbers,
so game scripts frequently (incorrectly) use an IntArray instead
of an IDArray for holding references. Since references in ScummVM
are 32-bit reg_ts, IntArray entries must be large enough to hold
reg_ts in order to be compatible with game scripts that store
references in integer arrays.
The alternative solution is to find and patch all incorrect use of
IntArray across all games. This is possible, but a bit risky from
a save game stability perspective, since incorrect IntArray usage
is sometimes not apparent until well after the array is
instantiated (like GK1's global interview array).
This change invalidates existing SCI32 save games.
|
|
|
|
Used only by chapter 7 of Phant1.
|
|
|
|
Fixes (at least) the native SCI save dialogs.
|
|
|
|
Pseudo mouse was functionality in SCI1+ games, that allowed the
user to control the mouse via keyboard cursor keys.
This new class only worked, when a tiny difference inside
the keyboard driver happened on kMapKeyToDir calls. We previously
tried to enable this behavior depending on cursor type, but
this didn't work correctly (Larry 5 for example was not detected
as such, but had PseudoMouse support).
|
|
|
|
Other platforms, that support analog stick + touch screen at the
same time, are possibly also affected.
Cursor workarounds exist for qfg1vga, qfg3, lsl5 and Island of
Dr. Brain. Those sometimes worked and sometimes didn't on
at least OpenPandora and should be fixed now.
|
|
Also added comment about .data field. Should be renamed.
|
|
Was effectively caused by commit adding the keyboard driver bug
for SCI0/SCI01, although the bug is actually real and happens.
It seems Sierra did not check the key-modifier in kMenuSelect.
We do and that's why the code didn't recognize all sorts of
menu keys anymore.
We now isolate the lower byte before comparing.
I also noticed, that Sierra passed keyboard modifiers in mouse
events. This was probably done, so that owners of a 1-button
mouse were able to right-click. We do this now too.
Also added information about mouse modifiers in kGetEvent.
Moved the mouse modifier code into getScummVMEvent().
This should fix bug #7009.
|
|
- SCI1 EGA QfG2 keyboard driver resets AH
In the original commit I forgot to mention:
- thanks to lskovlun for figuring out that bit 9 is checked/set
- thanks to wjp for checking SCI32
|
|
Will fix darts minigame in the fan game "Betrayed Alliance"
This bug in the original interpreter/keyboard driver seems to have
been fixed in SCI32.
|
|
- Detection works via signatures (couldn't find a better way)
- new kString subcalls were introduced SCI2.1 LATE
- kString now has signatures and is split via subcall table
- kString fix, so that KQ7 doesn't crash, when starting a chapter
- Sci2StringFunctionType removed, because no longer needed
|
|
will delay restoring a saved game until the next
kGetEvent or kWait
also implement aborting playback for kPortrait
and kShowMovie
|
|
getSciEvent can trigger the main ScummVM menu, which can trigger loading
a game, which will invalidate the game state that kGetEvent is operating
on.
Other kernel functions may still have the same problem, and a better
solution may be necessary.
|
|
|
|
|
|
|
|
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
|
|
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
|
|
|
|
|
|
Instead of querying the event manager for the current mouse cursor coordinates
kGetEvent now uses the saved mouse positions, which will assure every event
will be processed with the correct coordinates instead of the current ones.
Various other functions using SciEvent directly were adapted too.
This fixes cursor click positions for the WinCE backend.
Thanks to wjp and waltervn for helping me with this.
|
|
The heuristic in question was used to detect the pseudo mouse control
functionality, however the change in controls seems to have occurred with the
transition to cursor views. Fixes keypad control in Conquest of the Longbow.
Moreover, the code also checked for key scan code 76 when checking for the middle
keypad button, which seems to be a mistake, as that case never occurred.
|
|
will hopefully
not clash with the speed throttler. This is a more proper fix for bug #3058865, and a
partial fix for bug #3127824
svn-id: r55046
|
|
svn-id: r52511
|
|
incompatibility with some sierra games. Some games open a new menu, set mouse cursor within that menu and expect the mouse cursor to be in there and will close it, if it's outside. In case of Wiimote/touch interfaces this logic won't work of course. Fixes island of dr. brain and QfG1VGA on Wii and touch-interface platforms
svn-id: r52474
|
|
svn-id: r52432
|
|
- fixes lsl6hires inventory
svn-id: r51275
|
|
- mouse position now gets adjusted inside kGetEvent
- priority is read out during kFrameout
- check planeRect
- check if plane picture resource actually exists
fixes sq6
svn-id: r51270
|
|
svn-id: r51084
|
|
svn-id: r51037
|
|
svn-id: r50836
|
|
svn-id: r50532
|
|
it from the EngineState, since it's static throughout the course of a game
svn-id: r50484
|
|
renamed SCI_EVENT_JOYSTICK to SCI_EVENT_DIRECTION
svn-id: r50045
|
|
- fixes keyboard controlling of mouse in all sorts of games - although this is not 100% done, the change actually happened inbetween sci1early, added fixme
svn-id: r50034
|
|
svn-id: r49960
|
|
* Move sleep() from EventManager to SciEngine
* Rename EventManager methods: get -> getSciEvent, and
getFromScummVM -> getScummVMEvent
* Make scancode_rows static const
* Turn altify & numlockify from EventManager methods into static
functions (and comment out the currently unused numlockify)
svn-id: r49959
|
|
svn-id: r49860
|