Commit Graph
266 Commits
Author SHA1 Message Date
Max Horn b51e9988e6 SCI: cleanup
svn-id: r43982
2009-09-06 12:58:43 +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
Sven Hesse 4b4b36cfb1 Fixing signed/unsigned comparison warning
svn-id: r43937
2009-09-04 08:37:53 +00:00
Filippos Karapetis 142922387c Moved some functions inside the SegManager class, and renamed alloc_clone() to allocateClone()
svn-id: r43935
2009-09-04 07:17:34 +00:00
Filippos Karapetis 1bbab8f191 Some renaming:
getresourceManager -> getResourceManger
resourceManager -> resMan
segmentManager ->segMan

svn-id: r43908
2009-09-02 12:02:37 +00:00
Matthew Hoops b5da8a5cdc - Split SCI_VERSION_32 into SCI_VERSION_2, SCI_VERSION_2_1, and SCI_VERSION_3 (each version has a different kernel table).
- Improve map detection.
- Fix SCI32 object and script initialization (Torin's Passage and GK1 scripts now start up, and probably most SCI2/2.1 games).
- Add SCI2 and SCI2.1 kernel tables.

svn-id: r43742
2009-08-25 23:02:57 +00:00
Filippos Karapetis ac025f4294 - Replaced more cases of EngineState parameters
- Made some version comparisons for old SCI0 versions easier to read
- Removed the GET_SEL32SV macro

svn-id: r43729
2009-08-25 15:14:29 +00:00
Filippos Karapetis ed66cad677 - Simplified the parameters of some functions
- Replaced some EngineState parameters
- The SCI version is now obtained from the resource manager or the segment manager, thereby simplifying several functions
- Plugged 2 leaks in the fallback detector
- Renamed the segment manager and resource manager to "segmentManager" and "resourceManager" in all places, for consistency

svn-id: r43722
2009-08-25 08:38:14 +00:00
Walter van Niftrik 7359c8f968 SCI: Read class table from vocab resource instead of scanning. This fixes
several "invalid selector" VM crashes caused by duplicate classes.

svn-id: r43680
2009-08-24 01:59:58 +00:00
Filippos Karapetis 60af2db2fd - Added more mappings from Sierra's internal IDs to our own ones. Hopefully, all SCI0-SCI11 games can now be detected correctly from the fallback detector
- Simplified some checks for old script types

svn-id: r43678
2009-08-23 21:57:30 +00:00
Joost Peters 6a3c595b01 remove \n's from error() calls
svn-id: r43571
2009-08-20 21:03:03 +00:00
Filippos Karapetis ca9bbce9b3 - Added game ID detection to the fallback detector. We still need to map some of Sierra's internal IDs to our own ones
- The class table is now created in the segment manager constructor

svn-id: r43504
2009-08-18 10:01:18 +00:00
Filippos Karapetis c38f58598b - Simplified some functions to accept only the parts of the EngineState they need as parameters, instead of the whole EngineState
- Moved the class table in the Segment manager - it's the only class using it directly
- Removed the sci11 flag from save games (we already know this, we don't need to store it)
- Moved script_get_segment() and get_class_address() inside the segment manager class
- Removed the script_locate_by_segment wrapper
- Simplified script_lookup_export() a lot by removing some paranoia checks
- Added some WIP code for automatically determining the game id in the fallback detector (still not working)
- General cleanup

svn-id: r43458
2009-08-17 05:55:21 +00:00
Max Horn 50cd2750cc SCI: Avoid using perror (it's not portable)
svn-id: r42866
2009-07-28 22:28:40 +00:00
Filippos Karapetis 31a0c80905 Moved the kernel and the vocabulary outside of the engine state (they're static data, which never changes during a game)
svn-id: r42398
2009-07-11 23:45:54 +00:00
Filippos Karapetis d55f7e72d0 Added auto-detection for games with older headers for script blocks, and removed game flag GF_SCI0_OLD
svn-id: r42211
2009-07-07 10:28:05 +00:00
Filippos Karapetis 522b161bec Replaced sciprintf() calls with printf, DebugPrintf, warning and error calls
svn-id: r42167
2009-07-06 10:39:22 +00:00
Max Horn 42de7a1573 Patch
svn-id: r41647
2009-06-18 22:09:57 +00:00
Walter van Niftrik a6ed05740f SCI: Moved resource36 handling into resource manager.
svn-id: r41349
2009-06-07 19:15:55 +00:00
Max Horn 10c54394bd SCI: Renamed EngineState::flags and version to _flags and _version (following our conventions); also slightly changed the EngineState constructor to init _version & _flags, and used this to make them constant
svn-id: r41177
2009-06-04 21:44:39 +00:00
Max Horn 6b1110b82d SCI: Moved MemObject code into a separate source file
svn-id: r41166
2009-06-04 11:45:17 +00:00
Filippos Karapetis e55388c787 Removed script_error_flag and script_debug_flag, which were used to error out if something went wrong and open the debugger console. Changed all the places where they were used to error() out instead, as ScummVM's debugger console can open on error()
svn-id: r41073
2009-05-31 15:34:23 +00:00
Torbjörn Andersson 0999534749 The error() and warning() functions add ! and newline automatically. (I didn't
look at debug() and debugC(), since I'm really bored with this now. :-)

svn-id: r41061
2009-05-31 10:02:16 +00:00
Filippos Karapetis c7c9f05cac Removed/replaced BREAKPOINT
svn-id: r41025
2009-05-30 10:42:08 +00:00
Max Horn 813853ccc2 SCI: Converted several fprintf(stderr) calls to warning/error (the remaining fprintf calls should probably be replaced by suitable debug/debugC/debugN invocations)
svn-id: r40993
2009-05-29 13:07:14 +00:00
Filippos Karapetis 2590511c7d Turned some errors into warnings, as they occur in KQ5CD
svn-id: r40804
2009-05-23 10:22:27 +00:00
Filippos Karapetis 4799cbf1c3 Removed the PREG, PSTK, IS_NULL_REG and REG_EQ defines
svn-id: r40767
2009-05-21 17:18:46 +00:00
Max Horn bba91075bf removed trailing whitespaces
svn-id: r40742
2009-05-20 17:53:31 +00:00
Max Horn 136fcb3810 SCI: Introduce a new subclass StringFrag of MemObject (does nothing right now); switched MemObject to subclass Common::Serializable
svn-id: r40714
2009-05-19 00:34:10 +00:00
Max Horn 790e235ae1 SCI: Removed ENTRY_IS_VALID macro
svn-id: r40690
2009-05-18 15:07:31 +00:00
Max Horn 99713ca7fa SCI: Tweaks, cleanup
svn-id: r40688
2009-05-18 12:36:04 +00:00
Max Horn a0b6f21a1a SCI: Fixed Table::initTable to invoke _table.clear()
svn-id: r40687
2009-05-18 12:35:42 +00:00
Max Horn 62876a5ad5 SCI: Changed SegManager to not pre-allocate _heap entries (leave the memory management to Common::Array)
svn-id: r40686
2009-05-18 12:35:18 +00:00
Max Horn 5170acd00c SCI: Removed the unused member SegManager::gc_mark_bits; changed some int params to SegmentId
svn-id: r40685
2009-05-18 12:34:56 +00:00
Max Horn fc9096ba1d SCI: Replaced SegManager::getHeap() by Script::getHeap()
svn-id: r40683
2009-05-18 12:34:03 +00:00
Max Horn 9c44705f05 SCI: Got rid of SEG_ID/SCRIPT_ID
svn-id: r40599
2009-05-15 09:28:31 +00:00
Max Horn 8f0b776afb SCI: Added SegManager::getScriptIfLoaded() method
svn-id: r40598
2009-05-15 09:27:39 +00:00
Max Horn 75c0d719c9 SCI: Turned several script related SegManager methods into Script methods
svn-id: r40597
2009-05-15 09:27:07 +00:00
Filippos Karapetis 565cfa074d Simplified SCI versions to be SCI version generations, and fixed some game entries in the process. Also, added a sanity check for invalid game entries
svn-id: r40596
2009-05-15 09:04:21 +00:00
Walter van Niftrik 67ce8fee85 SCI: A provisional fix for the "invalid selector" problem in KQ6 and other
SCI1.1 games.

svn-id: r40575
2009-05-14 22:33:31 +00:00
Filippos Karapetis 999d46b241 Started using game-specific flags and removed/replaced some SCI version checks with flags.
- The SCI0 new script header and the angles check have been replaced by the GF_SCI0_OLD flag
- The SCI0 new drawpic parameter and the new priority check have been replaced by the GF_SCI0_OLDGFXFUNCS flag
- Removed the code which retries to use the newer script header in SCI0 games if the detected one is wrong, as that case should be covered by the GF_SCI0_OLD flag
- Removed the leftover min_version and max_version variables from gamestate
- Cleaned up kGetTime() a bit

svn-id: r40552
2009-05-14 09:12:27 +00:00
Max Horn 7f29670843 SCI: Changed object / script local vars storage to use a Common::Array
svn-id: r40515
2009-05-12 23:30:42 +00:00
Max Horn 0255cd0213 SCI: Removed sci_memory.h/.cpp
svn-id: r40514
2009-05-12 23:30:10 +00:00
Walter van Niftrik eb8ddbe8f4 SCI: Fixed a valgrind warning.
svn-id: r40492
2009-05-12 14:58:44 +00:00
Max Horn 1949133d22 SCI: Simplified the Table class, by making it use an Common::Array internally. Increased savegame version, breaking compatibility to the previous one -- sorry for that, but some of my previous changes accidentally messed up the table syncing, resulting in messed up savegames anyway; these breakages should be fixed with this commit
svn-id: r40453
2009-05-11 13:32:00 +00:00
Max Horn 14aa9d70ac SCI: Replaced Cplain odeBlock array in class Script by a Common::Array<CodeBlock>
svn-id: r40433
2009-05-10 20:13:12 +00:00
Max Horn 019f87fd1b SCI: Changed object list in Script instances to use Common:::Array
svn-id: r40431
2009-05-10 19:17:51 +00:00
Max Horn 574dee8e1f SCI: Got rid of last traces of class SegInterface
svn-id: r40377
2009-05-08 09:54:24 +00:00
Max Horn 0223b7e490 SCI: Moved findCanonicAddress from SegInterface to MemObject
svn-id: r40376
2009-05-08 09:54:06 +00:00
Max Horn 8d4a4271bb SCI: Moved freeAtAddress from SegInterface to MemObject
svn-id: r40375
2009-05-08 09:53:49 +00:00