Filippos Karapetis
c28fa2cf19
Reverted the code which handles objects without a base object when loading, for now. This possibly indicates an issue related to the garbage collector
...
svn-id: r50142
2010-06-22 15:03:19 +00:00
Filippos Karapetis
db70d66e4a
Strict mode: Changed several warnings due to logic bugs into errors. If an error pops up from these ones, please add the game where it occurred and the steps to reproduce the error before turning it into a warning
...
svn-id: r49973
2010-06-17 23:50:28 +00:00
Lars Skovlund
9a1db3f770
Add support for SCI32 segment types to seg_table and vr debug commands
...
svn-id: r49686
2010-06-15 08:21:39 +00:00
Filippos Karapetis
1fde7f1abc
Removed the code used for tracking script code block relocations in SCI0-SCI1 games, as we don't actually relocate these blocks, and it was used solely for verification of the exports table. The issue that this warning was created for should no longer occur
...
svn-id: r49669
2010-06-14 20:45:00 +00:00
Filippos Karapetis
4f3bb60cd5
Really silence the warning with _bufSize
...
svn-id: r49652
2010-06-14 13:53:15 +00:00
Filippos Karapetis
5230930d95
Silenced warning
...
svn-id: r49651
2010-06-14 13:41:06 +00:00
Filippos Karapetis
2a78b82799
Fixed a bug with commit #49640
...
svn-id: r49650
2010-06-14 13:13:02 +00:00
Filippos Karapetis
cd77cb96fc
Some cleanup of the script locals code
...
svn-id: r49649
2010-06-14 12:44:57 +00:00
Filippos Karapetis
b5ebd40d61
The offset of script local variables is now calculated when the script is loaded, thus we no longer need to save it. Merged scriptInitialiseLocals() with scriptInitialiseLocalsZero()
...
svn-id: r49640
2010-06-13 22:15:30 +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
c4bdca72d7
Fixed regression from commit #49332 (merging of the SCI0 and SCI11 relocate functions, where the SCI0 equivalent had a +1 count): it seems that we should skip over zero exports, however the total number of valid exports remains the same. Fixes KQ5 and QFG2. This also fixes the relocation calculation of script 71 in SQ3, so remove the comment that the script has broken relocation entries
...
svn-id: r49394
2010-06-02 15:31:20 +00:00
Filippos Karapetis
de2e935b2c
Wrote the initialization code for the exports and synonyms table to make more sense and fixed a bug with the initialization of the synonyms pointer, introduced with rev #49336
...
svn-id: r49360
2010-05-31 18:31:37 +00:00
Filippos Karapetis
3f4302214c
The save/load object init code is now unified with the regular object init code
...
svn-id: r49346
2010-05-31 11:25:59 +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
Max Horn
4e25867a67
SCI: Merge setLockers(1) call into Script::init
...
svn-id: r49337
2010-05-30 23:00:32 +00:00
Filippos Karapetis
a0ee93ece5
SCI: Script exports and synonyms are now initialized when a script is loaded. Removed a sanity check inside script_instantiate_sci0 for a bug which no longer exists
...
svn-id: r49336
2010-05-30 21:49:07 +00:00
Filippos Karapetis
dc4d61f718
- Merged the SCI0 scriptRelocate() and SCI11 heapRelocate() functions inside relocate(). scriptRelocate checked one more relocation entry, which seems wrong, so we're now checking for the correct number of relocations in all SCI versions
...
- Re-added the error when script + heap exceed 64KB (better than an assert) - this should theoretically never happen, and it never has for the games tested
- Removed the relocated sanity check - again, it shouldn't occur (else something else is wrong)
svn-id: r49332
2010-05-30 20:06:50 +00:00
Filippos Karapetis
016862ac3a
Moved setScriptSize() inside Script::init(), and removed a FIXME - the SCI1.1 word-align is done inside Script::init()
...
svn-id: r49330
2010-05-30 18:45:07 +00:00
Filippos Karapetis
29c2f30558
Unified the script loading code, and marked an issue with the SCI11 heap addresses
...
svn-id: r49329
2010-05-30 17:02:21 +00:00
Filippos Karapetis
5cdb13b3e8
Made load_script() a member of the Script class
...
svn-id: r49328
2010-05-30 16:38:08 +00:00
Lars Skovlund
dbe561c59b
Clarify reasoning behind hack in Script::scriptRelocate()
...
svn-id: r49320
2010-05-30 10:27:39 +00:00
Max Horn
4ecacdad16
SCI: Merge Script::relocateBlock and Object::relocate
...
The shared code now resides in a new static function named
relocateBlock, which is invoked by the two methods.
svn-id: r49316
2010-05-29 23:09:00 +00:00
Max Horn
42d6ed880b
SCI: Make Script::_exportTable const (yay :-)
...
svn-id: r49315
2010-05-29 21:42:42 +00:00
Max Horn
db475d1501
SCI: More const related changes; remove unnecessary casts which hide const issues
...
svn-id: r49248
2010-05-26 18:11:17 +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
bfaba64c6a
Made find_unique_script_block() a member of the Script class
...
svn-id: r49241
2010-05-26 14:25:51 +00:00
Filippos Karapetis
1c0bbb10cb
More work on controlling access to members of the Object class:
...
- Moved the code for initializing the object class, species and base object inside the Object class
- Made propertyOffsetToId() a method of the Object class
- Made relocateObject() a method of the Object class
- The Object getVariable() method now returns a reference to the requested variable
Only SegManager::reconstructScripts() is left needing direct access to the members of the Object class
svn-id: r49228
2010-05-26 08:27:24 +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
Matthew Hoops
3dda73d9a2
Add initial support for KQ6 Mac. Wrapper functions for read/writing to pointers are now used (found in util.*) for code that has different endianness in SCI1.1+ Mac games. Add support for Mac 'snd ' and 'CURS' resources. QFG1 Mac is not yet playable due to script compression.
...
svn-id: r49070
2010-05-18 04:17:58 +00:00
Filippos Karapetis
6d38cf8b8f
Made locateVarSelector() a method of the Object class
...
svn-id: r49031
2010-05-14 15:23:42 +00:00
Matthew Hoops
7147f8577e
Search through arrays for outgoing references to fix possible garbage collector problems; minor cleanup.
...
svn-id: r47989
2010-02-08 15:51:00 +00:00
Max Horn
bca7c6eef3
SCI: Move more stuff around
...
svn-id: r47836
2010-02-03 01:34:15 +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
Walter van Niftrik
473d8b7c2f
SCI: Add string support for odd-offset pointers into reg_t-based segments.
...
svn-id: r47572
2010-01-26 19:51:08 +00:00
Johannes Schickel
aed02365ec
Strip trailing spaces/tabs.
...
svn-id: r47541
2010-01-25 01:39:44 +00:00
Walter van Niftrik
10da245619
SCI: Cleanup
...
svn-id: r47506
2010-01-24 17:52:27 +00:00
Matthew Hoops
5382aa1ab0
SCI32:
...
- Set signature for Array/String
- Add the kernel table differences for the GK2 demo
- Implement kMessage changes in SCI32
- Use an empty string as the default path for all games now (and modify kValidPath to accept that only as valid)
- Add dereferencing for Arrays
svn-id: r46756
2009-12-30 16:00:56 +00:00
Martin Kiewitz
c992cd018c
SCI: returning back raw == 0, when script trying to access invalid memory
...
svn-id: r46720
2009-12-29 22:26:09 +00:00
Martin Kiewitz
3e5d8280fa
SCI: dont crash when scripts are trying to access invalid memory (fixes intro of lb2cd)
...
svn-id: r46718
2009-12-29 21:37:26 +00:00
Matthew Hoops
4be2788ffd
Some SCI32 (minor) String bug fixes and cleanup.
...
svn-id: r46492
2009-12-23 05:10:16 +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
a88aa2f45f
- Fixed the pathfinding issue for LSL5 room 640, where Patti walks off-screen (we still need a proper way of detecting this, though...)
...
- Made warnings where invalid pointers are dereferenced more precise
svn-id: r45257
2009-10-20 10:08:28 +00:00
Filippos Karapetis
e4c23834dd
Moved sci_ffs() inside iterator.cpp, the only place where it's actually used, and removed tools.*. Also, removed all the unused includes to tools.h from several places
...
svn-id: r45176
2009-10-16 23:29:00 +00:00
Filippos Karapetis
d6f5d93dbf
Started rewriting the Object struct into a class
...
svn-id: r44878
2009-10-10 15:58:51 +00:00
Willem Jan Palenstijn
860f7ce39b
SCI: Remove outdated comment
...
svn-id: r44805
2009-10-08 21:39:33 +00:00
Max Horn
76996301d1
SCI: Removed obsolete stringfrags code
...
svn-id: r44803
2009-10-08 21:29:45 +00:00
Willem Jan Palenstijn
7971d77dd6
SCI: Adjust isValidOffset to match changes from r44396,
...
and make maxSize report the valid space starting at offset.
svn-id: r44421
2009-09-27 21:00:45 +00:00
Willem Jan Palenstijn
77751a0455
SCI: change segment offsets in reg segments to be in half reg_t.
...
This makes offsets in raw and reg segments consistent, which
fixes string addressing in savegame dialogs.
svn-id: r44396
2009-09-27 12:23:14 +00:00
Willem Jan Palenstijn
933bdcf829
SCI: Add warning when dereferencing non-aligned stack pointer
...
svn-id: r44386
2009-09-27 01:49:35 +00:00
Filippos Karapetis
13ad217cdd
- Moved the SCI version in a global variable
...
- Changed all the SCI version checks to use getSciVersion()
- Also made getSciVersionDesc a global function (removes some ugly accessing of the SCI engine)
The fallback detector should work correctly now
svn-id: r44269
2009-09-23 10:55:35 +00:00