Commit graph

132 commits

Author SHA1 Message Date
Eugene Sandulenko
dead4aa014 JANITORIAL: Remove trailing spaces 2016-10-09 14:59:58 +02:00
Colin Snover
44dd029cb1 SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
2016-09-29 19:39:16 -05:00
Colin Snover
d0517f515e SCI32: Update screen on frameout, instead of in the event loop 2016-09-29 19:39:16 -05:00
Colin Snover
eae6891404 SCI32: Fix kGlobalToLocal and kLocalToGlobal
Fixes (at least) the native SCI save dialogs.
2016-08-19 15:23:10 -05:00
Colin Snover
80d9182554 SCI32: Implement SCI32 cursor support 2016-08-19 13:57:40 -05:00
Martin Kiewitz
c270b30a79 SCI: Fix pseudo mouse in various SCI1 games like e.g. Larry5
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).
2016-08-13 14:58:07 +02:00
Colin Snover
287391d1d5 SCI32: Fix incorrect mouse event coordinates in SCI2 hires 2016-03-11 19:05:13 -06:00
Martin Kiewitz
4ebca03534 SCI: Make cursor workaround work properly on OpenPandora
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.
2016-03-05 21:28:09 +01:00
Martin Kiewitz
59d2c4b27e SCI: Do not pass/use .data for mouse button type
Also added comment about .data field. Should be renamed.
2016-02-02 02:10:43 +01:00
Martin Kiewitz
c0bdbe1ca8 SCI: Fix control/Fx keys not working anymore
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.
2016-02-02 01:56:08 +01:00
Martin Kiewitz
453afd7bbc SCI: kGetEvent modifiers bug was fixed in SCI1
- 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
2016-01-03 18:32:25 +01:00
Martin Kiewitz
f9459656f5 SCI: implement kGetEvent modifiers DOS bug
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.
2016-01-03 18:09:06 +01:00
Martin Kiewitz
0dd760724e SCI32: split up SCI2.1 into EARLY/MIDDLE/LATE
- 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
2015-12-29 01:44:11 +01:00
Martin Kiewitz
bfba28c335 SCI: implement delayed restore via ScummVM menu
will delay restoring a saved game until the next
 kGetEvent or kWait
also implement aborting playback for kPortrait
 and kShowMovie
2015-04-26 09:08:46 +02:00
Willem Jan Palenstijn
4c03e4b699 SCI: Stop processing in kGetEvent after loading
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.
2015-04-26 00:48:07 +02:00
Johannes Schickel
daa8d57a86 ALL: Rename Debugger::DebugPrintf to Debugger::debugPrintf. 2014-05-27 02:04:07 +02:00
Johannes Schickel
8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Filippos Karapetis
d840aa4dec SCI: Change wording for the cursor position workarounds 2013-04-28 23:31:10 +03:00
Filippos Karapetis
2b50824133 SCI: Add setter/getter methods to reg_t's
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)
2012-06-18 05:24:06 +03:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
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]*$//'
2011-06-20 00:59:48 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Walter van Niftrik
952d1a084c SCI: Implement Mac iconbar event handling. 2011-03-09 21:05:19 +01:00
Johannes Schickel
463e475bd6 SCI: Save mouse position in SciEvent.
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.
2011-03-09 01:19:12 +01:00
md5
bd64c5078c SCI: Cleaned up kMapKeyToDir and removed an incorrect heuristic
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.
2011-02-15 15:46:15 +02:00
Filippos Karapetis
1528a3d904 SCI: A more efficient solution for bug #3037874 (SCI high CPU usage), which 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
2010-12-26 15:28:02 +00:00
Filippos Karapetis
976458058d SCI: Fixed bug #3058865 - "Jones in the Fast Lane CD: Graphics Missing"
svn-id: r52511
2010-09-03 22:51:27 +00:00
Martin Kiewitz
fa7c6a9969 SCI: adding workaround for platform-specific
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
2010-08-31 15:50:46 +00:00
Filippos Karapetis
b0b4ddcc52 SCI: Fixed bug #3037874 - "SCI1.1: High cpu usage when a textbox is displayed"
svn-id: r52432
2010-08-29 00:58:27 +00:00
Martin Kiewitz
b3949cf4be SCI: sci32 coord adjustment changes
- fixes lsl6hires inventory

