Commit Graph
110 Commits
Author SHA1 Message Date
Filippos Karapetis 79768098b1 Added handling for kLock called with resource id -1 (unlock all resources of the requested type). Happens e.g. in KQ6 and LSL6
svn-id: r50595
2010-07-02 10:18:11 +00:00
Martin Kiewitz 7595e7c1be SCI: implementing workarounds for kernel calls, removing original code workaround for kDisposeScript / qfg1 room 64 and adding it to workaround table
svn-id: r50520
2010-06-30 09:47:04 +00:00
Filippos Karapetis 4a60ff4090 Made the script initialization/uninitialization methods part of the segment manager
svn-id: r50402
2010-06-27 21:18:19 +00:00
Filippos Karapetis bb992b0b93 SCI: Moved all the script-related code inside script.cpp/.h, and all script opcode-related code inside vm.cpp/.h
svn-id: r50396
2010-06-27 20:38:43 +00:00
Filippos Karapetis 3dcebcb1bc Shuffled some functions around. Also, the filename in kResCheck can never be bigger than 9 characters, when dealing with VMD videos
svn-id: r50355
2010-06-26 23:01:22 +00:00
Filippos Karapetis b2f2c48c7e Added a workaround for broken script 377 in Castle of Dr. Brain, room 320. It constantly tries to free the saved area rectangle (underbits) underneath the popup window
svn-id: r50352
2010-06-26 22:50:39 +00:00
Max Horn bb528d894c SCI: Rewrap some overlong comments
svn-id: r50012
2010-06-18 09:37:06 +00:00
Filippos Karapetis 773f3bf145 Changed another warning into an error. Cleanup
svn-id: r49995
2010-06-18 02:23:30 +00:00
Filippos Karapetis 36d92b4566 Fixed kLoad and kUnload (the resource type was incorrect)
svn-id: r49931
2010-06-17 14:05:05 +00:00
Filippos Karapetis a7b76c04d9 Added handling of VMD video files in kResCheck, fixes video playing in GK2
svn-id: r49913
2010-06-17 00:07:03 +00:00
Max Horn 2b24a1a2ad SCI: OOpify class ResourceId
svn-id: r49841
2010-06-15 12:31:16 +00:00
Filippos Karapetis 60eced7a81 Cleanup
svn-id: r49662
2010-06-14 16:57:43 +00:00
Filippos Karapetis 86b452d36c Moved several object-related defines inside vm.h into segment.h, where the Object class resides. Also, removed several unused defines
svn-id: r49406
2010-06-03 10:16:21 +00:00
Filippos Karapetis 50cd1d1da4 Limited access to the script export table and synonyms block
svn-id: r49338
2010-05-30 23:31:33 +00:00
Filippos Karapetis 9c2da78ba9 kScriptID can be used to load scripts with no exports. Don't throw warnings in this case if no export is requested, as it's perfectly normal behavior
svn-id: r49331
2010-05-30 20:01:25 +00:00
Filippos Karapetis c32e88fe0b Limit access to the _bufSize, _scriptSize and _heapSize members of the Script class
svn-id: r49327
2010-05-30 16:14:31 +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
Filippos Karapetis a6156a6805 Removed the scriptRelocateExportsSci11() hack. The open spell in QFG1VGA works now (thanks to waltervn for all his help on this)
svn-id: r49311
2010-05-29 15:29:27 +00:00
Max Horn 0197e9f6a1 SCI: Making various object and script related things const
svn-id: r49246
2010-05-26 16:30:10 +00:00
Filippos Karapetis 174a043aa7 Removed the exportsAreWide variable from the segment manager and save games, and moved validateExportFunc() in the Script class, thus resolving a TODO
svn-id: r49093
2010-05-19 08:50:24 +00:00
Filippos Karapetis f3892a506b - Removed the wrapper kalloc, kmem and kfree functions. Now, the associated Segment manager functions allocateHunkEntry, getHunkPointer and freeHunkEntry are used directly (which are more descriptive, anyway)
- Replaced the GET_SEGMENT macro by a method of the segment manager
- Removed the unused reference to the created hunk in allocateHunkEntry(), only the reg_t reference to it is returned now

svn-id: r49078
2010-05-18 13:05:09 +00:00
Filippos Karapetis 75f4791a4a - Moved determine_reg_type() and kernel_matches_signature() inside the Kernel class, where they belong
- Moved the kernel signature defines inside kernel.h
- Removed some unused references to EngineState

