Commit graph

127 commits

Author SHA1 Message Date
Max Horn
5fc2428c99 SCI: SegmentObj's now set their type in constructor; replace central SegmentObj::createSegmentObj call in SegManager::allocSegment by several explicit 'new' statements; some extra cleanup
svn-id: r44242
2009-09-22 00:35:46 +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
Max Horn
e40cbe574e SCI: Rename engine/memobj.* to engine/segment.*
svn-id: r44155
2009-09-17 13:22:46 +00:00
Filippos Karapetis
dce185ba8b Made script_lookup_export() a method of SegManager
svn-id: r44140
2009-09-17 09:36:52 +00:00
Max Horn
280bee663e SCI: Change SegmentId from int to uint16; consistently use segment 0 to indicate an invalid segment
svn-id: r44131
2009-09-17 00:46:01 +00:00
Max Horn
10f898c90e SCI: Rename MemObject -> SegmentObj
svn-id: r44130
2009-09-17 00:45:12 +00:00
Max Horn
1f0e8ef470 SCI: More cleanup
svn-id: r44129
2009-09-17 00:44:22 +00:00
Max Horn
b26f744e23 SCI: cleanup
svn-id: r44128
2009-09-16 23:55:11 +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
bfe1538715 SCI: Misc cleanup
svn-id: r44093
2009-09-14 22:34:53 +00:00
Max Horn
8ac3db0801 SCI: Rename SegManager::kernelDeref*() methods to SegManager::deref*()
svn-id: r44083
2009-09-14 13:27:09 +00:00
Max Horn
0e834d0b87 SCI: kernelDeref*() functions are now seSegmentManager methods
svn-id: r44082
2009-09-14 13:13:20 +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
44b60d2750 SCI: Replace GET_SEGMENT_ANY and GET_OBJECT_SEGMENT macros by new segman methods
svn-id: r43999
2009-09-07 06:07:18 +00:00
Max Horn
eb8cf07db2 SCI: Rename SegManager::exports_wide to _exportsAreWide and changed it to a bool, and rename setExportWidth() to setExportAreWide()
svn-id: r43988
2009-09-06 13:01:26 +00:00
Max Horn
a550e2ea10 SCI: Replace "IntMapper *id_seg_map" in SegManager with a Common::HashMap<int,int>
This simplifies the code considerably. Also changed the savegame format
accordingly, which required me to bump the format version to 10. Old
saves should still load fine.

svn-id: r43986
2009-09-06 13:00:30 +00:00
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
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
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
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
Max Horn
42de7a1573 Patch
svn-id: r41647
2009-06-18 22:09:57 +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
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
Max Horn
d2dfa0ac11 SCI: cleanup
svn-id: r40581
2009-05-14 23:39:16 +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
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
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
Max Horn
b49dd22173 SCI: Renamed dstack_t -> DataStack; removed obsolete KF_OLD constant
svn-id: r40374
2009-05-08 09:53:31 +00:00
Max Horn
d8738b9090 SCI: Started to merge SegInterface into MemObject
svn-id: r40373
2009-05-08 09:53:10 +00:00
Max Horn
a41069d69b SCI: Started adding methods to MemObject subclasses: constructors, destructors, dereference() (and currently commented out refs to Common::Serializable
svn-id: r40295
2009-05-03 22:47:04 +00:00
Max Horn
d960c1e2a5 SCI: Completed transition from MemObject (a union of various structs) to MemObjectNEW (a baseclass for these structs)
svn-id: r40294
2009-05-03 22:46:38 +00:00
Max Horn
82f2672008 SCI: Changed SegManager to store the heap pointers in a Common::Arrray
svn-id: r40293
2009-05-03 22:46:11 +00:00
Max Horn
f108a31ad7 SCI: Made SegManager::heap_size unsigned
svn-id: r40290
2009-05-03 22:45:13 +00:00
Max Horn
5e955ea045 SCI: Continue transition from MemObject to MemObjectNEW
svn-id: r40274
2009-05-03 11:07:07 +00:00
Max Horn
50c8821072 SCI: Renamed MemObject::type and ::segmgr_id to _type resp. _segmgrId, and added accessor methods getType() and getSegMgrId()
svn-id: r40271
2009-05-03 09:30:33 +00:00
Max Horn
ba57b21d09 SCI: Changed SegManager to subclass Common::Serializable
svn-id: r40270
2009-05-03 09:25:15 +00:00