svn-id: r51275
2010-07-25 16:31:46 +00:00
Martin Kiewitz
3090ee6ee7 SCI: sci32 changes
- 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
2010-07-25 04:45:28 +00:00
Martin Kiewitz
15fc39589d SCI: more work on coordadjustment sci32
svn-id: r51084
2010-07-21 12:05:10 +00:00
Martin Kiewitz
cef2e24edc SCI: fixing comment
svn-id: r51037
2010-07-19 20:13:17 +00:00
Max Horn
1d3a0f6dec SCI: Turn global object g_debugState into SciEngine member var
svn-id: r50836
2010-07-12 23:20:33 +00:00
Filippos Karapetis
bff3e89e48 SCI: Removed the FreeSCI music code
svn-id: r50532
2010-06-30 13:49:05 +00:00
Filippos Karapetis
9f1320d5cc SCI: Made the SoundCommandParser a member of the SciEngine class and removed it from the EngineState, since it's static throughout the course of a game
svn-id: r50484
2010-06-29 09:00:08 +00:00
Martin Kiewitz
a7fa0649df SCI: implemented checking of keyboard driver in case of SCI1EGA/EARLY, also renamed SCI_EVENT_JOYSTICK to SCI_EVENT_DIRECTION
svn-id: r50045
2010-06-19 09:46:04 +00:00
Martin Kiewitz
25c86e8b03 SCI: set resulting type to keyboard+joystick for sci1middle+ in kMapKeyToDir - 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
2010-06-18 22:16:05 +00:00
Max Horn
a2bcf9ac31 SCI: Rename sciEvent to SciEvent
svn-id: r49960
2010-06-17 23:11:12 +00:00
Max Horn
8e07a1e167 SCI: Moved the event code a little bit around.
* 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
2010-06-17 23:10:37 +00:00
Martin Kiewitz
b25aba1d1e SCI: SciGui/SciGui32 gone for good...
svn-id: r49860
2010-06-15 15:44:24 +00:00
Max Horn
651e2760a3 Fix spelling, cleanup
svn-id: r49843
2010-06-15 12:33:20 +00:00
Filippos Karapetis
5cb311ee2c Renamed the SciEvent class to EventManager, to separate it from the sciEvent structure, and removed it from the engine state
svn-id: r49534
2010-06-09 07:59:42 +00:00
Filippos Karapetis
9304b5fbeb Merged the restarting_flags, script_abort_flag, and restoring members of the EngineState class into one variable, abortScriptProcessing. The flag kept to signify a game restart has been placed in a boolean, gameWasRestarted
svn-id: r49518
2010-06-08 21:05:46 +00:00
Filippos Karapetis
67690e89a3 Merged _game_run() inside game_run(). Some cleanup
svn-id: r49513
2010-06-08 18:44:27 +00:00
Filippos Karapetis
3c82b6578f Now that EngineState is not deleted when loading games, we can move some more state-related variables to it, and remove several FIXME's about non-const global variables. Also, the entries in the data stack are now deleted when loading (fixes a memory leak - thanks to digitall for this).
svn-id: r49465
2010-06-06 23:00:33 +00:00
Filippos Karapetis
576306c323 Re-enabled the cursor position limiting code
svn-id: r49413
2010-06-03 21:52:21 +00:00
Filippos Karapetis
9c92bd1b81 The parser vocabulary remains static throughout the game, thus it has been removed from the engine state
svn-id: r49373
2010-06-01 15:11:20 +00:00
Filippos Karapetis
67de5b1bd3 Mass renaming of selector-related functions, and removed some defines which were just cloaking functions with a different name
- GET_SEL32 -> readSelector
- GET_SEL32V -> readSelectorValue
- PUT_SEL32 -> writeSelector
- PUT_SEL32V -> writeSelectorValue
Also, changed some selector-related function names and variables to CamelCase

svn-id: r49317
2010-05-29 23:37:15 +00:00
Max Horn
9575cc08a2 SCI: Move GameFeatures from EngineState to SciEngine
svn-id: r48049
2010-02-13 17:44:58 +00:00
Max Horn
721a57a661 SCI: Move Gui/Gfx related permanent objects from EngineState to SciEngine
svn-id: r48047
2010-02-13 17:43:31 +00:00