svn-id: r49075
2010-05-18 11:23:13 +00:00
Max Horn b246c867df SCI: No need to set _executionStackPosChanged in kDisposeScript, as the callk opcode handler does that already
svn-id: r48064
2010-02-15 10:01:09 +00:00
Max Horn a82939c9be SCI: Get rid of EngineState::resMan
svn-id: r48048
2010-02-13 17:44:19 +00:00
Willem Jan Palenstijn 06bd17ee71 SCI: Remove extra '\n's in debugC messages
svn-id: r47707
2010-01-30 11:59:05 +00:00
Max Horn 4ffec28103 SCI: Move selector stuff to new header; reorder k_argc & k_argp param of invoke_selector
svn-id: r47665
2010-01-29 11:03:54 +00:00
Filippos Karapetis d154b9f008 Wording - we ignore calls to kUnload with less than 2 parameters
svn-id: r47564
2010-01-26 11:28:11 +00:00
Filippos Karapetis e0293562de Ignore kUnload calls which are not made with less than 2 parameters. Apparently, according to the FreeSCI bugs list, SQ1 calls it with 1 parameter when exiting the Ulence flats bar
svn-id: r47563
2010-01-26 11:25:15 +00:00
Johannes Schickel aed02365ec Strip trailing spaces/tabs.
svn-id: r47541
2010-01-25 01:39:44 +00:00
Filippos Karapetis dcbcb41855 kSetSynonyms is really parser related, but it's an empty function in games without a parser
svn-id: r47484
2010-01-23 20:27:14 +00:00
Filippos Karapetis 722233fd0d - Moved all of the parser-related variables inside the Vocabulary class
- Moved the kSetSynonyms() function inside kscripts (as it's for script synonyms, not parser word synonyms)
- The parser vocabulary is now only initialized for SCI0 and SCI01 games, which had a parser

svn-id: r47483
2010-01-23 19:10:56 +00:00
Filippos Karapetis f66d5a7f53 SCI: Removed the old graphics code
svn-id: r47005
2010-01-05 00:54:53 +00:00
Matthew Hoops ef79d7f017 SCI32:
- Fully implement kArray and kIsHiRes and mostly implement kString (printf and atoi subfunctions still missing).
	- Add a dummy SciGui class for SCI32 to bypass the views. Gabriel Knight 1 will now play the Sierra logo music and the main menu music.
	- Some other minor SCI32 changes.

svn-id: r46462
2009-12-21 14:32:54 +00:00
Filippos Karapetis 04ab6bc9fc Enclose all of the old graphics code within the INCLUDE_OLDGFX safeguard (defined in sci.h)
svn-id: r45459
2009-10-28 13:20:30 +00:00
Filippos Karapetis d6f5d93dbf Started rewriting the Object struct into a class
svn-id: r44878
2009-10-10 15:58:51 +00:00
Max Horn 6ad5840181 SCI: Rename EngineState::segMan to _segMan
svn-id: r44629
2009-10-04 18:38:18 +00:00
Johannes Schickel 270104fc70 Remove unused variable.
svn-id: r44464
2009-09-29 14:37:09 +00:00
Filippos Karapetis f9296a6445 - Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them

Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now

svn-id: r44461
2009-09-29 14:24:07 +00:00
Filippos Karapetis f78428384e QFG3 clears clones with underbits set, so disable the warning for this behavior
svn-id: r44458
2009-09-29 07:40:04 +00:00
Willem Jan Palenstijn 88a9099949 SCI: Remove unsafe unmarkDeleted function.
It did not undo all effects of a script being deleted (specifically its
superclasses remain unlocked), causing an inconsistent
state. Also removed EcoQuest CD hack that worked around a specific
instance of this problem.

svn-id: r44449
2009-09-28 20:21:09 +00:00
Max Horn 57dfb9bafd SCI: Rename Object::flags and pos to _flags and _pos; tweak scriptObjInit0 and scriptObjInit11 to be more similar
svn-id: r44234
2009-09-21 21:35:43 +00:00
Max Horn f2d2276c4a SCI: Move some selector related function into a new file selector.cpp
svn-id: r44171
2009-09-17 16:53:58 +00:00
Max Horn eb77efda78 SCI: Add a global getSciVersion() function and make use of it
svn-id: r44170
2009-09-17 16:50:53 +00:00
Filippos Karapetis f890a69428 Changed the way object selectors are accessed, by removing the relevant defines and adding appropriate methods to the Object structure
svn-id: r44138
2009-09-17 08:51:38 +00:00
Max Horn 1f0e8ef470 SCI: More cleanup
svn-id: r44129
2009-09-17 00:44:22 +00:00
Max Horn 68dfdce043 SCI: Turn some SegManager methods into Script methods
svn-id: r44127
2009-09-16 23:32:48 +00:00
Max Horn a277123f54 SCI: Rename Script class members, change Script from struct to class
svn-id: r44126
2009-09-16 23:32:27 +00:00
Filippos Karapetis 15cb36a7ee Made is_object() a method of the segment manager
svn-id: r44042
2009-09-12 17:42:04 +00:00
Filippos Karapetis 90ae20c3ea - Made obj_get and obj_get_name methods of SegManager (getObject and getObjectName, respectively)
- Renamed alloc_List -> allocateList, alloc_Node->allocateNode, alloc_hunk_entry->allocateHunkEntry, free_hunk_entry->freeHunkEntry, for consistency

svn-id: r44039
2009-09-12 00:10:07 +00:00
Max Horn fdbb167ea3 SCI: Cleanup for some SegManager internals
- rename segGet and getSegment to getScriptSegment; the two can be
  distinguished by the parameter count.
- rename type SCRIPT_GET to ScriptLoadType to conform with our code
  formatting conventions
- rename get_class_address to getClassAddress
- some cleanup

svn-id: r43981
2009-09-06 12:58:16 +00:00